Package com.petrolpark.client.sprite
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.
top_and_bottom. For example, in mybannertexture.png.mcmeta:
"petrolpark:banner_splicer": {
"splicer": "top_and_bottom"
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final recordstatic enumprotected static final recordprotected static final recordNested classes/interfaces inherited from interface net.minecraft.client.renderer.texture.atlas.SpriteSource
net.minecraft.client.renderer.texture.atlas.SpriteSource.Output, net.minecraft.client.renderer.texture.atlas.SpriteSource.SpriteSupplier -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final doubleprotected static final doubleprotected static final doublestatic final com.mojang.serialization.MapCodec<SmallBannerSpriteSource> protected static final doublestatic final net.minecraft.client.renderer.texture.atlas.SpriteSourceTypeFields inherited from interface net.minecraft.client.renderer.texture.atlas.SpriteSource
TEXTURE_ID_CONVERTER -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
CODEC
-
TYPE
public static final net.minecraft.client.renderer.texture.atlas.SpriteSourceType TYPE -
BANNER_FRONT_HEIGHT
protected static final double BANNER_FRONT_HEIGHT- See Also:
-
BANNER_FRONT_HALF_HEIGHT
protected static final double BANNER_FRONT_HALF_HEIGHT- See Also:
-
BANNER_FRONT_WIDTH
protected static final double BANNER_FRONT_WIDTH- See Also:
-
SMALL_BANNER_HEIGHT
protected static final double SMALL_BANNER_HEIGHT- See Also:
-
-
Constructor Details
-
SmallBannerSpriteSource
-
-
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:
runin interfacenet.minecraft.client.renderer.texture.atlas.SpriteSource
-
type
public net.minecraft.client.renderer.texture.atlas.SpriteSourceType type()- Specified by:
typein interfacenet.minecraft.client.renderer.texture.atlas.SpriteSource
-