Skip to content

Commit

Permalink
Replace FilterMonstersSetting with FilterHostileSetting
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Oct 11, 2023
1 parent 4e292b4 commit 59aea94
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 56 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/wurstclient/hacks/AimAssistHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public final class AimAssistHack extends Hack
new EntityFilterList(FilterPlayersSetting.genericCombat(false),
FilterSleepingSetting.genericCombat(false),
FilterFlyingSetting.genericCombat(0),
FilterMonstersSetting.genericCombat(false),
FilterHostileSetting.genericCombat(false),
FilterZombiePiglinsSetting
.genericCombat(AttackDetectingEntityFilter.Mode.OFF),
FilterEndermenSetting
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/wurstclient/hacks/KillauraLegitHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public final class KillauraLegitHack extends Hack
new EntityFilterList(FilterPlayersSetting.genericCombat(false),
FilterSleepingSetting.genericCombat(true),
FilterFlyingSetting.genericCombat(0.5),
FilterMonstersSetting.genericCombat(false),
FilterHostileSetting.genericCombat(false),
FilterZombiePiglinsSetting
.genericCombat(AttackDetectingEntityFilter.Mode.OFF),
FilterEndermenSetting
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/wurstclient/hacks/ProtectHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public final class ProtectHack extends Hack
new EntityFilterList(FilterPlayersSetting.genericCombat(false),
FilterSleepingSetting.genericCombat(false),
FilterFlyingSetting.genericCombat(0),
FilterMonstersSetting.genericCombat(false),
FilterHostileSetting.genericCombat(false),
FilterZombiePiglinsSetting
.genericCombat(FilterZombiePiglinsSetting.Mode.OFF),
FilterEndermenSetting
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/wurstclient/hacks/RadarHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
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.FilterMonstersSetting;
import net.wurstclient.settings.filters.FilterPassiveSetting;
import net.wurstclient.settings.filters.FilterPlayersSetting;
import net.wurstclient.settings.filters.FilterSleepingSetting;
Expand All @@ -49,7 +49,7 @@ public final class RadarHack extends Hack implements UpdateListener
private final EntityFilterList entityFilters =
new EntityFilterList(FilterPlayersSetting.genericVision(false),
FilterSleepingSetting.genericVision(false),
FilterMonstersSetting.genericVision(false),
FilterHostileSetting.genericVision(false),
FilterPassiveSetting.genericVision(false),
FilterBatsSetting.genericVision(true),
FilterInvisibleSetting.genericVision(false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ public static AnchorAuraFilterList create()
+ damageWarning,
false));

builder.add(new FilterMonstersSetting(
"Won't target zombies, creepers, etc. when auto-placing anchors."
+ damageWarning,
true));
builder.add(new FilterHostileSetting("Won't target hostile mobs like"
+ " zombies and creepers when auto-placing anchors."
+ damageWarning, true));

builder.add(new FilterPassiveSetting("Won't target animals like pigs"
+ " and cows, ambient mobs like bats, and water mobs like fish,"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ public static CrystalAuraFilterList create()
+ damageWarning,
false));

builder.add(new FilterMonstersSetting(
"Won't target zombies, creepers, etc. when auto-placing crystals."
+ damageWarning,
true));
builder.add(new FilterHostileSetting("Won't target hostile mobs like"
+ " zombies and creepers when auto-placing crystals."
+ damageWarning, true));

builder.add(new FilterPassiveSetting("Won't target animals like pigs"
+ " and cows, ambient mobs like bats, and water mobs like fish,"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static EntityFilterList genericCombat()
return new EntityFilterList(FilterPlayersSetting.genericCombat(false),
FilterSleepingSetting.genericCombat(false),
FilterFlyingSetting.genericCombat(0),
FilterMonstersSetting.genericCombat(false),
FilterHostileSetting.genericCombat(false),
FilterZombiePiglinsSetting
.genericCombat(AttackDetectingEntityFilter.Mode.OFF),
FilterEndermenSetting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public static FollowFilterList create()
"Won't follow players that are at least the given distance above ground.",
0));

builder.add(new FilterMonstersSetting(
"Won't follow zombies, creepers, etc.", true));
builder.add(new FilterHostileSetting(
"Won't follow hostile mobs like zombies and creepers.", true));

builder.add(FilterZombiePiglinsSetting
.onOffOnly("Won't follow zombified piglins.", true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private MobEspFilterList(List<EntityFilter> filters)
public static MobEspFilterList create()
{
ArrayList<EntityFilter> builder = new ArrayList<>();
builder.add(FilterMonstersSetting.genericVision(false));
builder.add(FilterHostileSetting.genericVision(false));
builder.add(FilterZombiePiglinsSetting
.genericVision(AttackDetectingEntityFilter.Mode.OFF));
builder.add(FilterEndermenSetting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public static RemoteViewFilterList create()
"Won't view players that are at least the given distance above ground.",
0));

builder.add(new FilterMonstersSetting(
"Won't view zombies, creepers, etc.", true));
builder.add(new FilterHostileSetting(
"Won't view hostile mobs like zombies and creepers.", true));

builder.add(FilterZombiePiglinsSetting
.onOffOnly("Won't view zombified piglins.", true));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* 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.Angerable;
import net.minecraft.entity.mob.Monster;
import net.minecraft.entity.mob.PiglinEntity;

public final class FilterHostileSetting extends EntityFilterCheckbox
{
private static final String EXCEPTIONS_TEXT = "\n\nThis filter does not"
+ " affect endermen, non-brute piglins, and zombified piglins.";

public FilterHostileSetting(String description, boolean checked)
{
super("Filter hostile mobs", description + EXCEPTIONS_TEXT, checked);
}

@Override
public boolean test(Entity e)
{
// never filter out neutral mobs (including piglins)
if(e instanceof Angerable || e instanceof PiglinEntity)
return false;

return !(e instanceof Monster);
}

public static FilterHostileSetting genericCombat(boolean checked)
{
return new FilterHostileSetting(
"Won't attack hostile mobs like zombies and creepers.", checked);
}

public static FilterHostileSetting genericVision(boolean checked)
{
return new FilterHostileSetting(
"Won't show hostile mobs like zombies and creepers.", checked);
}
}

This file was deleted.

0 comments on commit 59aea94

Please sign in to comment.