Class Stitcher<T extends Stitcher.Entry>
java.lang.Object
net.minecraft.client.renderer.texture.Stitcher<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
(package private) static final record
Stitcher.Holder<T extends Stitcher.Entry>
static class
Stitcher.Region<T extends Stitcher.Entry>
static interface
Stitcher.SpriteLoader<T extends Stitcher.Entry>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Comparator
<Stitcher.Holder<?>> private static final org.slf4j.Logger
private final int
private final int
private final int
private final List
<Stitcher.Region<T>> private int
private int
private final List
<Stitcher.Holder<T>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
addToStorage
(Stitcher.Holder<T> pHolder) Attempts to find space for specifiedholder
.private boolean
expand
(Stitcher.Holder<T> pHolder) Attempts to expand stitched texture in order to make space for specifiedholder
.void
gatherSprites
(Stitcher.SpriteLoader<T> pLoader) int
int
getWidth()
void
registerSprite
(T pStitcherEntry) (package private) static int
smallestFittingMinTexel
(int pDimension, int pMipLevel) void
stitch()
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
HOLDER_COMPARATOR
-
mipLevel
private final int mipLevel -
texturesToBeStitched
-
storage
-
storageX
private int storageX -
storageY
private int storageY -
maxWidth
private final int maxWidth -
maxHeight
private final int maxHeight
-
-
Constructor Details
-
Stitcher
public Stitcher(int pMaxWidth, int pMaxHeight, int pMipLevel)
-
-
Method Details
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
registerSprite
-
stitch
public void stitch() -
gatherSprites
-
smallestFittingMinTexel
static int smallestFittingMinTexel(int pDimension, int pMipLevel) -
addToStorage
Attempts to find space for specifiedholder
.- Returns:
true
if there was space;false
otherwise
-
expand
Attempts to expand stitched texture in order to make space for specifiedholder
.- Returns:
true
if there was enough space to expand the texture;false
otherwise
-