mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-15 20:44:50 +00:00
Implemented custom item rotation rate, and start using, using, stop using, finished using events for custom items.
This commit is contained in:
1 parent
11cc46b48f
commit
aab550cdca
7 files changed
+212
-36
No files matched your search
@@ -41,6 +41,7 @@ public class ScriptCustomItem extends ScriptItemStack implements ICustomItem, IS
|
||||
public float translateX, translateY, translateZ;
|
||||
public float scaleX = 1.0F, scaleY = 1.0F, scaleZ = 1.0F;
|
||||
public float rotationX, rotationY, rotationZ;
|
||||
public float rotationXRate, rotationYRate, rotationZRate;
|
||||
|
||||
public ScriptCustomItem(ItemStack item) {
|
||||
super(item);
|
||||
@@ -273,6 +274,13 @@ public class ScriptCustomItem extends ScriptItemStack implements ICustomItem, IS
|
||||
saveItemData();
|
||||
}
|
||||
|
||||
public void setRotationRate(float rotationXRate, float rotationYRate, float rotationZRate){
|
||||
this.rotationXRate = rotationXRate;
|
||||
this.rotationYRate = rotationYRate;
|
||||
this.rotationZRate = rotationZRate;
|
||||
saveItemData();
|
||||
}
|
||||
|
||||
public void setScale(float scaleX, float scaleY, float scaleZ){
|
||||
this.scaleX = scaleX;
|
||||
this.scaleY = scaleY;
|
||||
@@ -302,6 +310,21 @@ public class ScriptCustomItem extends ScriptItemStack implements ICustomItem, IS
|
||||
saveItemData();
|
||||
}
|
||||
|
||||
public void setRotationXRate(float rotationXRate) {
|
||||
this.rotationXRate = rotationXRate;
|
||||
saveItemData();
|
||||
}
|
||||
|
||||
public void setRotationYRate(float rotationYRate) {
|
||||
this.rotationYRate = rotationYRate;
|
||||
saveItemData();
|
||||
}
|
||||
|
||||
public void setRotationZRate(float rotationZRate) {
|
||||
this.rotationZRate = rotationZRate;
|
||||
saveItemData();
|
||||
}
|
||||
|
||||
public void setScaleX(float scaleX) {
|
||||
this.scaleX = scaleX;
|
||||
saveItemData();
|
||||
@@ -344,6 +367,18 @@ public class ScriptCustomItem extends ScriptItemStack implements ICustomItem, IS
|
||||
return rotationZ;
|
||||
}
|
||||
|
||||
public float getRotationXRate() {
|
||||
return rotationXRate;
|
||||
}
|
||||
|
||||
public float getRotationYRate() {
|
||||
return rotationYRate;
|
||||
}
|
||||
|
||||
public float getRotationZRate() {
|
||||
return rotationZRate;
|
||||
}
|
||||
|
||||
public float getScaleX() {
|
||||
return scaleX;
|
||||
}
|
||||
@@ -392,6 +427,10 @@ public class ScriptCustomItem extends ScriptItemStack implements ICustomItem, IS
|
||||
compound.setFloat("RotationY",this.rotationY);
|
||||
compound.setFloat("RotationZ",this.rotationZ);
|
||||
|
||||
compound.setFloat("RotationXRate",this.rotationXRate);
|
||||
compound.setFloat("RotationYRate",this.rotationYRate);
|
||||
compound.setFloat("RotationZRate",this.rotationZRate);
|
||||
|
||||
compound.setFloat("ScaleX",this.scaleX);
|
||||
compound.setFloat("ScaleY",this.scaleY);
|
||||
compound.setFloat("ScaleZ",this.scaleZ);
|
||||
@@ -427,6 +466,10 @@ public class ScriptCustomItem extends ScriptItemStack implements ICustomItem, IS
|
||||
this.rotationY = compound.getFloat("RotationY");
|
||||
this.rotationZ = compound.getFloat("RotationZ");
|
||||
|
||||
this.rotationXRate = compound.getFloat("RotationXRate");
|
||||
this.rotationYRate = compound.getFloat("RotationYRate");
|
||||
this.rotationZRate = compound.getFloat("RotationZRate");
|
||||
|
||||
this.scaleX = compound.getFloat("ScaleX");
|
||||
this.scaleY = compound.getFloat("ScaleY");
|
||||
this.scaleZ = compound.getFloat("ScaleZ");
|
||||
|
||||
Reference in new issue
Block a user