Class SmallBannerSpriteSource

java.lang.Object
com.petrolpark.client.sprite.SmallBannerSpriteSource
All Implemented Interfaces:
net.minecraft.client.renderer.texture.atlas.SpriteSource

public class SmallBannerSpriteSource extends Object implements net.minecraft.client.renderer.texture.atlas.SpriteSource
Takes textures, with the expected format being the same as vanilla Banner Pattern textures, and intelligently modifies them to be half the size. This is done in one of two ways:
  • "Top-and-Bottom" (top_and_bottom) finds the top and bottom rows of non-empty pixels and maps these to the top and bottom of the new texture, cutting out any rows of pixels in the middle.
  • "Squeeze" (squeeze) removes every other row of pixels.
The method to use can be defined in the metadata of the texture file, and will default to top_and_bottom. For example, in mybannertexture.png.mcmeta:
 
 "petrolpark:banner_splicer": {
   "splicer": "top_and_bottom"
  }
 
 
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<SmallBannerSpriteSource> CODEC
    • TYPE

      public static final net.minecraft.client.renderer.texture.atlas.SpriteSourceType TYPE
    • SMALL_BANNER_HEIGHT

      protected static final double SMALL_BANNER_HEIGHT
      See Also:
  • Constructor Details

    • SmallBannerSpriteSource

      public SmallBannerSpriteSource(String sourcePath, String prefix)
  • Method Details

    • run

      public void run(@Nonnull net.minecraft.server.packs.resources.ResourceManager resourceManager, @Nonnull net.minecraft.client.renderer.texture.atlas.SpriteSource.Output output)
      Specified by:
      run in interface net.minecraft.client.renderer.texture.atlas.SpriteSource
    • type

      public net.minecraft.client.renderer.texture.atlas.SpriteSourceType type()
      Specified by:
      type in interface net.minecraft.client.renderer.texture.atlas.SpriteSource