mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 23:37:32 +00:00
Added get/setHunger, and get/setSaturation functions for ScriptPlayer.
The player KeyPressed event now sends a list of keys that are currently pressed by the player.
This commit is contained in:
1 parent
67c83b1ce9
commit
7de585843d
5 files changed
+68
-5
No files matched your search
@@ -69,6 +69,22 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
|
||||
NoppesUtilPlayer.teleportPlayer(player, x, y, z, dimensionId);
|
||||
}
|
||||
|
||||
public int getHunger(){
|
||||
return player.getFoodStats().getFoodLevel();
|
||||
}
|
||||
|
||||
public void setHunger(int hunger){
|
||||
player.getFoodStats().setFoodLevel(hunger);
|
||||
}
|
||||
|
||||
public float getSaturation(){
|
||||
return player.getFoodStats().getSaturationLevel();
|
||||
}
|
||||
|
||||
public void setSaturation(float saturation){
|
||||
player.getFoodStats().setFoodSaturationLevel(saturation);
|
||||
}
|
||||
|
||||
public int getDimension(){
|
||||
return player.dimension;
|
||||
}
|
||||
@@ -329,6 +345,10 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
|
||||
}
|
||||
}
|
||||
|
||||
public void setRotation(float rotationYaw){
|
||||
NoppesUtilPlayer.teleportPlayer(player, player.posX, player.posY, player.posZ, rotationYaw, player.rotationPitch, player.dimension);
|
||||
}
|
||||
|
||||
public void setRotation(float rotationYaw, float rotationPitch){
|
||||
NoppesUtilPlayer.teleportPlayer(player, player.posX, player.posY, player.posZ, rotationYaw, rotationPitch, player.dimension);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user