diff --git a/build.gradle b/build.gradle index 23b5f1fa8..b017dec64 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { id 'idea' } -version = "1.10-beta6" +version = "1.10-beta8" group= "kamkeel.customnpc-plus" archivesBaseName = "CustomNPC-Plus" diff --git a/src/main/java/noppes/npcs/client/gui/SubGuiNpcResistanceProperties.java b/src/main/java/noppes/npcs/client/gui/SubGuiNpcResistanceProperties.java index 97341b4e6..bbe0e136b 100644 --- a/src/main/java/noppes/npcs/client/gui/SubGuiNpcResistanceProperties.java +++ b/src/main/java/noppes/npcs/client/gui/SubGuiNpcResistanceProperties.java @@ -19,23 +19,32 @@ public class SubGuiNpcResistanceProperties extends SubGuiInterface implements IS public void initGui() { super.initGui(); - addLabel(new GuiNpcLabel(0,"enchantment.knockback", guiLeft + 4, guiTop + 15)); - addSlider(new GuiNpcSlider(this, 0, guiLeft + 94, guiTop + 10, (int)(resistances.knockback * 100 - 100) + "%", resistances.knockback / 2)); + int y = guiTop + 10; + addLabel(new GuiNpcLabel(0,"enchantment.knockback", guiLeft + 4, y + 5)); + addSlider(new GuiNpcSlider(this, 0, guiLeft + 94, y, (int)(resistances.knockback * 100 - 100) + "%", resistances.knockback / 2)); - addLabel(new GuiNpcLabel(1,"item.arrow.name", guiLeft + 4, guiTop + 37)); - addSlider(new GuiNpcSlider(this, 1, guiLeft + 94, guiTop + 32, (int)(resistances.arrow * 100 - 100) + "%", resistances.arrow / 2)); + y += 22; + + addLabel(new GuiNpcLabel(1,"item.arrow.name", guiLeft + 4, y + 5)); + addSlider(new GuiNpcSlider(this, 1, guiLeft + 94, y, (int)(resistances.arrow * 100 - 100) + "%", resistances.arrow / 2)); getSlider(1).enabled = !resistances.disableDamage; - addLabel(new GuiNpcLabel(2,"stats.melee", guiLeft + 4, guiTop + 59)); - addSlider(new GuiNpcSlider(this, 2, guiLeft + 94, guiTop + 54, (int)(resistances.playermelee * 100 - 100) + "%", resistances.playermelee / 2)); + y += 22; + + addLabel(new GuiNpcLabel(2,"stats.melee", guiLeft + 4, y + 5)); + addSlider(new GuiNpcSlider(this, 2, guiLeft + 94, y, (int)(resistances.playermelee * 100 - 100) + "%", resistances.playermelee / 2)); getSlider(2).enabled = !resistances.disableDamage; - 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)); + y += 22; + + addLabel(new GuiNpcLabel(3,"stats.explosion", guiLeft + 4, y + 5)); + addSlider(new GuiNpcSlider(this, 3, guiLeft + 94, y, (int)(resistances.explosion * 100 - 100) + "%", resistances.explosion / 2)); getSlider(3).enabled = !resistances.disableDamage; - addLabel(new GuiNpcLabel(21,"stats.disabledamage", guiLeft + 4, guiTop + 104)); - this.addButton(new GuiNpcButton(21, guiLeft + 94, guiTop + 99, 56, 20, new String[]{"gui.no","gui.yes"}, this.resistances.disableDamage? 1:0)); + y += 22; + + addLabel(new GuiNpcLabel(21,"stats.disabledamage", guiLeft + 4, y + 5)); + this.addButton(new GuiNpcButton(21, guiLeft + 94, y, 56, 20, new String[]{"gui.no","gui.yes"}, this.resistances.disableDamage? 1:0)); addButton(new GuiNpcButton(66, guiLeft + 190, guiTop + 190, 60, 20, "gui.done")); } diff --git a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java index b028da4c8..4ac102e2f 100644 --- a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java +++ b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java @@ -565,11 +565,13 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti } else if (attackingEntity instanceof EntityPlayer && faction.isFriendlyToPlayer((EntityPlayer) attackingEntity)) return false; - // Magic / Attribute Damage - if(attackingEntity instanceof EntityPlayer) - i = AttributeAttackUtil.calculateDamagePlayerToNPC((EntityPlayer) attackingEntity, this, i); + // Attribute + Resistances + if(!DBCAddon.IsAvailable()){ + if(attackingEntity instanceof EntityPlayer) + i = AttributeAttackUtil.calculateDamagePlayerToNPC((EntityPlayer) attackingEntity, this, i); - i = stats.resistances.applyResistance(damagesource, i); + i = stats.resistances.applyResistance(damagesource, i); + } NpcEvent.DamagedEvent event = new NpcEvent.DamagedEvent(this.wrappedNPC, attackingEntity, i, damagesource); if (EventHooks.onNPCDamaged(this, event) || isKilled())