mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 09:09:08 +00:00
IJobPuppet:
-Added the option to not interpolate between angles and move from one value to another at a constant speed.
This commit is contained in:
1 parent
b4cb69000e
commit
4346992f14
4 files changed
+64
-17
No files matched your search
@@ -19,6 +19,7 @@ public class JobPuppet extends JobInterface{
|
||||
|
||||
public boolean animate = false;
|
||||
public float animRate = 1.0F;
|
||||
public boolean interpolate = true;
|
||||
|
||||
//Client-sided use
|
||||
public float[] bipedRotsHead = {0,0,0};
|
||||
@@ -46,6 +47,7 @@ public class JobPuppet extends JobInterface{
|
||||
compound.setBoolean("PuppetMoving", whileMoving);
|
||||
compound.setBoolean("PuppetFullAngles", fullAngles);
|
||||
|
||||
compound.setBoolean("PuppetInterpolate", interpolate);
|
||||
compound.setBoolean("PuppetAnimate", animate);
|
||||
compound.setFloat("PuppetAnimSpeed", animRate);
|
||||
return compound;
|
||||
@@ -65,6 +67,11 @@ public class JobPuppet extends JobInterface{
|
||||
whileMoving = compound.getBoolean("PuppetMoving");
|
||||
fullAngles = compound.getBoolean("PuppetFullAngles");
|
||||
|
||||
if (!compound.hasKey("PuppetInterpolate")) {
|
||||
interpolate = true;
|
||||
} else {
|
||||
interpolate = compound.getBoolean("PuppetInterpolate");
|
||||
}
|
||||
animate = compound.getBoolean("PuppetAnimate");
|
||||
animRate = compound.getFloat("PuppetAnimSpeed");
|
||||
}
|
||||
@@ -118,9 +125,9 @@ public class JobPuppet extends JobInterface{
|
||||
}
|
||||
|
||||
public void readNBT(NBTTagCompound compound){
|
||||
rotationX = ValueUtil.correctFloat(compound.getFloat("RotationX"), -0.5f, 0.5f);
|
||||
rotationY = ValueUtil.correctFloat(compound.getFloat("RotationY"), -0.5f, 0.5f);
|
||||
rotationZ = ValueUtil.correctFloat(compound.getFloat("RotationZ"), -0.5f, 0.5f);
|
||||
rotationX = compound.getFloat("RotationX");
|
||||
rotationY = compound.getFloat("RotationY");
|
||||
rotationZ = compound.getFloat("RotationZ");
|
||||
pivotX = compound.getFloat("PivotX");
|
||||
pivotY = compound.getFloat("PivotY");
|
||||
pivotZ = compound.getFloat("PivotZ");
|
||||
|
||||
Reference in new issue
Block a user