mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 13:52:23 +00:00
Add Disabling All Damage
Cleaned Up some Lang Code Added Disabling All Damage to Stats Moved Disable Damage from Resistances to Stats Added Disable Damage Message
This commit is contained in:
1 parent
2d70b0091b
commit
24790b7952
6 files changed
+27
-14
No files matched your search
@@ -60,7 +60,7 @@ import noppes.npcs.entity.old.EntityNpcNagaFemale;
|
||||
import noppes.npcs.entity.old.EntityNpcNagaMale;
|
||||
import noppes.npcs.entity.old.EntityNpcSkeleton;
|
||||
|
||||
@Mod(modid = "customnpcs", name = "CustomNpcs", version = "1.2.3")
|
||||
@Mod(modid = "customnpcs", name = "CustomNpcs", version = "1.24")
|
||||
public class CustomNpcs {
|
||||
|
||||
@ConfigProp(info = "Disable Chat Bubbles")
|
||||
|
||||
@@ -9,6 +9,8 @@ public class Resistances {
|
||||
public float arrow = 1f;
|
||||
public float playermelee = 1f;
|
||||
public float explosion = 1f;
|
||||
|
||||
public boolean disableDamage = false;
|
||||
|
||||
public NBTTagCompound writeToNBT() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
@@ -16,6 +18,7 @@ public class Resistances {
|
||||
compound.setFloat("Arrow", arrow);
|
||||
compound.setFloat("Melee", playermelee);
|
||||
compound.setFloat("Explosion", explosion);
|
||||
compound.setBoolean("disableDamage", disableDamage);
|
||||
return compound;
|
||||
}
|
||||
|
||||
@@ -24,9 +27,14 @@ public class Resistances {
|
||||
arrow = compound.getFloat("Arrow");
|
||||
playermelee = compound.getFloat("Melee");
|
||||
explosion = compound.getFloat("Explosion");
|
||||
disableDamage = compound.getBoolean("disableDamage");
|
||||
}
|
||||
|
||||
public float applyResistance(DamageSource source, float damage) {
|
||||
if(disableDamage){
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(source.damageType.equals("arrow") || source.damageType.equals("thrown")){
|
||||
damage *= (2 - arrow);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,11 @@ public class SubGuiNpcResistanceProperties extends SubGuiInterface implements IS
|
||||
addLabel(new GuiNpcLabel(3,"stats.explosion", guiLeft + 4, guiTop + 81));
|
||||
addSlider(new GuiNpcSlider(this, 3, guiLeft + 94, guiTop + 76, (int)(resistances.explosion * 100 - 100) + "%", resistances.explosion / 2));
|
||||
|
||||
addButton(new GuiNpcButton(66, guiLeft + 190, guiTop + 190, 60, 20, "gui.done"));
|
||||
if(resistances.disableDamage){
|
||||
addLabel(new GuiNpcLabel(4,"stats.disabletrue", guiLeft + 4, guiTop + 103));
|
||||
}
|
||||
|
||||
addButton(new GuiNpcButton(66, guiLeft + 190, guiTop + 190, 60, 20, "gui.done"));
|
||||
}
|
||||
|
||||
protected void actionPerformed(GuiButton guibutton)
|
||||
|
||||
@@ -45,7 +45,6 @@ public class GuiNpcStats extends GuiNPCInterface2 implements ITextfieldListener,
|
||||
|
||||
addButton(new GuiNpcButton(0,guiLeft + 82, y+=22, 56, 20, "selectServer.edit"));
|
||||
addLabel(new GuiNpcLabel(2,"stats.respawn", guiLeft + 5, y + 5));
|
||||
|
||||
|
||||
this.addButton(new GuiNpcButton(2, guiLeft + 82, y+=22, 56, 20, "selectServer.edit"));
|
||||
addLabel(new GuiNpcLabel(5,"stats.meleeproperties", guiLeft + 5, y + 5));
|
||||
@@ -53,12 +52,14 @@ public class GuiNpcStats extends GuiNPCInterface2 implements ITextfieldListener,
|
||||
addLabel(new GuiNpcLabel(6,"stats.rangedproperties", guiLeft + 5, y + 5));
|
||||
this.addButton(new GuiNpcButton(9, guiLeft + 217, y, 56, 20, "selectServer.edit"));
|
||||
addLabel(new GuiNpcLabel(7,"stats.projectileproperties", guiLeft + 140, y + 5));
|
||||
|
||||
this.addButton(new GuiNpcButton(15, guiLeft + 82, y+=34, 56, 20, "selectServer.edit"));
|
||||
addLabel(new GuiNpcLabel(15,"potion.resistance", guiLeft + 5, y + 5));
|
||||
|
||||
|
||||
addButton(new GuiNpcButton(4,guiLeft + 82, y+=34, 56, 20, new String[]{"gui.no","gui.yes"} ,npc.isImmuneToFire()? 1:0));
|
||||
this.addButton(new GuiNpcButton(15, guiLeft + 82, y+=34, 56, 20, "selectServer.edit"));
|
||||
addLabel(new GuiNpcLabel(15,"potion.resistance", guiLeft + 5, y + 5));
|
||||
|
||||
this.addButton(new GuiNpcButton(21, guiLeft + 217, y, 56, 20, new String[]{"gui.no","gui.yes"}, this.stats.resistances.disableDamage? 1:0));
|
||||
addLabel(new GuiNpcLabel(21,"stats.disabledamage", guiLeft + 140, y + 5));
|
||||
|
||||
addButton(new GuiNpcButton(4,guiLeft + 82, y+=34, 56, 20, new String[]{"gui.no","gui.yes"} ,npc.isImmuneToFire()? 1:0));
|
||||
addLabel(new GuiNpcLabel(10,"stats.fireimmune", guiLeft + 5, y + 5));
|
||||
addButton(new GuiNpcButton(5,guiLeft + 217, y, 56, 20, new String[]{"gui.no","gui.yes"} ,stats.canDrown? 1:0));
|
||||
addLabel(new GuiNpcLabel(11,"stats.candrown", guiLeft + 140, y + 5));
|
||||
@@ -134,6 +135,9 @@ public class GuiNpcStats extends GuiNPCInterface2 implements ITextfieldListener,
|
||||
else if (button.id == 18) {
|
||||
stats.potionImmune = ((GuiNpcButtonYesNo)guibutton).getBoolean();
|
||||
}
|
||||
else if(button.id == 21){
|
||||
stats.resistances.disableDamage = ((GuiNpcButton)guibutton).getValue() == 1;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void save() {
|
||||
|
||||
Reference in new issue
Block a user