diff --git a/src/main/java/com/minelittlepony/unicopia/Config.java b/src/main/java/com/minelittlepony/unicopia/Config.java index 72c590fb..e0fec708 100644 --- a/src/main/java/com/minelittlepony/unicopia/Config.java +++ b/src/main/java/com/minelittlepony/unicopia/Config.java @@ -13,6 +13,9 @@ public class Config extends com.minelittlepony.common.util.settings.Config { .addComment("whilst any ones left off are not permitted") .addComment("An empty list disables whitelisting entirely."); + public final Setting> wantItNeedItEntityExcludelist = value("server", "wantItNeedItEntityExcludelist", (Set)new HashSet<>(Set.of("minecraft:creeper"))) + .addComment("A list of entity types that are immune to the want it need it spell's effects"); + public final Setting enableCheats = value("server", "enableCheats", false) .addComment("Allows use of the /race, /disguise, and /gravity commands"); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Creature.java b/src/main/java/com/minelittlepony/unicopia/entity/Creature.java index d9a92ce1..c72d7f66 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/Creature.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/Creature.java @@ -8,6 +8,7 @@ import org.jetbrains.annotations.Nullable; import com.minelittlepony.unicopia.Affinity; import com.minelittlepony.unicopia.Race; +import com.minelittlepony.unicopia.Unicopia; import com.minelittlepony.unicopia.WeaklyOwned; import com.minelittlepony.unicopia.ability.magic.*; import com.minelittlepony.unicopia.ability.magic.spell.Spell; @@ -17,6 +18,7 @@ import com.minelittlepony.unicopia.entity.ai.DynamicTargetGoal; import com.minelittlepony.unicopia.entity.ai.EatMuffinGoal; import com.minelittlepony.unicopia.entity.ai.WantItTakeItGoal; +import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.SpawnGroup; import net.minecraft.entity.ai.goal.*; @@ -115,7 +117,9 @@ public class Creature extends Living implements WeaklyOwned.Mutabl DynamicTargetGoal targetter = new DynamicTargetGoal((MobEntity)entity); targets.add(1, targetter); - goals.add(1, new WantItTakeItGoal((MobEntity)entity, targetter)); + if (!Unicopia.getConfig().wantItNeedItEntityExcludelist.get().contains(EntityType.getId(entity.getType()).toString())) { + goals.add(1, new WantItTakeItGoal((MobEntity)entity, targetter)); + } if (entity.getType().getSpawnGroup() == SpawnGroup.MONSTER) { goals.add(3, new BreakHeartGoal((MobEntity)entity, targetter)); }