mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 05:15:11 +00:00
1.7.10 Files
Files added
This commit is contained in:
1 parent
393ea9b463
commit
a31efb2dc3
1768 files changed
+84831
No files matched your search
@@ -0,0 +1,47 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
public class ModelPartConfig {
|
||||
public float scaleX = 1, scaleY = 1, scaleZ = 1;
|
||||
public float transX = 0, transY = 0, transZ = 0;
|
||||
|
||||
|
||||
public NBTTagCompound writeToNBT(){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setFloat("ScaleX", scaleX);
|
||||
compound.setFloat("ScaleY", scaleY);
|
||||
compound.setFloat("ScaleZ", scaleZ);
|
||||
|
||||
compound.setFloat("TransX", transX);
|
||||
compound.setFloat("TransY", transY);
|
||||
compound.setFloat("TransZ", transZ);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound compound){
|
||||
scaleX = ValueUtil.correctFloat(compound.getFloat("ScaleX"), 0.5f, 1.5f);
|
||||
scaleY = ValueUtil.correctFloat(compound.getFloat("ScaleY"), 0.5f, 1.5f);
|
||||
scaleZ = ValueUtil.correctFloat(compound.getFloat("ScaleZ"), 0.5f, 1.5f);
|
||||
|
||||
transX = compound.getFloat("TransX");
|
||||
transY = compound.getFloat("TransY");
|
||||
transZ = compound.getFloat("TransZ");
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return "ScaleX: " + scaleX + " - ScaleY: " + scaleY + " - ScaleZ: " + scaleZ;
|
||||
}
|
||||
|
||||
public void setScale(float x, float y, float z) {
|
||||
scaleX = x;
|
||||
scaleY = y;
|
||||
scaleZ = z;
|
||||
}
|
||||
public void setScale(float x, float y) {
|
||||
scaleZ = scaleX = x;
|
||||
scaleY = y;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user