Animated Texture Support

This commit is contained in:
Kam committed 2026-02-28 18:34:21 -05:00
1 parent 988dbe0cd2
commit de2fcea154
17 files changed
+578 -21

No files matched your search

@@ -12,6 +12,11 @@ public class ItemDisplayData {
public Boolean durabilityShow = false;
public Integer durabilityColor = -1;
// Animation
public Boolean animated = false;
public Integer frameCount = 1;
public Integer frametime = 2;
public NBTTagCompound writeToNBT() {
NBTTagCompound compound = new NBTTagCompound();
this.writeToNBT(compound);
@@ -42,6 +47,10 @@ public class ItemDisplayData {
this.setFloat(compound, "TranslateY", this.translateY);
this.setFloat(compound, "TranslateZ", this.translateZ);
this.setBoolean(compound, "Animated", this.animated);
this.setInteger(compound, "FrameCount", this.frameCount);
this.setInteger(compound, "FrameTime", this.frametime);
return compound;
}
@@ -97,6 +106,16 @@ public class ItemDisplayData {
if (compound.hasKey("TranslateZ")) {
this.translateZ = compound.getFloat("TranslateZ");
}
if (compound.hasKey("Animated")) {
this.animated = compound.getBoolean("Animated");
}
if (compound.hasKey("FrameCount")) {
this.frameCount = Math.max(1, compound.getInteger("FrameCount"));
}
if (compound.hasKey("FrameTime")) {
this.frametime = Math.max(1, compound.getInteger("FrameTime"));
}
}
private void setBoolean(NBTTagCompound compound, String key, Boolean value) {