mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 21:05:06 +00:00
More fixes to global NPC scripts not executing on servers, and added more functions to IEntityLivingBase.
This commit is contained in:
1 parent
8d52e9356c
commit
699b24e467
6 files changed
+51
-21
No files matched your search
@@ -779,14 +779,14 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
/**
|
||||
* @return The melee strength
|
||||
*/
|
||||
public float getMeleeStrength(){
|
||||
public double getMeleeStrength(){
|
||||
return npc.stats.getAttackStrength();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param strength The melee strength
|
||||
*/
|
||||
public void setMeleeStrength(float strength){
|
||||
public void setMeleeStrength(double strength){
|
||||
npc.stats.setAttackStrength(strength);
|
||||
}
|
||||
|
||||
@@ -1007,14 +1007,14 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
/**
|
||||
* @param resistance Knockback resistance (0-2) default is 1
|
||||
*/
|
||||
public void setKnockbackResistance(float resistance){
|
||||
npc.stats.resistances.knockback = ValueUtil.correctFloat(resistance, 0, 2);
|
||||
public void setKnockbackResistance(double resistance){
|
||||
npc.stats.resistances.knockback = ValueUtil.correctFloat((float) resistance, 0, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns Knockback Resistance
|
||||
*/
|
||||
public float getKnockbackResistance(){
|
||||
public double getKnockbackResistance(){
|
||||
return npc.stats.resistances.knockback;
|
||||
}
|
||||
|
||||
@@ -1141,11 +1141,11 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
return this.npc.ai.hasFlyLimit;
|
||||
}
|
||||
|
||||
public void setSpeed(int speed) {
|
||||
public void setSpeed(double speed) {
|
||||
npc.ai.setWalkingSpeed(speed);
|
||||
}
|
||||
|
||||
public int getSpeed() {
|
||||
public double getSpeed() {
|
||||
return npc.ai.getWalkingSpeed();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user