mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Exclude creepers from the want it need it effect
This commit is contained in:
parent
b372620a04
commit
ccb636a674
2 changed files with 8 additions and 1 deletions
|
@ -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<Set<String>> wantItNeedItEntityExcludelist = value("server", "wantItNeedItEntityExcludelist", (Set<String>)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<Boolean> enableCheats = value("server", "enableCheats", false)
|
||||
.addComment("Allows use of the /race, /disguise, and /gravity commands");
|
||||
|
||||
|
|
|
@ -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<LivingEntity> 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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue