mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 23:04:08 +00:00
Prevent Passive Factions from taking Damage
This commit is contained in:
1 parent
2387ece1ff
commit
d76f5d40a4
3 files changed
+8
-1
No files matched your search
@@ -85,11 +85,13 @@ public class GuiNPCManageFactions extends GuiNPCInterface2 implements IScrollDat
|
||||
|
||||
addLabel(new GuiNpcLabel(3, "faction.hidden", guiLeft + 8, y + 5));
|
||||
this.addButton(new GuiNpcButton(3, guiLeft + 100, y, 45, 20, new String[]{"gui.no", "gui.yes"}, faction.hideFaction ? 1 : 0));
|
||||
getButton(3).setHoverText("faction.hidden.hover");
|
||||
|
||||
y += 23;
|
||||
|
||||
addLabel(new GuiNpcLabel(4, "faction.attacked", guiLeft + 8, y + 5));
|
||||
this.addButton(new GuiNpcButton(4, guiLeft + 100, y, 45, 20, new String[]{"gui.no", "gui.yes"}, faction.getsAttacked ? 1 : 0));
|
||||
getButton(4).setHoverText("faction.attacked.hover");
|
||||
|
||||
y += 23;
|
||||
|
||||
|
||||
@@ -678,6 +678,9 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
|
||||
if (entity instanceof EntityLivingBase)
|
||||
attackingEntity = (EntityLivingBase) entity;
|
||||
|
||||
if (faction.isPassive)
|
||||
return false;
|
||||
|
||||
if (attackingEntity != null && attackingEntity == getOwner())
|
||||
return false;
|
||||
else if (attackingEntity instanceof EntityNPCInterface) {
|
||||
|
||||
Reference in new issue
Block a user