mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 15:24:46 +00:00
Enabled fly button in movement, and extended max values for several NPC attributes, converting some to floats and doubles.
NPCs fly with speed based on their movement speed now.
This commit is contained in:
1 parent
44d4e74279
commit
23686dc3b8
35 files changed
+258
-189
No files matched your search
@@ -10,7 +10,7 @@ import noppes.npcs.util.ValueUtil;
|
||||
|
||||
public class DataStats {
|
||||
|
||||
private int attackStrength = 5;
|
||||
private float attackStrength = 5;
|
||||
public int attackSpeed = 20, attackRange = 2, knockback = 0;
|
||||
public int minDelay = 20, maxDelay = 40, rangedRange = 15, fireRate = 5, burstCount = 1, shotCount = 1, accuracy = 60;
|
||||
public int aggroRange = 16;
|
||||
@@ -19,7 +19,7 @@ public class DataStats {
|
||||
public int potionDuration = 5; //20 = 1 second
|
||||
public int potionAmp = 0;
|
||||
|
||||
public int maxHealth = 20;
|
||||
public double maxHealth = 20;
|
||||
public int respawnTime = 20;
|
||||
public int spawnCycle = 0;
|
||||
public boolean hideKilledBody = false;
|
||||
@@ -32,10 +32,11 @@ public class DataStats {
|
||||
public boolean canDrown = true;
|
||||
public boolean burnInSun = false;
|
||||
public boolean noFallDamage = false;
|
||||
public int healthRegen = 1;
|
||||
public int combatRegen = 0;
|
||||
|
||||
public int pDamage = 4, pImpact = 0, pSize = 5, pSpeed = 10, pArea = 0, pDur = 5;
|
||||
public float healthRegen = 1;
|
||||
public float combatRegen = 0;
|
||||
|
||||
public float pDamage = 4;
|
||||
public int pImpact = 0, pSize = 5, pSpeed = 10, pArea = 0, pDur = 5;
|
||||
public boolean pPhysics = true, pXlr8 = false, pGlows = false, pExplode = false;
|
||||
public boolean pRender3D = false, pSpin = false, pStick = false;
|
||||
public EnumPotionType pEffect = EnumPotionType.None;
|
||||
@@ -55,16 +56,16 @@ public class DataStats {
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound compound)
|
||||
{
|
||||
compound.setTag("Resistances", resistances.writeToNBT());
|
||||
compound.setInteger("MaxHealth", maxHealth);
|
||||
compound.setDouble("MaxHealth", maxHealth);
|
||||
compound.setInteger("AggroRange", aggroRange);
|
||||
compound.setBoolean("HideBodyWhenKilled", hideKilledBody);
|
||||
compound.setInteger("RespawnTime", respawnTime);
|
||||
compound.setInteger("SpawnCycle", spawnCycle);
|
||||
compound.setInteger("CreatureType", creatureType.ordinal());
|
||||
compound.setInteger("HealthRegen", healthRegen);
|
||||
compound.setInteger("CombatRegen", combatRegen);
|
||||
compound.setFloat("HealthRegen", healthRegen);
|
||||
compound.setFloat("CombatRegen", combatRegen);
|
||||
|
||||
compound.setInteger("AttackStrenght", attackStrength);
|
||||
compound.setFloat("AttackStrenght", attackStrength);
|
||||
compound.setInteger("AttackRange", attackRange);
|
||||
compound.setInteger("AttackSpeed", attackSpeed);
|
||||
compound.setInteger("KnockBack", knockback);
|
||||
@@ -80,7 +81,7 @@ public class DataStats {
|
||||
compound.setInteger("ShotCount", shotCount);
|
||||
compound.setInteger("Accuracy", accuracy);
|
||||
|
||||
compound.setInteger("pDamage", pDamage);
|
||||
compound.setFloat("pDamage", pDamage);
|
||||
compound.setInteger("pImpact", pImpact);
|
||||
compound.setInteger("pSize", pSize);
|
||||
compound.setInteger("pSpeed", pSpeed);
|
||||
@@ -113,16 +114,16 @@ public class DataStats {
|
||||
public void readToNBT(NBTTagCompound compound)
|
||||
{
|
||||
resistances.readToNBT(compound.getCompoundTag("Resistances"));
|
||||
setMaxHealth(compound.getInteger("MaxHealth"));
|
||||
setMaxHealth(compound.getDouble("MaxHealth"));
|
||||
hideKilledBody = compound.getBoolean("HideBodyWhenKilled");
|
||||
aggroRange = compound.getInteger("AggroRange");
|
||||
respawnTime = compound.getInteger("RespawnTime");
|
||||
spawnCycle = compound.getInteger("SpawnCycle");
|
||||
creatureType = EnumCreatureAttribute.values()[compound.getInteger("CreatureType") % EnumPotionType.values().length];
|
||||
healthRegen = compound.getInteger("HealthRegen");
|
||||
combatRegen = compound.getInteger("CombatRegen");
|
||||
healthRegen = compound.getFloat("HealthRegen");
|
||||
combatRegen = compound.getFloat("CombatRegen");
|
||||
|
||||
setAttackStrength(compound.getInteger("AttackStrenght"));
|
||||
setAttackStrength(compound.getFloat("AttackStrenght"));
|
||||
attackSpeed = compound.getInteger("AttackSpeed");
|
||||
attackRange = compound.getInteger("AttackRange");
|
||||
knockback = compound.getInteger("KnockBack");
|
||||
@@ -138,7 +139,7 @@ public class DataStats {
|
||||
shotCount = ValueUtil.CorrectInt(compound.getInteger("ShotCount"), 1, 10);
|
||||
accuracy = compound.getInteger("Accuracy");
|
||||
|
||||
pDamage = compound.getInteger("pDamage");
|
||||
pDamage = compound.getFloat("pDamage");
|
||||
pImpact = compound.getInteger("pImpact");
|
||||
pSize = compound.getInteger("pSize");
|
||||
pSpeed = compound.getInteger("pSpeed");
|
||||
@@ -168,15 +169,15 @@ public class DataStats {
|
||||
npc.setImmuneToFire(immuneToFire);
|
||||
}
|
||||
|
||||
public int getAttackStrength(){
|
||||
public float getAttackStrength(){
|
||||
return attackStrength;
|
||||
}
|
||||
public void setAttackStrength(int strength){
|
||||
public void setAttackStrength(float strength){
|
||||
attackStrength = strength;
|
||||
npc.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackStrength);
|
||||
}
|
||||
|
||||
public void setMaxHealth(int maxHealth) {
|
||||
public void setMaxHealth(double maxHealth) {
|
||||
this.maxHealth = maxHealth;
|
||||
npc.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealth);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user