Skip to content

Commit

Permalink
Add FilterSlimesSetting
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Oct 18, 2023
1 parent bff41b4 commit dd847ee
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/main/java/net/wurstclient/hacks/AimAssistHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/wurstclient/hacks/KillauraLegitHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/wurstclient/hacks/ProtectHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
9 changes: 2 additions & 7 deletions src/main/java/net/wurstclient/hacks/RadarHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit dd847ee

Please sign in to comment.