mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 20:52:36 +00:00
Added get/setRotationType to ScriptNpc. Added get/setMotion for x, y, z components to ScriptEntity. Fixed an NPC wand crash.
This commit is contained in:
1 parent
e676c808e3
commit
e6f97784ff
6 files changed
+68
-27
No files matched your search
@@ -101,7 +101,7 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
* @param x The entities x position
|
||||
*/
|
||||
public void setX(double x){
|
||||
entity.posX = x;
|
||||
entity.setPosition(x, entity.posY, entity.posZ);;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,7 +115,7 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
* @param y The entities y position
|
||||
*/
|
||||
public void setY(double y){
|
||||
entity.posY = y;
|
||||
entity.setPosition(entity.posX, y, entity.posZ);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,7 +129,52 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
* @param z The entities x position
|
||||
*/
|
||||
public void setZ(double z){
|
||||
entity.posZ = z;
|
||||
entity.setPosition(entity.posX, entity.posY, z);;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The entities z motion
|
||||
*/
|
||||
public double getMotionX(){
|
||||
return entity.motionX;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param x The entities x motion
|
||||
*/
|
||||
public void setMotionX(double x){
|
||||
entity.motionX = x;
|
||||
entity.velocityChanged = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The entities x motion
|
||||
*/
|
||||
public double getMotionY(){
|
||||
return entity.motionY;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param y The entities y motion
|
||||
*/
|
||||
public void setMotionY(double y){
|
||||
entity.motionY = y;
|
||||
entity.velocityChanged = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The entities y motion
|
||||
*/
|
||||
public double getMotionZ(){
|
||||
return entity.motionZ;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param z The entities z motion
|
||||
*/
|
||||
public void setMotionZ(double z){
|
||||
entity.motionZ = z;
|
||||
entity.velocityChanged = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,10 +2,7 @@ package noppes.npcs.scripted.entity;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
import noppes.npcs.constants.EnumJobType;
|
||||
import noppes.npcs.constants.EnumNavType;
|
||||
import noppes.npcs.constants.EnumRoleType;
|
||||
import noppes.npcs.constants.*;
|
||||
import noppes.npcs.controllers.Line;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
@@ -90,6 +87,17 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
npc.ai.orientation = (int)rotation;
|
||||
super.setRotation(rotation);
|
||||
}
|
||||
public void setRotationType(int rotationType){
|
||||
for (EnumStandingType e : EnumStandingType.values()) {
|
||||
if (e.ordinal() == rotationType) {
|
||||
npc.ai.standingType = e;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
public int getRotationType(){
|
||||
return npc.ai.standingType.ordinal();
|
||||
}
|
||||
/**
|
||||
* @param name The name of the npc
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user