diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 3f4ba60448..38bae783c2 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -59,6 +59,7 @@ public final class AimAssistHack extends Hack FilterPassiveWaterSetting.genericCombat(true), FilterBabiesSetting.genericCombat(true), FilterBatsSetting.genericCombat(true), + FilterSlimesSetting.genericCombat(true), FilterPetsSetting.genericCombat(true), FilterVillagersSetting.genericCombat(true), FilterZombieVillagersSetting.genericCombat(true), diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index f720ca85af..29752c90ae 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -85,6 +85,7 @@ public final class KillauraLegitHack extends Hack FilterPassiveWaterSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), FilterBatsSetting.genericCombat(false), + FilterSlimesSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), FilterVillagersSetting.genericCombat(false), FilterZombieVillagersSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index 7055a3a9b2..0d79a46a30 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -59,6 +59,7 @@ public final class ProtectHack extends Hack FilterPassiveWaterSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), FilterBatsSetting.genericCombat(false), + FilterSlimesSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), FilterVillagersSetting.genericCombat(false), FilterZombieVillagersSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/RadarHack.java b/src/main/java/net/wurstclient/hacks/RadarHack.java index 16e98010e7..e08270fb14 100644 --- a/src/main/java/net/wurstclient/hacks/RadarHack.java +++ b/src/main/java/net/wurstclient/hacks/RadarHack.java @@ -27,13 +27,7 @@ import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; import net.wurstclient.settings.filterlists.EntityFilterList; -import net.wurstclient.settings.filters.FilterBatsSetting; -import net.wurstclient.settings.filters.FilterHostileSetting; -import net.wurstclient.settings.filters.FilterInvisibleSetting; -import net.wurstclient.settings.filters.FilterPassiveSetting; -import net.wurstclient.settings.filters.FilterPassiveWaterSetting; -import net.wurstclient.settings.filters.FilterPlayersSetting; -import net.wurstclient.settings.filters.FilterSleepingSetting; +import net.wurstclient.settings.filters.*; import net.wurstclient.util.FakePlayerEntity; @SearchTags({"MiniMap", "mini map"}) @@ -54,6 +48,7 @@ public final class RadarHack extends Hack implements UpdateListener FilterPassiveSetting.genericVision(false), FilterPassiveWaterSetting.genericVision(false), FilterBatsSetting.genericVision(true), + FilterSlimesSetting.genericVision(false), FilterInvisibleSetting.genericVision(false)); public RadarHack() diff --git a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java index c639816c9c..0506b0576c 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java @@ -51,6 +51,9 @@ public static AnchorAuraFilterList create() + " \"ambient\" mobs when auto-placing anchors." + damageWarning, true)); + builder.add(new FilterSlimesSetting("Won't target slimes when" + + " auto-placing anchors." + damageWarning, true)); + builder.add(new FilterVillagersSetting("Won't target villagers and" + " wandering traders when auto-placing anchors." + damageWarning, true)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java index 776b7ec920..993c5dd853 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java @@ -51,6 +51,9 @@ public static CrystalAuraFilterList create() + " \"ambient\" mobs when auto-placing crystals." + damageWarning, true)); + builder.add(new FilterSlimesSetting("Won't target slimes when" + + " auto-placing crystals." + damageWarning, true)); + builder.add(new FilterVillagersSetting("Won't target villagers and" + " wandering traders when auto-placing crystals." + damageWarning, true)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java index 6de9163806..3491fe30cc 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java @@ -62,6 +62,7 @@ public static EntityFilterList genericCombat() FilterPassiveWaterSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), FilterBatsSetting.genericCombat(false), + FilterSlimesSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), FilterVillagersSetting.genericCombat(false), FilterZombieVillagersSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java index 7d0a33368e..2a834efd60 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -52,6 +52,8 @@ public static FollowFilterList create() builder.add(new FilterBatsSetting("Won't follow bats and any other" + " \"ambient\" mobs that might be added by mods.", true)); + builder.add(new FilterSlimesSetting("Won't follow slimes.", true)); + builder.add(new FilterPetsSetting( "Won't follow tamed wolves, tamed horses, etc.", true)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java index ae17f6de89..d04864da96 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -28,6 +28,7 @@ public static MobEspFilterList create() builder.add(FilterPassiveSetting.genericVision(false)); builder.add(FilterPassiveWaterSetting.genericVision(false)); builder.add(FilterBatsSetting.genericVision(false)); + builder.add(FilterSlimesSetting.genericVision(false)); builder.add(FilterPetsSetting.genericVision(false)); builder.add(FilterVillagersSetting.genericVision(false)); builder.add(FilterZombieVillagersSetting.genericVision(false)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java index fbc731c52f..ac0e0bbdd6 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -52,6 +52,8 @@ public static RemoteViewFilterList create() builder.add(new FilterBatsSetting("Won't view bats and any other" + " \"ambient\" mobs that might be added by mods.", true)); + builder.add(new FilterSlimesSetting("Won't view slimes.", true)); + builder.add(new FilterPetsSetting( "Won't view tamed wolves, tamed horses, etc.", true)); diff --git a/src/main/java/net/wurstclient/settings/filters/FilterSlimesSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterSlimesSetting.java new file mode 100644 index 0000000000..9783f59bc9 --- /dev/null +++ b/src/main/java/net/wurstclient/settings/filters/FilterSlimesSetting.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.settings.filters; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.mob.MagmaCubeEntity; +import net.minecraft.entity.mob.SlimeEntity; + +public final class FilterSlimesSetting extends EntityFilterCheckbox +{ + private static final String EXCEPTIONS_TEXT = + "\n\nThis filter does not affect magma cubes."; + + public FilterSlimesSetting(String description, boolean checked) + { + super("Filter slimes", description + EXCEPTIONS_TEXT, checked); + } + + @Override + public boolean test(Entity e) + { + return !(e instanceof SlimeEntity) || e instanceof MagmaCubeEntity; + } + + public static FilterSlimesSetting genericCombat(boolean checked) + { + return new FilterSlimesSetting("Won't attack slimes.", checked); + } + + public static FilterSlimesSetting genericVision(boolean checked) + { + return new FilterSlimesSetting("Won't show slimes.", checked); + } +}