mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 02:34:49 +00:00
Floor values are set for max health, combat regen, health regen, melee damage, and projectile damage when changing them now.
This commit is contained in:
1 parent
cd5b4c0633
commit
3c1bc30e44
6 files changed
+16
-12
No files matched your search
@@ -8,6 +8,9 @@ import noppes.npcs.constants.EnumPotionType;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class DataStats {
|
||||
|
||||
private float attackStrength = 5;
|
||||
@@ -173,12 +176,12 @@ public class DataStats {
|
||||
return attackStrength;
|
||||
}
|
||||
public void setAttackStrength(float strength){
|
||||
attackStrength = strength;
|
||||
attackStrength = (float)(Math.floor(strength));
|
||||
npc.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackStrength);
|
||||
}
|
||||
|
||||
public void setMaxHealth(double maxHealth) {
|
||||
this.maxHealth = maxHealth;
|
||||
this.maxHealth = Math.floor(maxHealth);
|
||||
npc.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealth);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user