-
-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace FilterMonstersSetting with FilterHostileSetting
- Loading branch information
1 parent
4e292b4
commit 59aea94
Showing
12 changed files
with
63 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/net/wurstclient/settings/filters/FilterHostileSetting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
37 changes: 0 additions & 37 deletions
37
src/main/java/net/wurstclient/settings/filters/FilterMonstersSetting.java
This file was deleted.
Oops, something went wrong.