diff --git a/src/main/java/com/seodisparate/TurnBasedMinecraft/common/BattleManager.java b/src/main/java/com/seodisparate/TurnBasedMinecraft/common/BattleManager.java index d0a902a..5679e78 100644 --- a/src/main/java/com/seodisparate/TurnBasedMinecraft/common/BattleManager.java +++ b/src/main/java/com/seodisparate/TurnBasedMinecraft/common/BattleManager.java @@ -36,9 +36,9 @@ public class BattleManager */ public boolean checkAttack(final LivingAttackEvent event) { - // verify that both entities are EntityPlayer or has a corresponding EntityInfo - if(!(event.getEntity() instanceof EntityPlayer || TurnBasedMinecraftMod.config.getEntityInfoReference(event.getEntity().getClass().getName()) != null) - || !(event.getSource().getTrueSource() instanceof EntityPlayer || TurnBasedMinecraftMod.config.getEntityInfoReference(event.getSource().getTrueSource().getClass().getName()) != null)) + // verify that both entities are EntityPlayer and not in creative or has a corresponding EntityInfo + if(!((event.getEntity() instanceof EntityPlayer && !((EntityPlayer)event.getEntity()).isCreative()) || TurnBasedMinecraftMod.config.getEntityInfoReference(event.getEntity().getClass().getName()) != null) + || !((event.getSource().getTrueSource() instanceof EntityPlayer && !((EntityPlayer)event.getSource().getTrueSource()).isCreative()) || TurnBasedMinecraftMod.config.getEntityInfoReference(event.getSource().getTrueSource().getClass().getName()) != null)) { return false; } diff --git a/src/main/java/com/seodisparate/TurnBasedMinecraft/common/Config.java b/src/main/java/com/seodisparate/TurnBasedMinecraft/common/Config.java index 00961c7..a3d146f 100644 --- a/src/main/java/com/seodisparate/TurnBasedMinecraft/common/Config.java +++ b/src/main/java/com/seodisparate/TurnBasedMinecraft/common/Config.java @@ -281,24 +281,6 @@ public class Config { eInfo.category = xmlReader.getElementText().toLowerCase(); } - else if(xmlReader.getLocalName().equals("Conflicts")) - { - do - { - xmlReader.next(); - if(xmlReader.isStartElement()) - { - try - { - Class conflictingType = Class.forName(xmlReader.getLocalName()); - eInfo.conflictingTypes.add(conflictingType); - } catch(ClassNotFoundException e) - { - logger.warn("Invalid conflicting type for entity " + eInfo.classType.getName()); - } - } - } while(!(xmlReader.isEndElement() && xmlReader.getLocalName().equals("Conflicts"))); - } else if(xmlReader.getLocalName().equals("IgnoreBattle")) { if(xmlReader.getElementText().toLowerCase().equals("true")) @@ -412,13 +394,6 @@ public class Config EntityInfo matching = entityInfoMap.get(entity.getClass().getName()); if(matching != null && matching.classType.isInstance(entity)) { - for(Class c : matching.conflictingTypes) - { - if(c.isInstance(entity)) - { - return entityInfoMap.get(c.getName()); - } - } return matching; } return null; diff --git a/src/main/java/com/seodisparate/TurnBasedMinecraft/common/EntityInfo.java b/src/main/java/com/seodisparate/TurnBasedMinecraft/common/EntityInfo.java index 1124068..62d9086 100644 --- a/src/main/java/com/seodisparate/TurnBasedMinecraft/common/EntityInfo.java +++ b/src/main/java/com/seodisparate/TurnBasedMinecraft/common/EntityInfo.java @@ -10,7 +10,6 @@ import net.minecraft.potion.PotionEffect; public class EntityInfo { public Class classType; - public List conflictingTypes; public boolean ignoreBattle; public int attackPower; public int attackProbability; @@ -310,7 +309,6 @@ public class EntityInfo public EntityInfo() { classType = null; - conflictingTypes = new ArrayList(); ignoreBattle = false; attackPower = 0; attackProbability = 70; @@ -331,11 +329,6 @@ public class EntityInfo { EntityInfo newEntityInfo = new EntityInfo(); newEntityInfo.classType = classType; - newEntityInfo.conflictingTypes = new ArrayList(); - for(Class c : conflictingTypes) - { - newEntityInfo.conflictingTypes.add(c); - } newEntityInfo.ignoreBattle = ignoreBattle; newEntityInfo.attackPower = attackPower; newEntityInfo.attackProbability = attackProbability; diff --git a/src/main/resources/assets/TurnBasedMinecraft/TBM_Config.xml b/src/main/resources/assets/TurnBasedMinecraft/TBM_Config.xml index b5f3db3..5194493 100644 --- a/src/main/resources/assets/TurnBasedMinecraft/TBM_Config.xml +++ b/src/main/resources/assets/TurnBasedMinecraft/TBM_Config.xml @@ -31,7 +31,6 @@ - 5 @@ -263,9 +262,6 @@ 2 25 - - - monster 70 @@ -333,10 +329,6 @@ 3 - - - - 5 monster 25 @@ -382,9 +374,6 @@ 0 1 - - - passive 20