From 71b81e9867abea878831acce049b171b526f849d Mon Sep 17 00:00:00 2001 From: Kendell R Date: Sat, 25 Dec 2021 09:52:31 -0800 Subject: [PATCH 01/61] Add stale issue checker --- .github/actions/stale.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/actions/stale.yaml diff --git a/.github/actions/stale.yaml b/.github/actions/stale.yaml new file mode 100644 index 0000000000..1c87b981de --- /dev/null +++ b/.github/actions/stale.yaml @@ -0,0 +1,20 @@ +name: "Close stale issues / pull requests" +on: + schedule: + - cron: "30 1 * * *" + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v4 + with: + stale-issue-message: | + This issue has been open for a while. It will be closed soon if nobody comments on it. + Issues should be closed if: + - They are duplicates of other issues + - There is not enough demand + - They are no longer relevant + - There are not enough details + days-before-stale: 30 + days-before-close: 30 From 11c95355d4156733e7b39a17cef19f38f0f98dac Mon Sep 17 00:00:00 2001 From: Kendell R Date: Sun, 26 Dec 2021 07:58:05 -0800 Subject: [PATCH 02/61] Change time until stale to 2 months Requested by @buiawpkgew --- .github/actions/stale.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/stale.yaml b/.github/actions/stale.yaml index 1c87b981de..1bd15cadfa 100644 --- a/.github/actions/stale.yaml +++ b/.github/actions/stale.yaml @@ -16,5 +16,5 @@ jobs: - There is not enough demand - They are no longer relevant - There are not enough details - days-before-stale: 30 + days-before-stale: 60 days-before-close: 30 From 99deab4502b8661735dc8efd50e0f027deb1ab3b Mon Sep 17 00:00:00 2001 From: ThisTestUser Date: Fri, 17 Mar 2023 18:18:24 -0400 Subject: [PATCH 03/61] Fix dolphin and fish hack --- src/main/java/net/wurstclient/hacks/DolphinHack.java | 2 +- src/main/java/net/wurstclient/hacks/FishHack.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/DolphinHack.java b/src/main/java/net/wurstclient/hacks/DolphinHack.java index 66c0f617a0..d1dcf45dbb 100644 --- a/src/main/java/net/wurstclient/hacks/DolphinHack.java +++ b/src/main/java/net/wurstclient/hacks/DolphinHack.java @@ -40,7 +40,7 @@ public void onDisable() public void onUpdate() { ClientPlayerEntity player = MC.player; - if(!player.isWet() || player.isSneaking()) + if(!player.isTouchingWater() || player.isSneaking()) return; Vec3d velocity = player.getVelocity(); diff --git a/src/main/java/net/wurstclient/hacks/FishHack.java b/src/main/java/net/wurstclient/hacks/FishHack.java index ffc3ab423b..07e8b0d6f5 100644 --- a/src/main/java/net/wurstclient/hacks/FishHack.java +++ b/src/main/java/net/wurstclient/hacks/FishHack.java @@ -40,7 +40,7 @@ public void onDisable() public void onUpdate() { ClientPlayerEntity player = MC.player; - if(!player.isWet() || player.isSneaking()) + if(!player.isTouchingWater() || player.isSneaking()) return; Vec3d velocity = player.getVelocity(); From 1e23b51e95a1343f1f013b8169334ce6c9daf454 Mon Sep 17 00:00:00 2001 From: ThisTestUser Date: Sun, 28 May 2023 11:43:31 -0400 Subject: [PATCH 04/61] Prevent darkness from disabling night vision --- .../wurstclient/mixin/BackgroundRendererMixin.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java b/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java index 396b69e448..00e413441d 100644 --- a/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java @@ -10,11 +10,14 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import net.minecraft.client.render.BackgroundRenderer; import net.minecraft.client.render.BackgroundRenderer.StatusEffectFogModifier; import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.effect.StatusEffect; import net.wurstclient.WurstClient; @Mixin(BackgroundRenderer.class) @@ -30,4 +33,15 @@ private static void onGetFogModifier(Entity entity, float tickDelta, if(WurstClient.INSTANCE.getHax().antiBlindHack.isEnabled()) ci.setReturnValue(null); } + + @Redirect(at = @At(value = "INVOKE", + target = "Lnet/minecraft/entity/LivingEntity;hasStatusEffect(Lnet/minecraft/entity/effect/StatusEffect;)Z", + ordinal = 1), method = "render(Lnet/minecraft/client/render/Camera;FLnet/minecraft/client/world/ClientWorld;IF)V") + private static boolean onCheckDarkness(LivingEntity living, StatusEffect effect) + { + if(WurstClient.INSTANCE.getHax().antiBlindHack.isEnabled()) + return false; + + return living.hasStatusEffect(effect); + } } From 0c4720e44810e1bc7ba1c6304622eddc2a104cf9 Mon Sep 17 00:00:00 2001 From: ThisTestUser Date: Sun, 28 May 2023 21:46:24 -0400 Subject: [PATCH 05/61] Fix tracers shaking in vehicles --- src/main/java/net/wurstclient/hacks/ChestEspHack.java | 2 +- src/main/java/net/wurstclient/hacks/FreecamHack.java | 2 +- src/main/java/net/wurstclient/hacks/ItemEspHack.java | 2 +- src/main/java/net/wurstclient/hacks/MobEspHack.java | 6 +++--- src/main/java/net/wurstclient/hacks/PlayerEspHack.java | 6 +++--- .../wurstclient/hacks/chestesp/ChestEspRenderer.java | 4 ++-- src/main/java/net/wurstclient/util/RotationUtils.java | 10 +++++----- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/ChestEspHack.java b/src/main/java/net/wurstclient/hacks/ChestEspHack.java index d05158d635..546366e658 100644 --- a/src/main/java/net/wurstclient/hacks/ChestEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ChestEspHack.java @@ -213,7 +213,7 @@ public void onRender(MatrixStack matrixStack, float partialTicks) entityGroups.stream().filter(ChestEspGroup::isEnabled) .forEach(g -> g.updateBoxes(partialTicks)); - ChestEspRenderer espRenderer = new ChestEspRenderer(matrixStack); + ChestEspRenderer espRenderer = new ChestEspRenderer(matrixStack, partialTicks); if(style.getSelected().hasBoxes()) { diff --git a/src/main/java/net/wurstclient/hacks/FreecamHack.java b/src/main/java/net/wurstclient/hacks/FreecamHack.java index f6685ee8a8..3319015531 100644 --- a/src/main/java/net/wurstclient/hacks/FreecamHack.java +++ b/src/main/java/net/wurstclient/hacks/FreecamHack.java @@ -207,7 +207,7 @@ public void onRender(MatrixStack matrixStack, float partialTicks) matrixStack.pop(); // line - Vec3d start = RotationUtils.getClientLookVec() + Vec3d start = RotationUtils.getClientLookVec(partialTicks) .add(RenderUtils.getCameraPos()).subtract(regionX, 0, regionZ); Vec3d end = fakePlayer.getBoundingBox().getCenter().subtract(regionX, 0, regionZ); diff --git a/src/main/java/net/wurstclient/hacks/ItemEspHack.java b/src/main/java/net/wurstclient/hacks/ItemEspHack.java index f464fed182..20f7b17af2 100644 --- a/src/main/java/net/wurstclient/hacks/ItemEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ItemEspHack.java @@ -171,7 +171,7 @@ private void renderTracers(MatrixStack matrixStack, double partialTicks, BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); - Vec3d start = RotationUtils.getClientLookVec() + Vec3d start = RotationUtils.getClientLookVec(partialTicks) .add(RenderUtils.getCameraPos()).subtract(regionX, 0, regionZ); bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, diff --git a/src/main/java/net/wurstclient/hacks/MobEspHack.java b/src/main/java/net/wurstclient/hacks/MobEspHack.java index 35984344a0..ed3d55512a 100644 --- a/src/main/java/net/wurstclient/hacks/MobEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobEspHack.java @@ -144,7 +144,7 @@ public void onRender(MatrixStack matrixStack, float partialTicks) GL11.glDisable(GL11.GL_BLEND); } - private void renderBoxes(MatrixStack matrixStack, double partialTicks, + private void renderBoxes(MatrixStack matrixStack, float partialTicks, int regionX, int regionZ) { float extraSize = boxSize.getSelected().extraSize; @@ -176,7 +176,7 @@ private void renderBoxes(MatrixStack matrixStack, double partialTicks, } } - private void renderTracers(MatrixStack matrixStack, double partialTicks, + private void renderTracers(MatrixStack matrixStack, float partialTicks, int regionX, int regionZ) { RenderSystem.setShader(GameRenderer::getPositionColorProgram); @@ -189,7 +189,7 @@ private void renderTracers(MatrixStack matrixStack, double partialTicks, bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR); - Vec3d start = RotationUtils.getClientLookVec() + Vec3d start = RotationUtils.getClientLookVec(partialTicks) .add(RenderUtils.getCameraPos()).subtract(regionX, 0, regionZ); for(MobEntity e : mobs) diff --git a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java index a956c552f2..ed58e43491 100644 --- a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java +++ b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java @@ -143,7 +143,7 @@ public void onRender(MatrixStack matrixStack, float partialTicks) GL11.glDisable(GL11.GL_BLEND); } - private void renderBoxes(MatrixStack matrixStack, double partialTicks, + private void renderBoxes(MatrixStack matrixStack, float partialTicks, int regionX, int regionZ) { float extraSize = boxSize.getSelected().extraSize; @@ -176,7 +176,7 @@ private void renderBoxes(MatrixStack matrixStack, double partialTicks, } } - private void renderTracers(MatrixStack matrixStack, double partialTicks, + private void renderTracers(MatrixStack matrixStack, float partialTicks, int regionX, int regionZ) { RenderSystem.setShader(GameRenderer::getPositionColorProgram); @@ -189,7 +189,7 @@ private void renderTracers(MatrixStack matrixStack, double partialTicks, bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR); - Vec3d start = RotationUtils.getClientLookVec() + Vec3d start = RotationUtils.getClientLookVec(partialTicks) .add(RenderUtils.getCameraPos()).subtract(regionX, 0, regionZ); for(PlayerEntity e : players) diff --git a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java index 51a875f1ad..2f50f19b4c 100644 --- a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java +++ b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java @@ -37,7 +37,7 @@ public final class ChestEspRenderer private final int regionZ; private final Vec3d start; - public ChestEspRenderer(MatrixStack matrixStack) + public ChestEspRenderer(MatrixStack matrixStack, float partialTicks) { this.matrixStack = matrixStack; @@ -45,7 +45,7 @@ public ChestEspRenderer(MatrixStack matrixStack) regionX = (camPos.getX() >> 9) * 512; regionZ = (camPos.getZ() >> 9) * 512; - start = RotationUtils.getClientLookVec().add(RenderUtils.getCameraPos()) + start = RotationUtils.getClientLookVec(partialTicks).add(RenderUtils.getCameraPos()) .subtract(regionX, 0, regionZ); } diff --git a/src/main/java/net/wurstclient/util/RotationUtils.java b/src/main/java/net/wurstclient/util/RotationUtils.java index 3456bba4c0..3a11a8410b 100644 --- a/src/main/java/net/wurstclient/util/RotationUtils.java +++ b/src/main/java/net/wurstclient/util/RotationUtils.java @@ -29,16 +29,16 @@ public static Vec3d getEyesPos() player.getZ()); } - public static Vec3d getClientLookVec() + public static Vec3d getClientLookVec(float partialTicks) { ClientPlayerEntity player = WurstClient.MC.player; float f = 0.017453292F; float pi = (float)Math.PI; - float f1 = MathHelper.cos(-player.getYaw() * f - pi); - float f2 = MathHelper.sin(-player.getYaw() * f - pi); - float f3 = -MathHelper.cos(-player.getPitch() * f); - float f4 = MathHelper.sin(-player.getPitch() * f); + float f1 = MathHelper.cos(-player.getYaw(partialTicks) * f - pi); + float f2 = MathHelper.sin(-player.getYaw(partialTicks) * f - pi); + float f3 = -MathHelper.cos(-player.getPitch(partialTicks) * f); + float f4 = MathHelper.sin(-player.getPitch(partialTicks) * f); return new Vec3d(f2 * f3, f4, f1 * f3); } From d5b3de771dc2d9708abfe3f423e41eee6ce1b17a Mon Sep 17 00:00:00 2001 From: ThisTestUser Date: Sun, 28 May 2023 21:52:56 -0400 Subject: [PATCH 06/61] Fix ItemEsp --- src/main/java/net/wurstclient/hacks/ItemEspHack.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/ItemEspHack.java b/src/main/java/net/wurstclient/hacks/ItemEspHack.java index 20f7b17af2..d5d0b7b484 100644 --- a/src/main/java/net/wurstclient/hacks/ItemEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ItemEspHack.java @@ -123,7 +123,7 @@ public void onRender(MatrixStack matrixStack, float partialTicks) GL11.glDisable(GL11.GL_BLEND); } - private void renderBoxes(MatrixStack matrixStack, double partialTicks, + private void renderBoxes(MatrixStack matrixStack, float partialTicks, int regionX, int regionZ) { float extraSize = boxSize.getSelected().extraSize; @@ -158,7 +158,7 @@ private void renderBoxes(MatrixStack matrixStack, double partialTicks, } } - private void renderTracers(MatrixStack matrixStack, double partialTicks, + private void renderTracers(MatrixStack matrixStack, float partialTicks, int regionX, int regionZ) { GL11.glEnable(GL11.GL_BLEND); From 730f39c8921760670be8673be2b49493036dd51c Mon Sep 17 00:00:00 2001 From: PeriodicSeizures <47781580+PeriodicSeizures@users.noreply.github.com> Date: Tue, 15 Aug 2023 11:41:22 -0400 Subject: [PATCH 07/61] Fixed sleeping filter --- .../wurstclient/settings/filters/FilterSleepingSetting.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java index 470f9cba19..af66731a6e 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java @@ -8,6 +8,7 @@ package net.wurstclient.settings.filters; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityPose; import net.minecraft.entity.player.PlayerEntity; public final class FilterSleepingSetting extends EntityFilterCheckbox @@ -22,8 +23,8 @@ public boolean test(Entity e) { if(!(e instanceof PlayerEntity)) return true; - - return !((PlayerEntity)e).isSleeping(); + + return e.getPose() != EntityPose.SLEEPING && !((PlayerEntity)e).isSleeping(); } public static FilterSleepingSetting genericCombat(boolean checked) From f3c21ae151c9820d28749852e35f815673708bf2 Mon Sep 17 00:00:00 2001 From: sabaadmin <94890302+sabaadmin@users.noreply.github.com> Date: Wed, 23 Aug 2023 13:25:55 +0900 Subject: [PATCH 08/61] Translated into Japanese --- src/main/resources/assets/wurst/lang/ja_jp.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/assets/wurst/lang/ja_jp.json b/src/main/resources/assets/wurst/lang/ja_jp.json index 643433c90e..b5a3f8d9f8 100644 --- a/src/main/resources/assets/wurst/lang/ja_jp.json +++ b/src/main/resources/assets/wurst/lang/ja_jp.json @@ -1,9 +1,11 @@ { + "description.wurst.hack.aimassist": "近くの存在を狙うのに役立ちます。", "description.wurst.hack.airplace": "空中にブロックを設置できるようになる。", "description.wurst.hack.anchoraura": "リスポーンアンカーを自動で設置(任意)、チャージ、爆発させ、付近にいるエンティティを倒す。", "description.wurst.hack.antiafk": "離席を検知されないよう、辺りをランダムに歩き回る。\n最低3×3の広さの自由なスペースが必要。", "description.wurst.hack.antiblind": "盲目や暗闇の効果を防ぎます。\nOptiFineとの互換性はありません。", "description.wurst.hack.anticactus": "サボテンのダメージを無効化する。", + "description.wurst.hack.antientitypush": "プレイヤーやモブに押されるのを防ぎます。", "description.wurst.hack.antihunger": "歩行中に空腹度ゲージの減少を抑える。", "description.wurst.hack.antiknockback": "プレイヤーやモブからのノックバックを無効化する。", "description.wurst.hack.antispam": "同じ内容のメッセージにカウントを表示し、チャットスパムを防ぐ。", @@ -14,8 +16,10 @@ "description.wurst.setting.arrowdmg.trident_yeet_mode": "有効時、トライデントがより遠くまで飛ばせるようになる。ダメージ量や激流エンチャントには影響しない模様。\n\n§c§l注意: §rこのオプションを有効化した場合、トライデントをロストしやすくなる。", "description.wurst.hack.autoarmor": "防具を自動で管理する。", "description.wurst.hack.autobuild": "自動で建築を行う。\nブロックを一つ設置することで建築が開始される。", + "description.wurst.hack.autocomplete": "大規模な言語モデルを使用してチャット メッセージをオートコンプリートします。 API アクセスのある OpenAI アカウント、または oababooga Web UI を使用してローカルにインストールされた言語モデルのいずれかが必要です。", "description.wurst.hack.autodrop": "必要のないアイテムを自動で捨てる。", "description.wurst.hack.autoleave": "残り体力が少なくなるとに自動的にサーバーから切断する。", + "description.wurst.hack.autolibrarian": "村人を自動的に訓練して、特定の魔法の本を販売する司書にします。 このハックを使用すると、すぐに取引ホール全体をセットアップできます。", "description.wurst.hack.autoeat": "必要であれば自動で食料を食べる。", "description.wurst.setting.autoeat.target_hunger": "食料から得られる満腹度を無駄にしないようにしつつ、満腹度をこのレベル以上に維持しようとする。", "description.wurst.setting.autoeat.min_hunger": "食料から得られる満腹度を無駄にしても、常に満腹度をこのレベル以上に維持しようとする。\n6.5 - 通常版のマインクラフトの食料では、満腹度が無駄になることはない。\n10.0 - 満腹度の無駄を無視して常に満腹度を満タンにする。", @@ -132,6 +136,7 @@ "description.wurst.hack.rainbowui": "§cす§aべ§9て§cを§aカ§9ラ§cフ§aル§9に§cす§aる§9。", "description.wurst.hack.reach": "より遠くに手が届くようになる。", "description.wurst.hack.remoteview": "他人の視点でワールドを見ることができるようになる。\n.rv で特定のエンティティを対象として指定可能。", + "description.wurst.hack.restock": "インベントリから選択したアイテムを自動的に手に補充します。 FastPlace と併用するとより効果的です。", "description.wurst.hack.safewalk": "ブロックの端からの落下を防ぐ。", "description.wurst.hack.scaffoldwalk": "足元に自動でブロックを設置する。", "description.wurst.hack.search": "特定のブロックを虹色でハイライト表示し、探しやすくする。", From 2b649a66d6b13a2b01c79704a35cb02fc055b20b Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 4 Oct 2023 19:59:25 +0200 Subject: [PATCH 09/61] Add MobEspFilterList --- .../net/wurstclient/hacks/MobEspHack.java | 36 ++++++------ .../filterlists/MobEspFilterList.java | 56 +++++++++++++++++++ 2 files changed, 74 insertions(+), 18 deletions(-) create mode 100644 src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java diff --git a/src/main/java/net/wurstclient/hacks/MobEspHack.java b/src/main/java/net/wurstclient/hacks/MobEspHack.java index 83bd1affc1..92f6df06eb 100644 --- a/src/main/java/net/wurstclient/hacks/MobEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobEspHack.java @@ -25,7 +25,8 @@ import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.mob.MobEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.Box; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; @@ -37,7 +38,8 @@ import net.wurstclient.hack.Hack; import net.wurstclient.settings.EnumSetting; import net.wurstclient.settings.EspStyleSetting; -import net.wurstclient.settings.filters.FilterInvisibleSetting; +import net.wurstclient.settings.filterlists.EntityFilterList; +import net.wurstclient.settings.filterlists.MobEspFilterList; import net.wurstclient.util.EntityUtils; import net.wurstclient.util.RegionPos; import net.wurstclient.util.RenderUtils; @@ -54,10 +56,9 @@ public final class MobEspHack extends Hack implements UpdateListener, + "\u00a7lFancy\u00a7r mode shows slightly larger boxes that look better.", BoxSize.values(), BoxSize.FANCY); - private final FilterInvisibleSetting filterInvisible = - new FilterInvisibleSetting("Won't show invisible mobs.", false); + private final EntityFilterList entityFilters = MobEspFilterList.create(); - private final ArrayList mobs = new ArrayList<>(); + private final ArrayList mobs = new ArrayList<>(); private VertexBuffer mobBox; public MobEspHack() @@ -66,7 +67,7 @@ public MobEspHack() setCategory(Category.RENDER); addSetting(style); addSetting(boxSize); - addSetting(filterInvisible); + entityFilters.forEach(this::addSetting); } @Override @@ -97,13 +98,13 @@ public void onUpdate() { mobs.clear(); - Stream stream = - StreamSupport.stream(MC.world.getEntities().spliterator(), false) - .filter(e -> e instanceof MobEntity).map(e -> (MobEntity)e) - .filter(e -> !e.isRemoved() && e.getHealth() > 0); + Stream stream = StreamSupport + .stream(MC.world.getEntities().spliterator(), false) + .filter(e -> e instanceof LivingEntity).map(e -> (LivingEntity)e) + .filter(e -> !(e instanceof PlayerEntity)) + .filter(e -> !e.isRemoved() && e.getHealth() > 0); - if(filterInvisible.isChecked()) - stream = stream.filter(filterInvisible); + stream = entityFilters.applyTo(stream); mobs.addAll(stream.collect(Collectors.toList())); } @@ -149,7 +150,7 @@ private void renderBoxes(MatrixStack matrixStack, float partialTicks, float extraSize = boxSize.getSelected().extraSize; RenderSystem.setShader(GameRenderer::getPositionProgram); - for(MobEntity e : mobs) + for(LivingEntity e : mobs) { matrixStack.push(); @@ -163,11 +164,11 @@ private void renderBoxes(MatrixStack matrixStack, float partialTicks, float f = MC.player.distanceTo(e) / 20F; RenderSystem.setShaderColor(2 - f, f, 0, 0.5F); + Matrix4f viewMatrix = matrixStack.peek().getPositionMatrix(); + Matrix4f projMatrix = RenderSystem.getProjectionMatrix(); ShaderProgram shader = RenderSystem.getShader(); - Matrix4f matrix4f = RenderSystem.getProjectionMatrix(); mobBox.bind(); - mobBox.draw(matrixStack.peek().getPositionMatrix(), matrix4f, - shader); + mobBox.draw(viewMatrix, projMatrix, shader); VertexBuffer.unbind(); matrixStack.pop(); @@ -191,7 +192,7 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, Vec3d start = RotationUtils.getClientLookVec() .add(RenderUtils.getCameraPos()).subtract(regionVec); - for(MobEntity e : mobs) + for(LivingEntity e : mobs) { Vec3d end = EntityUtils.getLerpedBox(e, partialTicks).getCenter() .subtract(regionVec); @@ -210,7 +211,6 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, } tessellator.draw(); - } private enum BoxSize diff --git a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java new file mode 100644 index 0000000000..49c55531b0 --- /dev/null +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -0,0 +1,56 @@ +/* + * 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.filterlists; + +import java.util.ArrayList; +import java.util.List; + +import net.wurstclient.settings.filters.*; + +public final class MobEspFilterList extends EntityFilterList +{ + private MobEspFilterList(List filters) + { + super(filters); + } + + public static MobEspFilterList create() + { + ArrayList builder = new ArrayList<>(); + + builder.add(new FilterMonstersSetting( + "Won't show zombies, creepers, etc.", false)); + + builder + .add(new FilterPigmenSetting("Won't show zombie pigmen.", false)); + + builder.add(new FilterEndermenSetting("Won't show endermen.", false)); + + builder.add( + new FilterAnimalsSetting("Won't show pigs, cows, etc.", false)); + + builder.add(new FilterPetsSetting( + "Won't show tamed wolves, tamed horses, etc.", false)); + + builder.add(new FilterTradersSetting( + "Won't show villagers, wandering traders, etc.", false)); + + builder.add(new FilterGolemsSetting( + "Won't show iron golems, snow golems and shulkers.", false)); + + builder.add(new FilterAllaysSetting("Won't show allays.", false)); + + builder.add( + new FilterInvisibleSetting("Won't show invisible mobs.", false)); + + builder.add( + new FilterArmorStandsSetting("Won't show armor stands.", true)); + + return new MobEspFilterList(builder); + } +} From 4312eee6d253489b2604bae652d59f62fdb34769 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sat, 7 Oct 2023 18:18:46 +0200 Subject: [PATCH 10/61] Change version to 7.38 --- gradle.properties | 2 +- src/main/java/net/wurstclient/WurstClient.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 26c3651a87..a8ed75891f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ loader_version=0.14.22 fabric_version=0.89.3+1.20.2 # Mod Properties -mod_version = v7.37.1-MC1.20.2 +mod_version = v7.38-MC1.20.2 maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index fd4fa86b4f..4e59f4b57e 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -57,7 +57,7 @@ public enum WurstClient public static MinecraftClient MC; public static IMinecraftClient IMC; - public static final String VERSION = "7.37.1"; + public static final String VERSION = "7.38"; public static final String MC_VERSION = "1.20.2"; private WurstAnalytics analytics; From d4b4fcfae4f4b36bc28a2fea80cf0f02062252c8 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sun, 8 Oct 2023 15:19:04 +0200 Subject: [PATCH 11/61] Move "Box size" settings to a separate class --- .../net/wurstclient/hacks/ItemEspHack.java | 32 +++-------- .../net/wurstclient/hacks/MobEspHack.java | 31 ++--------- .../net/wurstclient/hacks/PlayerEspHack.java | 30 ++--------- .../settings/EspBoxSizeSetting.java | 53 +++++++++++++++++++ 4 files changed, 67 insertions(+), 79 deletions(-) create mode 100644 src/main/java/net/wurstclient/settings/EspBoxSizeSetting.java diff --git a/src/main/java/net/wurstclient/hacks/ItemEspHack.java b/src/main/java/net/wurstclient/hacks/ItemEspHack.java index b02bb3dea0..caffd18a32 100644 --- a/src/main/java/net/wurstclient/hacks/ItemEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ItemEspHack.java @@ -32,7 +32,7 @@ import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; import net.wurstclient.settings.ColorSetting; -import net.wurstclient.settings.EnumSetting; +import net.wurstclient.settings.EspBoxSizeSetting; import net.wurstclient.settings.EspStyleSetting; import net.wurstclient.util.EntityUtils; import net.wurstclient.util.RegionPos; @@ -45,10 +45,9 @@ public final class ItemEspHack extends Hack implements UpdateListener, { private final EspStyleSetting style = new EspStyleSetting(); - private final EnumSetting boxSize = new EnumSetting<>("Box size", + private final EspBoxSizeSetting boxSize = new EspBoxSizeSetting( "\u00a7lAccurate\u00a7r mode shows the exact hitbox of each item.\n" - + "\u00a7lFancy\u00a7r mode shows larger boxes that look better.", - BoxSize.values(), BoxSize.FANCY); + + "\u00a7lFancy\u00a7r mode shows larger boxes that look better."); private final ColorSetting color = new ColorSetting("Color", "Items will be highlighted in this color.", Color.YELLOW); @@ -125,7 +124,7 @@ public void onRender(MatrixStack matrixStack, float partialTicks) private void renderBoxes(MatrixStack matrixStack, float partialTicks, RegionPos region) { - float extraSize = boxSize.getSelected().extraSize; + float extraSize = boxSize.getExtraSize(); for(ItemEntity e : items) { @@ -175,6 +174,7 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + for(ItemEntity e : items) { Vec3d end = EntityUtils.getLerpedBox(e, partialTicks).getCenter() @@ -187,27 +187,7 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, .vertex(matrix, (float)end.x, (float)end.y, (float)end.z) .next(); } - tessellator.draw(); - } - - private enum BoxSize - { - ACCURATE("Accurate", 0), - FANCY("Fancy", 0.1F); - - private final String name; - private final float extraSize; - - private BoxSize(String name, float extraSize) - { - this.name = name; - this.extraSize = extraSize; - } - @Override - public String toString() - { - return name; - } + tessellator.draw(); } } diff --git a/src/main/java/net/wurstclient/hacks/MobEspHack.java b/src/main/java/net/wurstclient/hacks/MobEspHack.java index 83bd1affc1..ae18c9d873 100644 --- a/src/main/java/net/wurstclient/hacks/MobEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobEspHack.java @@ -35,7 +35,7 @@ import net.wurstclient.events.RenderListener; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; -import net.wurstclient.settings.EnumSetting; +import net.wurstclient.settings.EspBoxSizeSetting; import net.wurstclient.settings.EspStyleSetting; import net.wurstclient.settings.filters.FilterInvisibleSetting; import net.wurstclient.util.EntityUtils; @@ -49,10 +49,9 @@ public final class MobEspHack extends Hack implements UpdateListener, { private final EspStyleSetting style = new EspStyleSetting(); - private final EnumSetting boxSize = new EnumSetting<>("Box size", + private final EspBoxSizeSetting boxSize = new EspBoxSizeSetting( "\u00a7lAccurate\u00a7r mode shows the exact hitbox of each mob.\n" - + "\u00a7lFancy\u00a7r mode shows slightly larger boxes that look better.", - BoxSize.values(), BoxSize.FANCY); + + "\u00a7lFancy\u00a7r mode shows slightly larger boxes that look better."); private final FilterInvisibleSetting filterInvisible = new FilterInvisibleSetting("Won't show invisible mobs.", false); @@ -146,7 +145,7 @@ public void onRender(MatrixStack matrixStack, float partialTicks) private void renderBoxes(MatrixStack matrixStack, float partialTicks, RegionPos region) { - float extraSize = boxSize.getSelected().extraSize; + float extraSize = boxSize.getExtraSize(); RenderSystem.setShader(GameRenderer::getPositionProgram); for(MobEntity e : mobs) @@ -210,27 +209,5 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, } tessellator.draw(); - - } - - private enum BoxSize - { - ACCURATE("Accurate", 0), - FANCY("Fancy", 0.1F); - - private final String name; - private final float extraSize; - - private BoxSize(String name, float extraSize) - { - this.name = name; - this.extraSize = extraSize; - } - - @Override - public String toString() - { - return name; - } } } diff --git a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java index 9d5d4f2498..a0edc310a6 100644 --- a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java +++ b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java @@ -34,7 +34,7 @@ import net.wurstclient.events.RenderListener; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; -import net.wurstclient.settings.EnumSetting; +import net.wurstclient.settings.EspBoxSizeSetting; import net.wurstclient.settings.EspStyleSetting; import net.wurstclient.settings.EspStyleSetting.EspStyle; import net.wurstclient.settings.filterlists.EntityFilterList; @@ -53,10 +53,9 @@ public final class PlayerEspHack extends Hack implements UpdateListener, private final EspStyleSetting style = new EspStyleSetting(EspStyle.LINES_AND_BOXES); - private final EnumSetting boxSize = new EnumSetting<>("Box size", + private final EspBoxSizeSetting boxSize = new EspBoxSizeSetting( "\u00a7lAccurate\u00a7r mode shows the exact hitbox of each player.\n" - + "\u00a7lFancy\u00a7r mode shows slightly larger boxes that look better.", - BoxSize.values(), BoxSize.FANCY); + + "\u00a7lFancy\u00a7r mode shows slightly larger boxes that look better."); private final EntityFilterList entityFilters = new EntityFilterList( new FilterSleepingSetting("Won't show sleeping players.", false), @@ -147,7 +146,7 @@ public void onRender(MatrixStack matrixStack, float partialTicks) private void renderBoxes(MatrixStack matrixStack, float partialTicks, RegionPos region) { - float extraSize = boxSize.getSelected().extraSize; + float extraSize = boxSize.getExtraSize(); for(PlayerEntity e : players) { @@ -225,25 +224,4 @@ private void renderTracers(MatrixStack matrixStack, float partialTicks, tessellator.draw(); } - - private enum BoxSize - { - ACCURATE("Accurate", 0), - FANCY("Fancy", 0.1F); - - private final String name; - private final float extraSize; - - private BoxSize(String name, float extraSize) - { - this.name = name; - this.extraSize = extraSize; - } - - @Override - public String toString() - { - return name; - } - } } diff --git a/src/main/java/net/wurstclient/settings/EspBoxSizeSetting.java b/src/main/java/net/wurstclient/settings/EspBoxSizeSetting.java new file mode 100644 index 0000000000..dce32108bf --- /dev/null +++ b/src/main/java/net/wurstclient/settings/EspBoxSizeSetting.java @@ -0,0 +1,53 @@ +/* + * 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; + +public final class EspBoxSizeSetting + extends EnumSetting +{ + public EspBoxSizeSetting(String description) + { + super("Box size", description, BoxSize.values(), BoxSize.FANCY); + } + + public EspBoxSizeSetting(String name, String description, BoxSize selected) + { + super(name, description, BoxSize.values(), selected); + } + + public float getExtraSize() + { + return getSelected().extraSize; + } + + public enum BoxSize + { + ACCURATE("Accurate", 0), + FANCY("Fancy", 0.1F); + + private final String name; + private final float extraSize; + + private BoxSize(String name, float extraSize) + { + this.name = name; + this.extraSize = extraSize; + } + + public float getExtraSize() + { + return extraSize; + } + + @Override + public String toString() + { + return name; + } + } +} From ba048bd8dee8ed0f89658b2c5d9243e3a38e0580 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sun, 8 Oct 2023 15:22:48 +0200 Subject: [PATCH 12/61] Add shortcuts for lines & boxes flags of currently selected ESP style --- src/main/java/net/wurstclient/hacks/ChestEspHack.java | 6 +++--- src/main/java/net/wurstclient/hacks/ItemEspHack.java | 6 +++--- src/main/java/net/wurstclient/hacks/MobEspHack.java | 6 +++--- src/main/java/net/wurstclient/hacks/PlayerEspHack.java | 6 +++--- .../java/net/wurstclient/settings/EspStyleSetting.java | 10 ++++++++++ 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/ChestEspHack.java b/src/main/java/net/wurstclient/hacks/ChestEspHack.java index cc2ec14d08..e0e3ef41ac 100644 --- a/src/main/java/net/wurstclient/hacks/ChestEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ChestEspHack.java @@ -192,7 +192,7 @@ else if(entity instanceof ChestBoatEntity) public void onCameraTransformViewBobbing( CameraTransformViewBobbingEvent event) { - if(style.getSelected().hasLines()) + if(style.hasLines()) event.cancel(); } @@ -213,14 +213,14 @@ public void onRender(MatrixStack matrixStack, float partialTicks) ChestEspRenderer espRenderer = new ChestEspRenderer(matrixStack); - if(style.getSelected().hasBoxes()) + if(style.hasBoxes()) { RenderSystem.setShader(GameRenderer::getPositionProgram); groups.stream().filter(ChestEspGroup::isEnabled) .forEach(espRenderer::renderBoxes); } - if(style.getSelected().hasLines()) + if(style.hasLines()) { RenderSystem.setShader(GameRenderer::getPositionProgram); groups.stream().filter(ChestEspGroup::isEnabled) diff --git a/src/main/java/net/wurstclient/hacks/ItemEspHack.java b/src/main/java/net/wurstclient/hacks/ItemEspHack.java index caffd18a32..f1f715557a 100644 --- a/src/main/java/net/wurstclient/hacks/ItemEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ItemEspHack.java @@ -93,7 +93,7 @@ public void onUpdate() public void onCameraTransformViewBobbing( CameraTransformViewBobbingEvent event) { - if(style.getSelected().hasLines()) + if(style.hasLines()) event.cancel(); } @@ -110,7 +110,7 @@ public void onRender(MatrixStack matrixStack, float partialTicks) renderBoxes(matrixStack, partialTicks, region); - if(style.getSelected().hasLines()) + if(style.hasLines()) renderTracers(matrixStack, partialTicks, region); matrixStack.pop(); @@ -134,7 +134,7 @@ private void renderBoxes(MatrixStack matrixStack, float partialTicks, .subtract(region.toVec3d()); matrixStack.translate(lerpedPos.x, lerpedPos.y, lerpedPos.z); - if(style.getSelected().hasBoxes()) + if(style.hasBoxes()) { matrixStack.push(); matrixStack.scale(e.getWidth() + extraSize, diff --git a/src/main/java/net/wurstclient/hacks/MobEspHack.java b/src/main/java/net/wurstclient/hacks/MobEspHack.java index ae18c9d873..97ee2ba59b 100644 --- a/src/main/java/net/wurstclient/hacks/MobEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobEspHack.java @@ -111,7 +111,7 @@ public void onUpdate() public void onCameraTransformViewBobbing( CameraTransformViewBobbingEvent event) { - if(style.getSelected().hasLines()) + if(style.hasLines()) event.cancel(); } @@ -128,10 +128,10 @@ public void onRender(MatrixStack matrixStack, float partialTicks) RegionPos region = RenderUtils.getCameraRegion(); RenderUtils.applyRegionalRenderOffset(matrixStack, region); - if(style.getSelected().hasBoxes()) + if(style.hasBoxes()) renderBoxes(matrixStack, partialTicks, region); - if(style.getSelected().hasLines()) + if(style.hasLines()) renderTracers(matrixStack, partialTicks, region); matrixStack.pop(); diff --git a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java index a0edc310a6..1137f3eb88 100644 --- a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java +++ b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java @@ -111,7 +111,7 @@ public void onUpdate() public void onCameraTransformViewBobbing( CameraTransformViewBobbingEvent event) { - if(style.getSelected().hasLines()) + if(style.hasLines()) event.cancel(); } @@ -129,10 +129,10 @@ public void onRender(MatrixStack matrixStack, float partialTicks) RenderUtils.applyRegionalRenderOffset(matrixStack, region); // draw boxes - if(style.getSelected().hasBoxes()) + if(style.hasBoxes()) renderBoxes(matrixStack, partialTicks, region); - if(style.getSelected().hasLines()) + if(style.hasLines()) renderTracers(matrixStack, partialTicks, region); matrixStack.pop(); diff --git a/src/main/java/net/wurstclient/settings/EspStyleSetting.java b/src/main/java/net/wurstclient/settings/EspStyleSetting.java index 73dd64b9b4..f06da31b22 100644 --- a/src/main/java/net/wurstclient/settings/EspStyleSetting.java +++ b/src/main/java/net/wurstclient/settings/EspStyleSetting.java @@ -24,6 +24,16 @@ public EspStyleSetting(String name, String description, EspStyle selected) super(name, description, EspStyle.values(), selected); } + public boolean hasBoxes() + { + return getSelected().boxes; + } + + public boolean hasLines() + { + return getSelected().lines; + } + public enum EspStyle { BOXES("Boxes only", true, false), From a88cca76147c0f89c5205eea2d27d71ca26498bd Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sun, 8 Oct 2023 19:35:13 +0200 Subject: [PATCH 13/61] Add FilterBatsSetting --- .../net/wurstclient/hacks/AimAssistHack.java | 1 + .../wurstclient/hacks/KillauraLegitHack.java | 1 + .../net/wurstclient/hacks/ProtectHack.java | 1 + .../java/net/wurstclient/hacks/RadarHack.java | 2 + .../filterlists/AnchorAuraFilterList.java | 4 ++ .../filterlists/CrystalAuraFilterList.java | 4 ++ .../filterlists/EntityFilterList.java | 1 + .../filterlists/FollowFilterList.java | 3 ++ .../filterlists/MobEspFilterList.java | 2 + .../filterlists/RemoteViewFilterList.java | 3 ++ .../settings/filters/FilterBatsSetting.java | 37 +++++++++++++++++++ 11 files changed, 59 insertions(+) create mode 100644 src/main/java/net/wurstclient/settings/filters/FilterBatsSetting.java diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 3a60c7b17f..b236b386dd 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -51,6 +51,7 @@ public final class AimAssistHack extends Hack FilterEndermenSetting.genericCombat(false), FilterAnimalsSetting.genericCombat(true), FilterBabiesSetting.genericCombat(true), + FilterBatsSetting.genericCombat(true), FilterPetsSetting.genericCombat(true), FilterTradersSetting.genericCombat(true), FilterGolemsSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index ca9ef20841..a6efe16c14 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -83,6 +83,7 @@ public final class KillauraLegitHack extends Hack FilterEndermenSetting.genericCombat(false), FilterAnimalsSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), + FilterBatsSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), FilterTradersSetting.genericCombat(false), FilterGolemsSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index b65df1ee83..50c50cd3a7 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -57,6 +57,7 @@ public final class ProtectHack extends Hack FilterEndermenSetting.genericCombat(false), FilterAnimalsSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), + FilterBatsSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), FilterTradersSetting.genericCombat(false), FilterGolemsSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/RadarHack.java b/src/main/java/net/wurstclient/hacks/RadarHack.java index cbaa477232..fe6dc0d760 100644 --- a/src/main/java/net/wurstclient/hacks/RadarHack.java +++ b/src/main/java/net/wurstclient/hacks/RadarHack.java @@ -28,6 +28,7 @@ import net.wurstclient.settings.SliderSetting.ValueDisplay; import net.wurstclient.settings.filterlists.EntityFilterList; import net.wurstclient.settings.filters.FilterAnimalsSetting; +import net.wurstclient.settings.filters.FilterBatsSetting; import net.wurstclient.settings.filters.FilterInvisibleSetting; import net.wurstclient.settings.filters.FilterMonstersSetting; import net.wurstclient.settings.filters.FilterPlayersSetting; @@ -50,6 +51,7 @@ public final class RadarHack extends Hack implements UpdateListener new FilterSleepingSetting("Won't show sleeping players.", false), new FilterMonstersSetting("Won't show zombies, creepers, etc.", false), new FilterAnimalsSetting("Won't show pigs, cows, etc.", false), + FilterBatsSetting.genericVision(true), new FilterInvisibleSetting("Won't show invisible entities.", 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 71a02391bb..24295af195 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java @@ -40,6 +40,10 @@ public static AnchorAuraFilterList create() + damageWarning, true)); + builder.add(new FilterBatsSetting("Won't target bats and any other" + + " \"ambient\" mobs when auto-placing anchors." + damageWarning, + true)); + builder.add(new FilterTradersSetting( "Won't target villagers, wandering traders, etc. when auto-placing anchors." + damageWarning, diff --git a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java index 754f8d596e..0c0522c1e1 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java @@ -40,6 +40,10 @@ public static CrystalAuraFilterList create() + damageWarning, true)); + builder.add(new FilterBatsSetting("Won't target bats and any other" + + " \"ambient\" mobs when auto-placing crystals." + damageWarning, + true)); + builder.add(new FilterTradersSetting( "Won't target villagers, wandering traders, etc. when auto-placing crystals." + damageWarning, diff --git a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java index 8077a407f1..d67b425138 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java @@ -60,6 +60,7 @@ public static EntityFilterList genericCombat() FilterEndermenSetting.genericCombat(false), FilterAnimalsSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), + FilterBatsSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), FilterTradersSetting.genericCombat(false), FilterGolemsSetting.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 e6feb12926..d871320c13 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -47,6 +47,9 @@ public static FollowFilterList create() builder.add(new FilterBabiesSetting( "Won't follow baby pigs, baby villagers, etc.", true)); + builder.add(new FilterBatsSetting("Won't follow bats and any other" + + " \"ambient\" mobs that might be added by mods.", 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 49c55531b0..d3b4149ae7 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -34,6 +34,8 @@ public static MobEspFilterList create() builder.add( new FilterAnimalsSetting("Won't show pigs, cows, etc.", false)); + builder.add(FilterBatsSetting.genericVision(false)); + builder.add(new FilterPetsSetting( "Won't show tamed wolves, tamed horses, etc.", false)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java index 882921458c..529092c7a0 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -46,6 +46,9 @@ public static RemoteViewFilterList create() builder.add(new FilterBabiesSetting( "Won't view baby pigs, baby villagers, etc.", true)); + builder.add(new FilterBatsSetting("Won't view bats and any other" + + " \"ambient\" mobs that might be added by mods.", true)); + builder.add(new FilterPetsSetting( "Won't view tamed wolves, tamed horses, etc.", true)); diff --git a/src/main/java/net/wurstclient/settings/filters/FilterBatsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterBatsSetting.java new file mode 100644 index 0000000000..734c7539b2 --- /dev/null +++ b/src/main/java/net/wurstclient/settings/filters/FilterBatsSetting.java @@ -0,0 +1,37 @@ +/* + * 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.AmbientEntity; + +public final class FilterBatsSetting extends EntityFilterCheckbox +{ + public FilterBatsSetting(String description, boolean checked) + { + super("Filter bats", description, checked); + } + + @Override + public boolean test(Entity e) + { + return !(e instanceof AmbientEntity); + } + + public static FilterBatsSetting genericCombat(boolean checked) + { + return new FilterBatsSetting("Won't attack bats and any other" + + " \"ambient\" mobs that might be added by mods.", checked); + } + + public static FilterBatsSetting genericVision(boolean checked) + { + return new FilterBatsSetting("Won't show bats and any other" + + " \"ambient\" mobs that might be added by mods.", checked); + } +} From 4cc22001c248de713817ac4bc26d7279e315ac96 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 9 Oct 2023 09:48:08 +0200 Subject: [PATCH 14/61] Eclipse auto cleanup --- src/main/java/net/wurstclient/commands/FollowCmd.java | 2 +- src/main/java/net/wurstclient/commands/GoToCmd.java | 2 +- src/main/java/net/wurstclient/commands/PathCmd.java | 2 +- src/main/java/net/wurstclient/commands/ProtectCmd.java | 2 +- src/main/java/net/wurstclient/commands/TpCmd.java | 2 +- src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java | 2 +- src/main/java/net/wurstclient/hacks/CrystalAuraHack.java | 2 +- src/main/java/net/wurstclient/hacks/FollowHack.java | 2 +- src/main/java/net/wurstclient/hacks/GlideHack.java | 2 +- src/main/java/net/wurstclient/hacks/InvWalkHack.java | 2 +- src/main/java/net/wurstclient/hacks/MobEspHack.java | 2 +- src/main/java/net/wurstclient/hacks/ProtectHack.java | 2 +- src/main/java/net/wurstclient/hacks/RadarHack.java | 2 +- src/main/java/net/wurstclient/hacks/RemoteViewHack.java | 4 ++-- src/main/java/net/wurstclient/hacks/TunnellerHack.java | 2 +- src/main/java/net/wurstclient/util/EntityUtils.java | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/java/net/wurstclient/commands/FollowCmd.java b/src/main/java/net/wurstclient/commands/FollowCmd.java index 77c25c769f..428bec8910 100644 --- a/src/main/java/net/wurstclient/commands/FollowCmd.java +++ b/src/main/java/net/wurstclient/commands/FollowCmd.java @@ -39,7 +39,7 @@ public void call(String[] args) throws CmdException Entity entity = StreamSupport .stream(MC.world.getEntities().spliterator(), true) - .filter(e -> e instanceof LivingEntity) + .filter(LivingEntity.class::isInstance) .filter(e -> !e.isRemoved() && ((LivingEntity)e).getHealth() > 0) .filter(e -> e != MC.player) .filter(e -> !(e instanceof FakePlayerEntity)) diff --git a/src/main/java/net/wurstclient/commands/GoToCmd.java b/src/main/java/net/wurstclient/commands/GoToCmd.java index f42501a4cb..0dedc5cc50 100644 --- a/src/main/java/net/wurstclient/commands/GoToCmd.java +++ b/src/main/java/net/wurstclient/commands/GoToCmd.java @@ -89,7 +89,7 @@ private BlockPos argsToEntityPos(String name) throws CmdError { LivingEntity entity = StreamSupport .stream(MC.world.getEntities().spliterator(), true) - .filter(e -> e instanceof LivingEntity).map(e -> (LivingEntity)e) + .filter(LivingEntity.class::isInstance).map(e -> (LivingEntity)e) .filter(e -> !e.isRemoved() && e.getHealth() > 0) .filter(e -> e != MC.player) .filter(e -> !(e instanceof FakePlayerEntity)) diff --git a/src/main/java/net/wurstclient/commands/PathCmd.java b/src/main/java/net/wurstclient/commands/PathCmd.java index 71b5d5d49c..98a2570aa1 100644 --- a/src/main/java/net/wurstclient/commands/PathCmd.java +++ b/src/main/java/net/wurstclient/commands/PathCmd.java @@ -129,7 +129,7 @@ private BlockPos argsToEntityPos(String name) throws CmdError { LivingEntity entity = StreamSupport .stream(MC.world.getEntities().spliterator(), true) - .filter(e -> e instanceof LivingEntity).map(e -> (LivingEntity)e) + .filter(LivingEntity.class::isInstance).map(e -> (LivingEntity)e) .filter(e -> !e.isRemoved() && e.getHealth() > 0) .filter(e -> e != MC.player) .filter(e -> !(e instanceof FakePlayerEntity)) diff --git a/src/main/java/net/wurstclient/commands/ProtectCmd.java b/src/main/java/net/wurstclient/commands/ProtectCmd.java index 6a292b7c58..67e716cf7f 100644 --- a/src/main/java/net/wurstclient/commands/ProtectCmd.java +++ b/src/main/java/net/wurstclient/commands/ProtectCmd.java @@ -40,7 +40,7 @@ public void call(String[] args) throws CmdException Entity entity = StreamSupport .stream(MC.world.getEntities().spliterator(), true) - .filter(e -> e instanceof LivingEntity) + .filter(LivingEntity.class::isInstance) .filter(e -> !e.isRemoved() && ((LivingEntity)e).getHealth() > 0) .filter(e -> e != MC.player) .filter(e -> !(e instanceof FakePlayerEntity)) diff --git a/src/main/java/net/wurstclient/commands/TpCmd.java b/src/main/java/net/wurstclient/commands/TpCmd.java index a99e7a72a3..d45a3fd4cf 100644 --- a/src/main/java/net/wurstclient/commands/TpCmd.java +++ b/src/main/java/net/wurstclient/commands/TpCmd.java @@ -67,7 +67,7 @@ private BlockPos argsToEntityPos(String name) throws CmdError { LivingEntity entity = StreamSupport .stream(MC.world.getEntities().spliterator(), true) - .filter(e -> e instanceof LivingEntity).map(e -> (LivingEntity)e) + .filter(LivingEntity.class::isInstance).map(e -> (LivingEntity)e) .filter(e -> !e.isRemoved() && e.getHealth() > 0) .filter(e -> e != MC.player) .filter(e -> !(e instanceof FakePlayerEntity)) diff --git a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java index 3f2b82c01a..028452b484 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java @@ -452,7 +452,7 @@ private void setTargetVillager() Stream stream = StreamSupport.stream(MC.world.getEntities().spliterator(), true) .filter(e -> !e.isRemoved()) - .filter(e -> e instanceof VillagerEntity) + .filter(VillagerEntity.class::isInstance) .map(e -> (VillagerEntity)e).filter(e -> e.getHealth() > 0) .filter(e -> player.squaredDistanceTo(e) <= rangeSq) .filter(e -> e.getVillagerData() diff --git a/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java b/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java index 5c96eefab7..9a672919e6 100644 --- a/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java @@ -234,7 +234,7 @@ private ArrayList getNearbyCrystals() .reversed(); return StreamSupport.stream(MC.world.getEntities().spliterator(), true) - .filter(e -> e instanceof EndCrystalEntity) + .filter(EndCrystalEntity.class::isInstance) .filter(e -> !e.isRemoved()) .filter(e -> player.squaredDistanceTo(e) <= rangeSq) .sorted(furthestFromPlayer) diff --git a/src/main/java/net/wurstclient/hacks/FollowHack.java b/src/main/java/net/wurstclient/hacks/FollowHack.java index 3f58b33ab5..6a7ad57b19 100644 --- a/src/main/java/net/wurstclient/hacks/FollowHack.java +++ b/src/main/java/net/wurstclient/hacks/FollowHack.java @@ -150,7 +150,7 @@ public void onUpdate() { entity = StreamSupport .stream(MC.world.getEntities().spliterator(), true) - .filter(e -> e instanceof LivingEntity) + .filter(LivingEntity.class::isInstance) .filter( e -> !e.isRemoved() && ((LivingEntity)e).getHealth() > 0) .filter(e -> e != MC.player) diff --git a/src/main/java/net/wurstclient/hacks/GlideHack.java b/src/main/java/net/wurstclient/hacks/GlideHack.java index 702bc641a3..8d797e9071 100644 --- a/src/main/java/net/wurstclient/hacks/GlideHack.java +++ b/src/main/java/net/wurstclient/hacks/GlideHack.java @@ -85,7 +85,7 @@ public void onUpdate() // manual collision check, since liquids don't have bounding boxes if(stream.map(BlockUtils::getBlock) - .anyMatch(b -> b instanceof FluidBlock)) + .anyMatch(FluidBlock.class::isInstance)) return; } diff --git a/src/main/java/net/wurstclient/hacks/InvWalkHack.java b/src/main/java/net/wurstclient/hacks/InvWalkHack.java index ebbafe43c7..5598b51f24 100644 --- a/src/main/java/net/wurstclient/hacks/InvWalkHack.java +++ b/src/main/java/net/wurstclient/hacks/InvWalkHack.java @@ -124,6 +124,6 @@ private boolean isCreativeSearchBarOpen(Screen screen) private boolean hasTextBox(Screen screen) { return screen.children().stream() - .anyMatch(e -> e instanceof TextFieldWidget); + .anyMatch(TextFieldWidget.class::isInstance); } } diff --git a/src/main/java/net/wurstclient/hacks/MobEspHack.java b/src/main/java/net/wurstclient/hacks/MobEspHack.java index 97ee2ba59b..dbf573bec2 100644 --- a/src/main/java/net/wurstclient/hacks/MobEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobEspHack.java @@ -98,7 +98,7 @@ public void onUpdate() Stream stream = StreamSupport.stream(MC.world.getEntities().spliterator(), false) - .filter(e -> e instanceof MobEntity).map(e -> (MobEntity)e) + .filter(MobEntity.class::isInstance).map(e -> (MobEntity)e) .filter(e -> !e.isRemoved() && e.getHealth() > 0); if(filterInvisible.isChecked()) diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index b65df1ee83..9149100385 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -119,7 +119,7 @@ public void onEnable() { Stream stream = StreamSupport .stream(MC.world.getEntities().spliterator(), true) - .filter(e -> e instanceof LivingEntity) + .filter(LivingEntity.class::isInstance) .filter( e -> !e.isRemoved() && ((LivingEntity)e).getHealth() > 0) .filter(e -> e != MC.player) diff --git a/src/main/java/net/wurstclient/hacks/RadarHack.java b/src/main/java/net/wurstclient/hacks/RadarHack.java index cbaa477232..150023b0e2 100644 --- a/src/main/java/net/wurstclient/hacks/RadarHack.java +++ b/src/main/java/net/wurstclient/hacks/RadarHack.java @@ -92,7 +92,7 @@ public void onUpdate() StreamSupport.stream(world.getEntities().spliterator(), true) .filter(e -> !e.isRemoved() && e != player) .filter(e -> !(e instanceof FakePlayerEntity)) - .filter(e -> e instanceof LivingEntity) + .filter(LivingEntity.class::isInstance) .filter(e -> ((LivingEntity)e).getHealth() > 0); stream = entityFilters.applyTo(stream); diff --git a/src/main/java/net/wurstclient/hacks/RemoteViewHack.java b/src/main/java/net/wurstclient/hacks/RemoteViewHack.java index bf0154bbf0..f47320c48d 100644 --- a/src/main/java/net/wurstclient/hacks/RemoteViewHack.java +++ b/src/main/java/net/wurstclient/hacks/RemoteViewHack.java @@ -54,7 +54,7 @@ public void onEnable() { Stream stream = StreamSupport .stream(MC.world.getEntities().spliterator(), true) - .filter(e -> e instanceof LivingEntity) + .filter(LivingEntity.class::isInstance) .filter( e -> !e.isRemoved() && ((LivingEntity)e).getHealth() > 0) .filter(e -> e != MC.player) @@ -127,7 +127,7 @@ public void onToggledByCommand(String viewName) { entity = StreamSupport .stream(MC.world.getEntities().spliterator(), false) - .filter(e -> e instanceof LivingEntity) + .filter(LivingEntity.class::isInstance) .filter( e -> !e.isRemoved() && ((LivingEntity)e).getHealth() > 0) .filter(e -> e != MC.player) diff --git a/src/main/java/net/wurstclient/hacks/TunnellerHack.java b/src/main/java/net/wurstclient/hacks/TunnellerHack.java index d061275ab3..0b0bbcfc39 100644 --- a/src/main/java/net/wurstclient/hacks/TunnellerHack.java +++ b/src/main/java/net/wurstclient/hacks/TunnellerHack.java @@ -807,7 +807,7 @@ public boolean canRun() // check for nearby falling blocks return StreamSupport .stream(MC.world.getEntities().spliterator(), false) - .filter(e -> e instanceof FallingBlockEntity) + .filter(FallingBlockEntity.class::isInstance) .anyMatch(e -> MC.player.squaredDistanceTo(e) < 36); } diff --git a/src/main/java/net/wurstclient/util/EntityUtils.java b/src/main/java/net/wurstclient/util/EntityUtils.java index 47918d06d0..68b00e7921 100644 --- a/src/main/java/net/wurstclient/util/EntityUtils.java +++ b/src/main/java/net/wurstclient/util/EntityUtils.java @@ -46,7 +46,7 @@ public static Stream getAttackableEntities() public static Stream getValidAnimals() { return StreamSupport.stream(MC.world.getEntities().spliterator(), true) - .filter(e -> e instanceof AnimalEntity).map(e -> (AnimalEntity)e) + .filter(AnimalEntity.class::isInstance).map(e -> (AnimalEntity)e) .filter(IS_VALID_ANIMAL); } From 204eec5fff28620b145a231ebe0cfcc96d4cca8e Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 9 Oct 2023 09:50:57 +0200 Subject: [PATCH 15/61] Add genericVision() factory methods for entity filters --- src/main/java/net/wurstclient/hacks/RadarHack.java | 12 ++++++------ .../settings/filters/FilterAnimalsSetting.java | 5 +++++ .../settings/filters/FilterInvisibleSetting.java | 6 ++++++ .../settings/filters/FilterMonstersSetting.java | 6 ++++++ .../settings/filters/FilterPlayersSetting.java | 5 +++++ .../settings/filters/FilterSleepingSetting.java | 8 +++++++- 6 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/RadarHack.java b/src/main/java/net/wurstclient/hacks/RadarHack.java index 150023b0e2..e500122422 100644 --- a/src/main/java/net/wurstclient/hacks/RadarHack.java +++ b/src/main/java/net/wurstclient/hacks/RadarHack.java @@ -45,12 +45,12 @@ public final class RadarHack extends Hack implements UpdateListener private final CheckboxSetting rotate = new CheckboxSetting("Rotate with player", true); - private final EntityFilterList entityFilters = new EntityFilterList( - new FilterPlayersSetting("Won't show other players.", false), - new FilterSleepingSetting("Won't show sleeping players.", false), - new FilterMonstersSetting("Won't show zombies, creepers, etc.", false), - new FilterAnimalsSetting("Won't show pigs, cows, etc.", false), - new FilterInvisibleSetting("Won't show invisible entities.", false)); + private final EntityFilterList entityFilters = + new EntityFilterList(FilterPlayersSetting.genericVision(false), + FilterSleepingSetting.genericVision(false), + FilterMonstersSetting.genericVision(false), + FilterAnimalsSetting.genericVision(false), + FilterInvisibleSetting.genericVision(false)); public RadarHack() { diff --git a/src/main/java/net/wurstclient/settings/filters/FilterAnimalsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterAnimalsSetting.java index e5961cd9c4..05a341d912 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterAnimalsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterAnimalsSetting.java @@ -31,4 +31,9 @@ public static FilterAnimalsSetting genericCombat(boolean checked) return new FilterAnimalsSetting("Won't attack pigs, cows, etc.", checked); } + + public static FilterAnimalsSetting genericVision(boolean checked) + { + return new FilterAnimalsSetting("Won't show pigs, cows, etc.", checked); + } } diff --git a/src/main/java/net/wurstclient/settings/filters/FilterInvisibleSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterInvisibleSetting.java index 65699b12fa..67ef67460b 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterInvisibleSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterInvisibleSetting.java @@ -27,4 +27,10 @@ public static FilterInvisibleSetting genericCombat(boolean checked) return new FilterInvisibleSetting("Won't attack invisible entities.", checked); } + + public static FilterInvisibleSetting genericVision(boolean checked) + { + return new FilterInvisibleSetting("Won't show invisible entities.", + checked); + } } diff --git a/src/main/java/net/wurstclient/settings/filters/FilterMonstersSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterMonstersSetting.java index 8f07b5d0c6..04c7511bca 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterMonstersSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterMonstersSetting.java @@ -28,4 +28,10 @@ public static FilterMonstersSetting genericCombat(boolean checked) return new FilterMonstersSetting("Won't attack zombies, creepers, etc.", checked); } + + public static FilterMonstersSetting genericVision(boolean checked) + { + return new FilterMonstersSetting("Won't show zombies, creepers, etc.", + checked); + } } diff --git a/src/main/java/net/wurstclient/settings/filters/FilterPlayersSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterPlayersSetting.java index 80a5921fac..1c0bc4bbef 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterPlayersSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterPlayersSetting.java @@ -27,4 +27,9 @@ public static FilterPlayersSetting genericCombat(boolean checked) { return new FilterPlayersSetting("Won't attack other players.", checked); } + + public static FilterPlayersSetting genericVision(boolean checked) + { + return new FilterPlayersSetting("Won't show other players.", checked); + } } diff --git a/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java index 470f9cba19..4c0682a65d 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java @@ -29,7 +29,13 @@ public boolean test(Entity e) public static FilterSleepingSetting genericCombat(boolean checked) { return new FilterSleepingSetting("Won't attack sleeping players.\n\n" - + "Useful for servers like Mineplex that place sleeping players on the ground to make them look like corpses.", + + "Useful for servers like Mineplex that place sleeping players on" + + " the ground to make them look like corpses.", checked); + } + + public static FilterSleepingSetting genericVision(boolean checked) + { + return new FilterSleepingSetting("Won't show sleeping players.", checked); } } From 8b9fa7e4374b5ccdd81ae313105535d47f9248f0 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 9 Oct 2023 14:55:13 +0200 Subject: [PATCH 16/61] Replace FilterAnimalsSetting with FilterPassiveSetting --- .../net/wurstclient/hacks/AimAssistHack.java | 2 +- .../wurstclient/hacks/KillauraLegitHack.java | 2 +- .../net/wurstclient/hacks/ProtectHack.java | 2 +- .../java/net/wurstclient/hacks/RadarHack.java | 4 +- .../filterlists/AnchorAuraFilterList.java | 6 +-- .../filterlists/CrystalAuraFilterList.java | 6 +-- .../filterlists/EntityFilterList.java | 2 +- .../filterlists/FollowFilterList.java | 5 +- .../filterlists/MobEspFilterList.java | 3 +- .../filterlists/RemoteViewFilterList.java | 5 +- .../filters/FilterAnimalsSetting.java | 39 -------------- .../filters/FilterPassiveSetting.java | 51 +++++++++++++++++++ 12 files changed, 70 insertions(+), 57 deletions(-) delete mode 100644 src/main/java/net/wurstclient/settings/filters/FilterAnimalsSetting.java create mode 100644 src/main/java/net/wurstclient/settings/filters/FilterPassiveSetting.java diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index b236b386dd..26b70837e3 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -49,7 +49,7 @@ public final class AimAssistHack extends Hack FilterMonstersSetting.genericCombat(false), FilterPigmenSetting.genericCombat(false), FilterEndermenSetting.genericCombat(false), - FilterAnimalsSetting.genericCombat(true), + FilterPassiveSetting.genericCombat(true), FilterBabiesSetting.genericCombat(true), FilterBatsSetting.genericCombat(true), FilterPetsSetting.genericCombat(true), diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index a6efe16c14..73688e09ef 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -81,7 +81,7 @@ public final class KillauraLegitHack extends Hack FilterMonstersSetting.genericCombat(false), FilterPigmenSetting.genericCombat(false), FilterEndermenSetting.genericCombat(false), - FilterAnimalsSetting.genericCombat(false), + FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), FilterBatsSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index d2eb83ef09..231aeda562 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -55,7 +55,7 @@ public final class ProtectHack extends Hack FilterMonstersSetting.genericCombat(false), FilterPigmenSetting.genericCombat(false), FilterEndermenSetting.genericCombat(false), - FilterAnimalsSetting.genericCombat(false), + FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), FilterBatsSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/RadarHack.java b/src/main/java/net/wurstclient/hacks/RadarHack.java index 2805e26996..f663a0ff6d 100644 --- a/src/main/java/net/wurstclient/hacks/RadarHack.java +++ b/src/main/java/net/wurstclient/hacks/RadarHack.java @@ -27,10 +27,10 @@ import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; import net.wurstclient.settings.filterlists.EntityFilterList; -import net.wurstclient.settings.filters.FilterAnimalsSetting; import net.wurstclient.settings.filters.FilterBatsSetting; 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; import net.wurstclient.util.FakePlayerEntity; @@ -50,7 +50,7 @@ public final class RadarHack extends Hack implements UpdateListener new EntityFilterList(FilterPlayersSetting.genericVision(false), FilterSleepingSetting.genericVision(false), FilterMonstersSetting.genericVision(false), - FilterAnimalsSetting.genericVision(false), + FilterPassiveSetting.genericVision(false), FilterBatsSetting.genericVision(true), FilterInvisibleSetting.genericVision(false)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java index 24295af195..fc6539e9bf 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java @@ -35,9 +35,9 @@ public static AnchorAuraFilterList create() + damageWarning, true)); - builder.add(new FilterAnimalsSetting( - "Won't target pigs, cows, etc. when auto-placing anchors." - + damageWarning, + builder.add(new FilterPassiveSetting("Won't target animals like pigs" + + " and cows, ambient mobs like bats, and water mobs like fish," + + " squid and dolphins when auto-placing anchors." + damageWarning, true)); builder.add(new FilterBatsSetting("Won't target bats and any other" diff --git a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java index 0c0522c1e1..3f91e95164 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java @@ -35,9 +35,9 @@ public static CrystalAuraFilterList create() + damageWarning, true)); - builder.add(new FilterAnimalsSetting( - "Won't target pigs, cows, etc. when auto-placing crystals." - + damageWarning, + builder.add(new FilterPassiveSetting("Won't target animals like pigs" + + " and cows, ambient mobs like bats, and water mobs like fish," + + " squid and dolphins when auto-placing crystals." + damageWarning, true)); builder.add(new FilterBatsSetting("Won't target bats and any other" diff --git a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java index d67b425138..5ae6fe9cce 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java @@ -58,7 +58,7 @@ public static EntityFilterList genericCombat() FilterMonstersSetting.genericCombat(false), FilterPigmenSetting.genericCombat(false), FilterEndermenSetting.genericCombat(false), - FilterAnimalsSetting.genericCombat(false), + FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), FilterBatsSetting.genericCombat(false), FilterPetsSetting.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 d871320c13..81a0232736 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -41,8 +41,9 @@ public static FollowFilterList create() builder.add(new FilterEndermenSetting("Won't follow endermen.", true)); - builder.add( - new FilterAnimalsSetting("Won't follow pigs, cows, etc.", true)); + builder.add(new FilterPassiveSetting("Won't follow animals like pigs" + + " and cows, ambient mobs like bats, and water mobs like" + + " fish, squid and dolphins.", true)); builder.add(new FilterBabiesSetting( "Won't follow baby pigs, baby villagers, 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 d3b4149ae7..0a48568a75 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -31,8 +31,7 @@ public static MobEspFilterList create() builder.add(new FilterEndermenSetting("Won't show endermen.", false)); - builder.add( - new FilterAnimalsSetting("Won't show pigs, cows, etc.", false)); + builder.add(FilterPassiveSetting.genericVision(false)); builder.add(FilterBatsSetting.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 529092c7a0..185fca5fdb 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -40,8 +40,9 @@ public static RemoteViewFilterList create() builder.add(new FilterEndermenSetting("Won't view endermen.", true)); - builder - .add(new FilterAnimalsSetting("Won't view pigs, cows, etc.", true)); + builder.add(new FilterPassiveSetting("Won't view animals like pigs and" + + " cows, ambient mobs like bats, and water mobs like fish, squid" + + " and dolphins.", true)); builder.add(new FilterBabiesSetting( "Won't view baby pigs, baby villagers, etc.", true)); diff --git a/src/main/java/net/wurstclient/settings/filters/FilterAnimalsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterAnimalsSetting.java deleted file mode 100644 index 05a341d912..0000000000 --- a/src/main/java/net/wurstclient/settings/filters/FilterAnimalsSetting.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.AmbientEntity; -import net.minecraft.entity.mob.WaterCreatureEntity; -import net.minecraft.entity.passive.AnimalEntity; - -public final class FilterAnimalsSetting extends EntityFilterCheckbox -{ - public FilterAnimalsSetting(String description, boolean checked) - { - super("Filter animals", description, checked); - } - - @Override - public boolean test(Entity e) - { - return !(e instanceof AnimalEntity || e instanceof AmbientEntity - || e instanceof WaterCreatureEntity); - } - - public static FilterAnimalsSetting genericCombat(boolean checked) - { - return new FilterAnimalsSetting("Won't attack pigs, cows, etc.", - checked); - } - - public static FilterAnimalsSetting genericVision(boolean checked) - { - return new FilterAnimalsSetting("Won't show pigs, cows, etc.", checked); - } -} diff --git a/src/main/java/net/wurstclient/settings/filters/FilterPassiveSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterPassiveSetting.java new file mode 100644 index 0000000000..f0b9c8c0eb --- /dev/null +++ b/src/main/java/net/wurstclient/settings/filters/FilterPassiveSetting.java @@ -0,0 +1,51 @@ +/* + * 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.AmbientEntity; +import net.minecraft.entity.mob.Angerable; +import net.minecraft.entity.mob.WaterCreatureEntity; +import net.minecraft.entity.passive.AnimalEntity; +import net.minecraft.entity.passive.PufferfishEntity; + +public final class FilterPassiveSetting extends EntityFilterCheckbox +{ + private static final String EXCEPTIONS_TEXT = "\n\nThis filter does not" + + " affect wolves, bees, polar bears, pufferfish, and villagers."; + + public FilterPassiveSetting(String description, boolean checked) + { + super("Filter passive mobs", description + EXCEPTIONS_TEXT, checked); + } + + @Override + public boolean test(Entity e) + { + // never filter out neutral mobs (including pufferfish) + if(e instanceof Angerable || e instanceof PufferfishEntity) + return true; + + return !(e instanceof AnimalEntity || e instanceof AmbientEntity + || e instanceof WaterCreatureEntity); + } + + public static FilterPassiveSetting genericCombat(boolean checked) + { + return new FilterPassiveSetting("Won't attack animals like pigs and" + + " cows, ambient mobs like bats, and water mobs like fish, squid" + + " and dolphins.", checked); + } + + public static FilterPassiveSetting genericVision(boolean checked) + { + return new FilterPassiveSetting("Won't show animals like pigs and" + + " cows, ambient mobs like bats, and water mobs like fish, squid" + + " and dolphins.", checked); + } +} From c89f5e3a6c1028eedcc18facb5735c685c46e538 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 9 Oct 2023 15:44:53 +0200 Subject: [PATCH 17/61] Add more genericVision() factory methods for entity filters --- .../wurstclient/settings/filters/FilterAllaysSetting.java | 5 +++++ .../settings/filters/FilterArmorStandsSetting.java | 6 ++++++ .../wurstclient/settings/filters/FilterEndermenSetting.java | 5 +++++ .../wurstclient/settings/filters/FilterGolemsSetting.java | 6 ++++++ .../net/wurstclient/settings/filters/FilterPetsSetting.java | 6 ++++++ .../wurstclient/settings/filters/FilterPigmenSetting.java | 5 +++++ .../wurstclient/settings/filters/FilterTradersSetting.java | 6 ++++++ 7 files changed, 39 insertions(+) diff --git a/src/main/java/net/wurstclient/settings/filters/FilterAllaysSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterAllaysSetting.java index 0627467f59..4332233931 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterAllaysSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterAllaysSetting.java @@ -27,4 +27,9 @@ public static FilterAllaysSetting genericCombat(boolean checked) { return new FilterAllaysSetting("Won't attack allays.", checked); } + + public static FilterAllaysSetting genericVision(boolean checked) + { + return new FilterAllaysSetting("Won't show allays.", checked); + } } diff --git a/src/main/java/net/wurstclient/settings/filters/FilterArmorStandsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterArmorStandsSetting.java index eb57060476..cf067edfad 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterArmorStandsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterArmorStandsSetting.java @@ -28,4 +28,10 @@ public static FilterArmorStandsSetting genericCombat(boolean checked) return new FilterArmorStandsSetting("Won't attack armor stands.", checked); } + + public static FilterArmorStandsSetting genericVision(boolean checked) + { + return new FilterArmorStandsSetting("Won't show armor stands.", + checked); + } } diff --git a/src/main/java/net/wurstclient/settings/filters/FilterEndermenSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterEndermenSetting.java index db60e127db..7199a37459 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterEndermenSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterEndermenSetting.java @@ -27,4 +27,9 @@ public static FilterEndermenSetting genericCombat(boolean checked) { return new FilterEndermenSetting("Won't attack endermen.", checked); } + + public static FilterEndermenSetting genericVision(boolean checked) + { + return new FilterEndermenSetting("Won't show endermen.", checked); + } } diff --git a/src/main/java/net/wurstclient/settings/filters/FilterGolemsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterGolemsSetting.java index 0215857cd3..d2d0c0be74 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterGolemsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterGolemsSetting.java @@ -28,4 +28,10 @@ public static FilterGolemsSetting genericCombat(boolean checked) return new FilterGolemsSetting( "Won't attack iron golems, snow golems and shulkers.", checked); } + + public static FilterGolemsSetting genericVision(boolean checked) + { + return new FilterGolemsSetting( + "Won't show iron golems, snow golems and shulkers.", checked); + } } diff --git a/src/main/java/net/wurstclient/settings/filters/FilterPetsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterPetsSetting.java index 7dd99222b9..72c4409d21 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterPetsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterPetsSetting.java @@ -31,4 +31,10 @@ public static FilterPetsSetting genericCombat(boolean checked) return new FilterPetsSetting( "Won't attack tamed wolves, tamed horses, etc.", checked); } + + public static FilterPetsSetting genericVision(boolean checked) + { + return new FilterPetsSetting( + "Won't show tamed wolves, tamed horses, etc.", checked); + } } diff --git a/src/main/java/net/wurstclient/settings/filters/FilterPigmenSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterPigmenSetting.java index 40b8d998fe..d510595629 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterPigmenSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterPigmenSetting.java @@ -27,4 +27,9 @@ public static FilterPigmenSetting genericCombat(boolean checked) { return new FilterPigmenSetting("Won't attack zombie pigmen.", checked); } + + public static FilterPigmenSetting genericVision(boolean checked) + { + return new FilterPigmenSetting("Won't show zombie pigmen.", checked); + } } diff --git a/src/main/java/net/wurstclient/settings/filters/FilterTradersSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterTradersSetting.java index 08660308cb..5c7b07cca0 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterTradersSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterTradersSetting.java @@ -28,4 +28,10 @@ public static FilterTradersSetting genericCombat(boolean checked) return new FilterTradersSetting( "Won't attack villagers, wandering traders, etc.", checked); } + + public static FilterTradersSetting genericVision(boolean checked) + { + return new FilterTradersSetting( + "Won't show villagers, wandering traders, etc.", checked); + } } From 59c603b7f80cd639d112c4598fa75a176b325dd5 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 9 Oct 2023 15:48:08 +0200 Subject: [PATCH 18/61] Use genericVision() factory methods in MobEspFilterList --- .../filterlists/MobEspFilterList.java | 37 +++++-------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java index 0a48568a75..b8bc6fc3eb 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -22,36 +22,17 @@ private MobEspFilterList(List filters) public static MobEspFilterList create() { ArrayList builder = new ArrayList<>(); - - builder.add(new FilterMonstersSetting( - "Won't show zombies, creepers, etc.", false)); - - builder - .add(new FilterPigmenSetting("Won't show zombie pigmen.", false)); - - builder.add(new FilterEndermenSetting("Won't show endermen.", false)); - + builder.add(FilterMonstersSetting.genericVision(false)); + builder.add(FilterPigmenSetting.genericVision(false)); + builder.add(FilterEndermenSetting.genericVision(false)); builder.add(FilterPassiveSetting.genericVision(false)); - builder.add(FilterBatsSetting.genericVision(false)); - - builder.add(new FilterPetsSetting( - "Won't show tamed wolves, tamed horses, etc.", false)); - - builder.add(new FilterTradersSetting( - "Won't show villagers, wandering traders, etc.", false)); - - builder.add(new FilterGolemsSetting( - "Won't show iron golems, snow golems and shulkers.", false)); - - builder.add(new FilterAllaysSetting("Won't show allays.", false)); - - builder.add( - new FilterInvisibleSetting("Won't show invisible mobs.", false)); - - builder.add( - new FilterArmorStandsSetting("Won't show armor stands.", true)); - + builder.add(FilterPetsSetting.genericVision(false)); + builder.add(FilterTradersSetting.genericVision(false)); + builder.add(FilterGolemsSetting.genericVision(false)); + builder.add(FilterAllaysSetting.genericVision(false)); + builder.add(FilterInvisibleSetting.genericVision(false)); + builder.add(FilterArmorStandsSetting.genericVision(true)); return new MobEspFilterList(builder); } } From cc9a3bc95fe38ecc7d13c0254c950ea22a9dd188 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 9 Oct 2023 18:09:47 +0200 Subject: [PATCH 19/61] Rename FilterPigmenSetting to FilterZombiePiglinsSetting --- .../net/wurstclient/hacks/AimAssistHack.java | 2 +- .../wurstclient/hacks/KillauraLegitHack.java | 2 +- .../net/wurstclient/hacks/ProtectHack.java | 2 +- .../filterlists/EntityFilterList.java | 2 +- .../filterlists/FollowFilterList.java | 4 +- .../filterlists/MobEspFilterList.java | 2 +- .../filterlists/RemoteViewFilterList.java | 3 +- .../settings/filters/FilterPigmenSetting.java | 35 ------------------ .../filters/FilterZombiePiglinsSetting.java | 37 +++++++++++++++++++ 9 files changed, 46 insertions(+), 43 deletions(-) delete mode 100644 src/main/java/net/wurstclient/settings/filters/FilterPigmenSetting.java create mode 100644 src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 26b70837e3..3931c55e3d 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -47,7 +47,7 @@ public final class AimAssistHack extends Hack FilterSleepingSetting.genericCombat(false), FilterFlyingSetting.genericCombat(0), FilterMonstersSetting.genericCombat(false), - FilterPigmenSetting.genericCombat(false), + FilterZombiePiglinsSetting.genericCombat(false), FilterEndermenSetting.genericCombat(false), FilterPassiveSetting.genericCombat(true), FilterBabiesSetting.genericCombat(true), diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index 73688e09ef..4b50479b2a 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -79,7 +79,7 @@ public final class KillauraLegitHack extends Hack FilterSleepingSetting.genericCombat(true), FilterFlyingSetting.genericCombat(0.5), FilterMonstersSetting.genericCombat(false), - FilterPigmenSetting.genericCombat(false), + FilterZombiePiglinsSetting.genericCombat(false), FilterEndermenSetting.genericCombat(false), FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index 231aeda562..720ee9dcd8 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -53,7 +53,7 @@ public final class ProtectHack extends Hack FilterSleepingSetting.genericCombat(false), FilterFlyingSetting.genericCombat(0), FilterMonstersSetting.genericCombat(false), - FilterPigmenSetting.genericCombat(false), + FilterZombiePiglinsSetting.genericCombat(false), FilterEndermenSetting.genericCombat(false), FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java index 5ae6fe9cce..ae4755a9bd 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java @@ -56,7 +56,7 @@ public static EntityFilterList genericCombat() FilterSleepingSetting.genericCombat(false), FilterFlyingSetting.genericCombat(0), FilterMonstersSetting.genericCombat(false), - FilterPigmenSetting.genericCombat(false), + FilterZombiePiglinsSetting.genericCombat(false), FilterEndermenSetting.genericCombat(false), FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.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 81a0232736..c21769ccbc 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -36,8 +36,8 @@ public static FollowFilterList create() builder.add(new FilterMonstersSetting( "Won't follow zombies, creepers, etc.", true)); - builder - .add(new FilterPigmenSetting("Won't follow zombie pigmen.", true)); + builder.add(new FilterZombiePiglinsSetting( + "Won't follow zombified piglins.", true)); builder.add(new FilterEndermenSetting("Won't follow endermen.", true)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java index b8bc6fc3eb..68d3ad0c72 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -23,7 +23,7 @@ public static MobEspFilterList create() { ArrayList builder = new ArrayList<>(); builder.add(FilterMonstersSetting.genericVision(false)); - builder.add(FilterPigmenSetting.genericVision(false)); + builder.add(FilterZombiePiglinsSetting.genericVision(false)); builder.add(FilterEndermenSetting.genericVision(false)); builder.add(FilterPassiveSetting.genericVision(false)); builder.add(FilterBatsSetting.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 185fca5fdb..a971404599 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -36,7 +36,8 @@ public static RemoteViewFilterList create() builder.add(new FilterMonstersSetting( "Won't view zombies, creepers, etc.", true)); - builder.add(new FilterPigmenSetting("Won't view zombie pigmen.", true)); + builder.add(new FilterZombiePiglinsSetting( + "Won't view zombified piglins.", true)); builder.add(new FilterEndermenSetting("Won't view endermen.", true)); diff --git a/src/main/java/net/wurstclient/settings/filters/FilterPigmenSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterPigmenSetting.java deleted file mode 100644 index d510595629..0000000000 --- a/src/main/java/net/wurstclient/settings/filters/FilterPigmenSetting.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.ZombifiedPiglinEntity; - -public final class FilterPigmenSetting extends EntityFilterCheckbox -{ - public FilterPigmenSetting(String description, boolean checked) - { - super("Filter pigmen", description, checked); - } - - @Override - public boolean test(Entity e) - { - return !(e instanceof ZombifiedPiglinEntity); - } - - public static FilterPigmenSetting genericCombat(boolean checked) - { - return new FilterPigmenSetting("Won't attack zombie pigmen.", checked); - } - - public static FilterPigmenSetting genericVision(boolean checked) - { - return new FilterPigmenSetting("Won't show zombie pigmen.", checked); - } -} diff --git a/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java new file mode 100644 index 0000000000..9274d2aa70 --- /dev/null +++ b/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java @@ -0,0 +1,37 @@ +/* + * 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.ZombifiedPiglinEntity; + +public final class FilterZombiePiglinsSetting extends EntityFilterCheckbox +{ + public FilterZombiePiglinsSetting(String description, boolean checked) + { + super("Filter zombie piglins", description, checked); + } + + @Override + public boolean test(Entity e) + { + return !(e instanceof ZombifiedPiglinEntity); + } + + public static FilterZombiePiglinsSetting genericCombat(boolean checked) + { + return new FilterZombiePiglinsSetting("Won't attack zombified piglins.", + checked); + } + + public static FilterZombiePiglinsSetting genericVision(boolean checked) + { + return new FilterZombiePiglinsSetting("Won't show zombified piglins.", + checked); + } +} From 64cdb12b905fc05cf4036c9e2ad209a325958ae6 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 9 Oct 2023 20:43:22 +0200 Subject: [PATCH 20/61] Add aggro detection to zombie piglin filter --- .../net/wurstclient/hacks/AimAssistHack.java | 3 +- .../wurstclient/hacks/KillauraLegitHack.java | 3 +- .../net/wurstclient/hacks/ProtectHack.java | 3 +- .../filterlists/EntityFilterList.java | 3 +- .../filterlists/FollowFilterList.java | 4 +- .../filterlists/MobEspFilterList.java | 3 +- .../filterlists/RemoteViewFilterList.java | 4 +- .../filters/FilterZombiePiglinsSetting.java | 88 ++++++++++++++++--- 8 files changed, 92 insertions(+), 19 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 3931c55e3d..c94e0089ed 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -47,7 +47,8 @@ public final class AimAssistHack extends Hack FilterSleepingSetting.genericCombat(false), FilterFlyingSetting.genericCombat(0), FilterMonstersSetting.genericCombat(false), - FilterZombiePiglinsSetting.genericCombat(false), + FilterZombiePiglinsSetting + .genericCombat(FilterZombiePiglinsSetting.Mode.OFF), FilterEndermenSetting.genericCombat(false), FilterPassiveSetting.genericCombat(true), FilterBabiesSetting.genericCombat(true), diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index 4b50479b2a..d2f02df142 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -79,7 +79,8 @@ public final class KillauraLegitHack extends Hack FilterSleepingSetting.genericCombat(true), FilterFlyingSetting.genericCombat(0.5), FilterMonstersSetting.genericCombat(false), - FilterZombiePiglinsSetting.genericCombat(false), + FilterZombiePiglinsSetting + .genericCombat(FilterZombiePiglinsSetting.Mode.OFF), FilterEndermenSetting.genericCombat(false), FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index 720ee9dcd8..15c64d48ff 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -53,7 +53,8 @@ public final class ProtectHack extends Hack FilterSleepingSetting.genericCombat(false), FilterFlyingSetting.genericCombat(0), FilterMonstersSetting.genericCombat(false), - FilterZombiePiglinsSetting.genericCombat(false), + FilterZombiePiglinsSetting + .genericCombat(FilterZombiePiglinsSetting.Mode.OFF), FilterEndermenSetting.genericCombat(false), FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java index ae4755a9bd..d9c7b501f9 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java @@ -56,7 +56,8 @@ public static EntityFilterList genericCombat() FilterSleepingSetting.genericCombat(false), FilterFlyingSetting.genericCombat(0), FilterMonstersSetting.genericCombat(false), - FilterZombiePiglinsSetting.genericCombat(false), + FilterZombiePiglinsSetting + .genericCombat(FilterZombiePiglinsSetting.Mode.OFF), FilterEndermenSetting.genericCombat(false), FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.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 c21769ccbc..e9b4f2373e 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -36,8 +36,8 @@ public static FollowFilterList create() builder.add(new FilterMonstersSetting( "Won't follow zombies, creepers, etc.", true)); - builder.add(new FilterZombiePiglinsSetting( - "Won't follow zombified piglins.", true)); + builder.add(FilterZombiePiglinsSetting + .onOffOnly("Won't follow zombified piglins.", true)); builder.add(new FilterEndermenSetting("Won't follow endermen.", true)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java index 68d3ad0c72..474bdeeab8 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -23,7 +23,8 @@ public static MobEspFilterList create() { ArrayList builder = new ArrayList<>(); builder.add(FilterMonstersSetting.genericVision(false)); - builder.add(FilterZombiePiglinsSetting.genericVision(false)); + builder.add(FilterZombiePiglinsSetting + .genericVision(FilterZombiePiglinsSetting.Mode.OFF)); builder.add(FilterEndermenSetting.genericVision(false)); builder.add(FilterPassiveSetting.genericVision(false)); builder.add(FilterBatsSetting.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 a971404599..4369e417cb 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -36,8 +36,8 @@ public static RemoteViewFilterList create() builder.add(new FilterMonstersSetting( "Won't view zombies, creepers, etc.", true)); - builder.add(new FilterZombiePiglinsSetting( - "Won't view zombified piglins.", true)); + builder.add(FilterZombiePiglinsSetting + .onOffOnly("Won't view zombified piglins.", true)); builder.add(new FilterEndermenSetting("Won't view endermen.", true)); diff --git a/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java index 9274d2aa70..928f9d89cb 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java @@ -7,31 +7,99 @@ */ package net.wurstclient.settings.filters; +import java.util.function.Predicate; + import net.minecraft.entity.Entity; import net.minecraft.entity.mob.ZombifiedPiglinEntity; +import net.wurstclient.settings.EnumSetting; +import net.wurstclient.settings.Setting; +import net.wurstclient.settings.filterlists.EntityFilterList.EntityFilter; -public final class FilterZombiePiglinsSetting extends EntityFilterCheckbox +public final class FilterZombiePiglinsSetting + extends EnumSetting implements EntityFilter { - public FilterZombiePiglinsSetting(String description, boolean checked) + private FilterZombiePiglinsSetting(String description, Mode[] values, + Mode selected) { - super("Filter zombie piglins", description, checked); + super("Filter zombie piglins", description, values, selected); + } + + public FilterZombiePiglinsSetting(String description, Mode selected) + { + this(description, Mode.values(), selected); } @Override public boolean test(Entity e) { - return !(e instanceof ZombifiedPiglinEntity); + return getSelected().predicate.test(e); + } + + @Override + public boolean isFilterEnabled() + { + return getSelected() != Mode.OFF; + } + + @Override + public Setting getSetting() + { + return this; + } + + public static FilterZombiePiglinsSetting genericCombat(Mode selected) + { + return new FilterZombiePiglinsSetting("When set to \u00a7lOn\u00a7r," + + " zombified piglins won't be attacked at all.\n\n" + + "When set to \u00a7lIf calm\u00a7r, zombified piglins won't be" + + " attacked until they attack first. Be warned that this filter" + + " cannot detect if the zombified piglins are attacking you or" + + " someone else.\n\n" + + "When set to \u00a7lOff\u00a7r, this filter does nothing and" + + " zombified piglins can be attacked.", selected); + } + + public static FilterZombiePiglinsSetting genericVision(Mode selected) + { + return new FilterZombiePiglinsSetting("When set to \u00a7lOn\u00a7r," + + " zombified piglins won't be shown at all.\n\n" + + "When set to \u00a7lIf calm\u00a7r, zombified piglins won't be" + + " shown until they attack something.\n\n" + + "When set to \u00a7lOff\u00a7r, this filter does nothing and" + + " zombified piglins can be shown.", selected); } - public static FilterZombiePiglinsSetting genericCombat(boolean checked) + public static FilterZombiePiglinsSetting onOffOnly(String description, + boolean onByDefault) { - return new FilterZombiePiglinsSetting("Won't attack zombified piglins.", - checked); + Mode[] values = {Mode.ON, Mode.OFF}; + Mode selected = onByDefault ? Mode.ON : Mode.OFF; + return new FilterZombiePiglinsSetting(description, values, selected); } - public static FilterZombiePiglinsSetting genericVision(boolean checked) + public enum Mode { - return new FilterZombiePiglinsSetting("Won't show zombified piglins.", - checked); + ON("On", e -> !(e instanceof ZombifiedPiglinEntity)), + + IF_CALM("If calm", + e -> !(e instanceof ZombifiedPiglinEntity zpe) + || zpe.isAttacking()), + + OFF("Off", e -> true); + + private final String name; + private final Predicate predicate; + + private Mode(String name, Predicate predicate) + { + this.name = name; + this.predicate = predicate; + } + + @Override + public String toString() + { + return name; + } } } From dda3231383d1bd19be2d159b308b1d9682730c3b Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 11 Oct 2023 09:58:23 +0200 Subject: [PATCH 21/61] Add superclass for attack detecting entity filters --- .../filters/AttackDetectingEntityFilter.java | 83 +++++++++++++++++++ .../filters/FilterZombiePiglinsSetting.java | 59 +++---------- 2 files changed, 93 insertions(+), 49 deletions(-) create mode 100644 src/main/java/net/wurstclient/settings/filters/AttackDetectingEntityFilter.java diff --git a/src/main/java/net/wurstclient/settings/filters/AttackDetectingEntityFilter.java b/src/main/java/net/wurstclient/settings/filters/AttackDetectingEntityFilter.java new file mode 100644 index 0000000000..96f0426e3f --- /dev/null +++ b/src/main/java/net/wurstclient/settings/filters/AttackDetectingEntityFilter.java @@ -0,0 +1,83 @@ +/* + * 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 java.util.function.Supplier; + +import net.minecraft.entity.Entity; +import net.wurstclient.settings.CheckboxSetting; +import net.wurstclient.settings.EnumSetting; +import net.wurstclient.settings.Setting; +import net.wurstclient.settings.filterlists.EntityFilterList.EntityFilter; + +public abstract class AttackDetectingEntityFilter implements EntityFilter +{ + private final Setting setting; + private final Supplier mode; + + protected AttackDetectingEntityFilter(String name, String description, + Mode selected, boolean checked) + { + if(selected == null) + { + CheckboxSetting cbSetting = + new CheckboxSetting(name, description, checked); + setting = cbSetting; + mode = () -> cbSetting.isChecked() ? Mode.ON : Mode.OFF; + + }else + { + EnumSetting enumSetting = + new EnumSetting<>(name, description, Mode.values(), selected); + setting = enumSetting; + mode = () -> enumSetting.getSelected(); + } + } + + public abstract boolean onTest(Entity e); + + public abstract boolean ifCalmTest(Entity e); + + @Override + public final boolean test(Entity e) + { + return mode.get() == Mode.IF_CALM ? ifCalmTest(e) : onTest(e); + } + + @Override + public final boolean isFilterEnabled() + { + return mode.get() != Mode.OFF; + } + + @Override + public final Setting getSetting() + { + return setting; + } + + public enum Mode + { + ON("On"), + IF_CALM("If calm"), + OFF("Off"); + + private final String name; + + private Mode(String name) + { + this.name = name; + } + + @Override + public String toString() + { + return name; + } + } +} diff --git a/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java index 928f9d89cb..62fae589c9 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java @@ -7,44 +7,33 @@ */ package net.wurstclient.settings.filters; -import java.util.function.Predicate; - import net.minecraft.entity.Entity; import net.minecraft.entity.mob.ZombifiedPiglinEntity; -import net.wurstclient.settings.EnumSetting; -import net.wurstclient.settings.Setting; -import net.wurstclient.settings.filterlists.EntityFilterList.EntityFilter; public final class FilterZombiePiglinsSetting - extends EnumSetting implements EntityFilter + extends AttackDetectingEntityFilter { - private FilterZombiePiglinsSetting(String description, Mode[] values, - Mode selected) + private FilterZombiePiglinsSetting(String description, Mode selected, + boolean checked) { - super("Filter zombie piglins", description, values, selected); + super("Filter zombie piglins", description, selected, checked); } public FilterZombiePiglinsSetting(String description, Mode selected) { - this(description, Mode.values(), selected); - } - - @Override - public boolean test(Entity e) - { - return getSelected().predicate.test(e); + this(description, selected, false); } @Override - public boolean isFilterEnabled() + public boolean onTest(Entity e) { - return getSelected() != Mode.OFF; + return !(e instanceof ZombifiedPiglinEntity); } @Override - public Setting getSetting() + public boolean ifCalmTest(Entity e) { - return this; + return !(e instanceof ZombifiedPiglinEntity zpe) || zpe.isAttacking(); } public static FilterZombiePiglinsSetting genericCombat(Mode selected) @@ -72,34 +61,6 @@ public static FilterZombiePiglinsSetting genericVision(Mode selected) public static FilterZombiePiglinsSetting onOffOnly(String description, boolean onByDefault) { - Mode[] values = {Mode.ON, Mode.OFF}; - Mode selected = onByDefault ? Mode.ON : Mode.OFF; - return new FilterZombiePiglinsSetting(description, values, selected); - } - - public enum Mode - { - ON("On", e -> !(e instanceof ZombifiedPiglinEntity)), - - IF_CALM("If calm", - e -> !(e instanceof ZombifiedPiglinEntity zpe) - || zpe.isAttacking()), - - OFF("Off", e -> true); - - private final String name; - private final Predicate predicate; - - private Mode(String name, Predicate predicate) - { - this.name = name; - this.predicate = predicate; - } - - @Override - public String toString() - { - return name; - } + return new FilterZombiePiglinsSetting(description, null, onByDefault); } } From 4e292b47bdf9cca7eca41234fbf85133afde9ce2 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 11 Oct 2023 10:26:18 +0200 Subject: [PATCH 22/61] Make FilterEndermenSetting attack detecting --- .../net/wurstclient/hacks/AimAssistHack.java | 5 ++- .../wurstclient/hacks/KillauraLegitHack.java | 5 ++- .../net/wurstclient/hacks/ProtectHack.java | 3 +- .../filterlists/EntityFilterList.java | 5 ++- .../filterlists/FollowFilterList.java | 3 +- .../filterlists/MobEspFilterList.java | 5 ++- .../filterlists/RemoteViewFilterList.java | 3 +- .../filters/FilterEndermenSetting.java | 45 +++++++++++++++---- 8 files changed, 55 insertions(+), 19 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index c94e0089ed..e71efd2842 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -48,8 +48,9 @@ public final class AimAssistHack extends Hack FilterFlyingSetting.genericCombat(0), FilterMonstersSetting.genericCombat(false), FilterZombiePiglinsSetting - .genericCombat(FilterZombiePiglinsSetting.Mode.OFF), - FilterEndermenSetting.genericCombat(false), + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), + FilterEndermenSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(true), FilterBabiesSetting.genericCombat(true), FilterBatsSetting.genericCombat(true), diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index d2f02df142..29b8af8c81 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -80,8 +80,9 @@ public final class KillauraLegitHack extends Hack FilterFlyingSetting.genericCombat(0.5), FilterMonstersSetting.genericCombat(false), FilterZombiePiglinsSetting - .genericCombat(FilterZombiePiglinsSetting.Mode.OFF), - FilterEndermenSetting.genericCombat(false), + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), + FilterEndermenSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), FilterBatsSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index 15c64d48ff..01fd7d603d 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -55,7 +55,8 @@ public final class ProtectHack extends Hack FilterMonstersSetting.genericCombat(false), FilterZombiePiglinsSetting .genericCombat(FilterZombiePiglinsSetting.Mode.OFF), - FilterEndermenSetting.genericCombat(false), + FilterEndermenSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), FilterBatsSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java index d9c7b501f9..30bfa6d080 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java @@ -57,8 +57,9 @@ public static EntityFilterList genericCombat() FilterFlyingSetting.genericCombat(0), FilterMonstersSetting.genericCombat(false), FilterZombiePiglinsSetting - .genericCombat(FilterZombiePiglinsSetting.Mode.OFF), - FilterEndermenSetting.genericCombat(false), + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), + FilterEndermenSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), FilterBatsSetting.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 e9b4f2373e..f1f397ff88 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -39,7 +39,8 @@ public static FollowFilterList create() builder.add(FilterZombiePiglinsSetting .onOffOnly("Won't follow zombified piglins.", true)); - builder.add(new FilterEndermenSetting("Won't follow endermen.", true)); + builder.add( + FilterEndermenSetting.onOffOnly("Won't follow endermen.", true)); builder.add(new FilterPassiveSetting("Won't follow animals like pigs" + " and cows, ambient mobs like bats, and water mobs like" diff --git a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java index 474bdeeab8..4ecbf1e256 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -24,8 +24,9 @@ public static MobEspFilterList create() ArrayList builder = new ArrayList<>(); builder.add(FilterMonstersSetting.genericVision(false)); builder.add(FilterZombiePiglinsSetting - .genericVision(FilterZombiePiglinsSetting.Mode.OFF)); - builder.add(FilterEndermenSetting.genericVision(false)); + .genericVision(AttackDetectingEntityFilter.Mode.OFF)); + builder.add(FilterEndermenSetting + .genericVision(AttackDetectingEntityFilter.Mode.OFF)); builder.add(FilterPassiveSetting.genericVision(false)); builder.add(FilterBatsSetting.genericVision(false)); builder.add(FilterPetsSetting.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 4369e417cb..74aadf7ab7 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -39,7 +39,8 @@ public static RemoteViewFilterList create() builder.add(FilterZombiePiglinsSetting .onOffOnly("Won't view zombified piglins.", true)); - builder.add(new FilterEndermenSetting("Won't view endermen.", true)); + builder + .add(FilterEndermenSetting.onOffOnly("Won't view endermen.", true)); builder.add(new FilterPassiveSetting("Won't view animals like pigs and" + " cows, ambient mobs like bats, and water mobs like fish, squid" diff --git a/src/main/java/net/wurstclient/settings/filters/FilterEndermenSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterEndermenSetting.java index 7199a37459..ddf0f9e55e 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterEndermenSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterEndermenSetting.java @@ -10,26 +10,55 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.mob.EndermanEntity; -public final class FilterEndermenSetting extends EntityFilterCheckbox +public final class FilterEndermenSetting extends AttackDetectingEntityFilter { - public FilterEndermenSetting(String description, boolean checked) + private FilterEndermenSetting(String description, Mode selected, + boolean checked) { - super("Filter endermen", description, checked); + super("Filter endermen", description, selected, checked); + } + + public FilterEndermenSetting(String description, Mode selected) + { + this(description, selected, false); } @Override - public boolean test(Entity e) + public boolean onTest(Entity e) { return !(e instanceof EndermanEntity); } - public static FilterEndermenSetting genericCombat(boolean checked) + @Override + public boolean ifCalmTest(Entity e) + { + return !(e instanceof EndermanEntity ee) || ee.isAttacking(); + } + + public static FilterEndermenSetting genericCombat(Mode selected) + { + return new FilterEndermenSetting("When set to \u00a7lOn\u00a7r," + + " endermen won't be attacked at all.\n\n" + + "When set to \u00a7lIf calm\u00a7r, endermen won't be attacked" + + " until they attack first. Be warned that this filter cannot" + + " detect if the endermen are attacking you or someone else.\n\n" + + "When set to \u00a7lOff\u00a7r, this filter does nothing and" + + " endermen can be attacked.", selected); + } + + public static FilterEndermenSetting genericVision(Mode selected) { - return new FilterEndermenSetting("Won't attack endermen.", checked); + return new FilterEndermenSetting("When set to \u00a7lOn\u00a7r," + + " endermen won't be shown at all.\n\n" + + "When set to \u00a7lIf calm\u00a7r, endermen won't be shown" + + " until they attack something.\n\n" + + "When set to \u00a7lOff\u00a7r, this filter does nothing and" + + " endermen can be shown.", selected); } - public static FilterEndermenSetting genericVision(boolean checked) + public static FilterEndermenSetting onOffOnly(String description, + boolean onByDefault) { - return new FilterEndermenSetting("Won't show endermen.", checked); + return new FilterEndermenSetting(description, null, onByDefault); } } From 59aea94928f1154a65787bb435c066120373f38d Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 11 Oct 2023 12:29:14 +0200 Subject: [PATCH 23/61] Replace FilterMonstersSetting with FilterHostileSetting --- .../net/wurstclient/hacks/AimAssistHack.java | 2 +- .../wurstclient/hacks/KillauraLegitHack.java | 2 +- .../net/wurstclient/hacks/ProtectHack.java | 2 +- .../java/net/wurstclient/hacks/RadarHack.java | 4 +- .../filterlists/AnchorAuraFilterList.java | 7 ++- .../filterlists/CrystalAuraFilterList.java | 7 ++- .../filterlists/EntityFilterList.java | 2 +- .../filterlists/FollowFilterList.java | 4 +- .../filterlists/MobEspFilterList.java | 2 +- .../filterlists/RemoteViewFilterList.java | 4 +- .../filters/FilterHostileSetting.java | 46 +++++++++++++++++++ .../filters/FilterMonstersSetting.java | 37 --------------- 12 files changed, 63 insertions(+), 56 deletions(-) create mode 100644 src/main/java/net/wurstclient/settings/filters/FilterHostileSetting.java delete mode 100644 src/main/java/net/wurstclient/settings/filters/FilterMonstersSetting.java diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index e71efd2842..92f21ee82a 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -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 diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index 29b8af8c81..438a1560a1 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -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 diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index 01fd7d603d..40f9b44b18 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -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 diff --git a/src/main/java/net/wurstclient/hacks/RadarHack.java b/src/main/java/net/wurstclient/hacks/RadarHack.java index f663a0ff6d..85683869fb 100644 --- a/src/main/java/net/wurstclient/hacks/RadarHack.java +++ b/src/main/java/net/wurstclient/hacks/RadarHack.java @@ -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; @@ -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)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java index fc6539e9bf..dd2c9ad8c6 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java @@ -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," diff --git a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java index 3f91e95164..49f6aeb89e 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java @@ -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," diff --git a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java index 30bfa6d080..b147be6b02 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java @@ -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 diff --git a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java index f1f397ff88..ddab181d27 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -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)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java index 4ecbf1e256..ace3c4d591 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -22,7 +22,7 @@ private MobEspFilterList(List filters) public static MobEspFilterList create() { ArrayList builder = new ArrayList<>(); - builder.add(FilterMonstersSetting.genericVision(false)); + builder.add(FilterHostileSetting.genericVision(false)); builder.add(FilterZombiePiglinsSetting .genericVision(AttackDetectingEntityFilter.Mode.OFF)); builder.add(FilterEndermenSetting diff --git a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java index 74aadf7ab7..02a83ab4a7 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -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)); diff --git a/src/main/java/net/wurstclient/settings/filters/FilterHostileSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterHostileSetting.java new file mode 100644 index 0000000000..c6d44d5cdc --- /dev/null +++ b/src/main/java/net/wurstclient/settings/filters/FilterHostileSetting.java @@ -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); + } +} diff --git a/src/main/java/net/wurstclient/settings/filters/FilterMonstersSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterMonstersSetting.java deleted file mode 100644 index 04c7511bca..0000000000 --- a/src/main/java/net/wurstclient/settings/filters/FilterMonstersSetting.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.Monster; - -public final class FilterMonstersSetting extends EntityFilterCheckbox -{ - public FilterMonstersSetting(String description, boolean checked) - { - super("Filter monsters", description, checked); - } - - @Override - public boolean test(Entity e) - { - return !(e instanceof Monster); - } - - public static FilterMonstersSetting genericCombat(boolean checked) - { - return new FilterMonstersSetting("Won't attack zombies, creepers, etc.", - checked); - } - - public static FilterMonstersSetting genericVision(boolean checked) - { - return new FilterMonstersSetting("Won't show zombies, creepers, etc.", - checked); - } -} From e63806811dd6fb8606ad2e49027bfa514081f0e6 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 11 Oct 2023 17:22:22 +0200 Subject: [PATCH 24/61] Improve baby filter --- .../settings/filters/FilterBabiesSetting.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/wurstclient/settings/filters/FilterBabiesSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterBabiesSetting.java index b37ef49117..98d2bfe192 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterBabiesSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterBabiesSetting.java @@ -9,18 +9,30 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.passive.PassiveEntity; +import net.minecraft.entity.passive.TadpoleEntity; public final class FilterBabiesSetting extends EntityFilterCheckbox { + private static final String EXCEPTIONS_TEXT = "\n\nThis filter does not" + + " affect baby zombies and other hostile baby mobs."; + public FilterBabiesSetting(String description, boolean checked) { - super("Filter babies", description, checked); + super("Filter babies", description + EXCEPTIONS_TEXT, checked); } @Override public boolean test(Entity e) { - return !(e instanceof PassiveEntity && ((PassiveEntity)e).isBaby()); + // filter out passive entity babies + if(e instanceof PassiveEntity pe && pe.isBaby()) + return false; + + // filter out tadpoles + if(e instanceof TadpoleEntity) + return false; + + return true; } public static FilterBabiesSetting genericCombat(boolean checked) From 94af01874ccc9a9d39dfed8a2a953642e5e004ce Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 11 Oct 2023 18:41:52 +0200 Subject: [PATCH 25/61] Separate shulkers from golem filter --- .../net/wurstclient/hacks/AimAssistHack.java | 1 + .../wurstclient/hacks/KillauraLegitHack.java | 1 + .../net/wurstclient/hacks/ProtectHack.java | 1 + .../filterlists/AnchorAuraFilterList.java | 9 ++--- .../filterlists/CrystalAuraFilterList.java | 9 ++--- .../filterlists/EntityFilterList.java | 1 + .../filterlists/FollowFilterList.java | 4 ++- .../filterlists/MobEspFilterList.java | 1 + .../filterlists/RemoteViewFilterList.java | 4 ++- .../settings/filters/FilterGolemsSetting.java | 7 ++-- .../filters/FilterShulkersSetting.java | 35 +++++++++++++++++++ 11 files changed, 60 insertions(+), 13 deletions(-) create mode 100644 src/main/java/net/wurstclient/settings/filters/FilterShulkersSetting.java diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 92f21ee82a..193da0efc8 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -57,6 +57,7 @@ public final class AimAssistHack extends Hack FilterPetsSetting.genericCombat(true), FilterTradersSetting.genericCombat(true), FilterGolemsSetting.genericCombat(false), + FilterShulkersSetting.genericCombat(false), FilterInvisibleSetting.genericCombat(true), FilterNamedSetting.genericCombat(false), FilterShulkerBulletSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index 438a1560a1..8b14bac92a 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -89,6 +89,7 @@ public final class KillauraLegitHack extends Hack FilterPetsSetting.genericCombat(false), FilterTradersSetting.genericCombat(false), FilterGolemsSetting.genericCombat(false), + FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.genericCombat(false), FilterInvisibleSetting.genericCombat(true), FilterNamedSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index 40f9b44b18..a8fd41637e 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -63,6 +63,7 @@ public final class ProtectHack extends Hack FilterPetsSetting.genericCombat(false), FilterTradersSetting.genericCombat(false), FilterGolemsSetting.genericCombat(false), + FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.genericCombat(false), FilterInvisibleSetting.genericCombat(false), FilterNamedSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java index dd2c9ad8c6..7154cdad5c 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java @@ -48,10 +48,11 @@ public static AnchorAuraFilterList create() + damageWarning, true)); - builder.add(new FilterGolemsSetting( - "Won't target iron golems, snow golems and shulkers when auto-placing anchors." - + damageWarning, - true)); + builder.add(new FilterGolemsSetting("Won't target iron golems and snow" + + " golems when auto-placing anchors." + damageWarning, true)); + + builder.add(new FilterShulkersSetting("Won't target shulkers when" + + " auto-placing anchors." + damageWarning, true)); builder.add(new FilterAllaysSetting( "Won't target allays when auto-placing anchors." + damageWarning, diff --git a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java index 49f6aeb89e..7ca14c5dab 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java @@ -48,10 +48,11 @@ public static CrystalAuraFilterList create() + damageWarning, true)); - builder.add(new FilterGolemsSetting( - "Won't target iron golems, snow golems and shulkers when auto-placing crystals." - + damageWarning, - true)); + builder.add(new FilterGolemsSetting("Won't target iron golems and snow" + + " golems when auto-placing crystals." + damageWarning, true)); + + builder.add(new FilterShulkersSetting("Won't target shulkers when" + + " auto-placing crystals." + damageWarning, true)); builder.add(new FilterAllaysSetting( "Won't target allays when auto-placing crystals." + damageWarning, diff --git a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java index b147be6b02..76ce78c444 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java @@ -66,6 +66,7 @@ public static EntityFilterList genericCombat() FilterPetsSetting.genericCombat(false), FilterTradersSetting.genericCombat(false), FilterGolemsSetting.genericCombat(false), + FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.genericCombat(false), FilterInvisibleSetting.genericCombat(false), FilterNamedSetting.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 ddab181d27..ef1490f31d 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -59,7 +59,9 @@ public static FollowFilterList create() "Won't follow villagers, wandering traders, etc.", true)); builder.add(new FilterGolemsSetting( - "Won't follow iron golems, snow golems and shulkers.", true)); + "Won't follow iron golems and snow golems.", true)); + + builder.add(new FilterShulkersSetting("Won't follow shulkers.", true)); builder.add(new FilterAllaysSetting("Won't follow allays.", true)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java index ace3c4d591..799f987c6c 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -32,6 +32,7 @@ public static MobEspFilterList create() builder.add(FilterPetsSetting.genericVision(false)); builder.add(FilterTradersSetting.genericVision(false)); builder.add(FilterGolemsSetting.genericVision(false)); + builder.add(FilterShulkersSetting.genericVision(false)); builder.add(FilterAllaysSetting.genericVision(false)); builder.add(FilterInvisibleSetting.genericVision(false)); builder.add(FilterArmorStandsSetting.genericVision(true)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java index 02a83ab4a7..e39d5445d6 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -59,7 +59,9 @@ public static RemoteViewFilterList create() "Won't view villagers, wandering traders, etc.", true)); builder.add(new FilterGolemsSetting( - "Won't view iron golems, snow golems and shulkers.", true)); + "Won't view iron golems and snow golems.", true)); + + builder.add(new FilterShulkersSetting("Won't view shulkers.", true)); builder.add(new FilterAllaysSetting("Won't view allays.", true)); diff --git a/src/main/java/net/wurstclient/settings/filters/FilterGolemsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterGolemsSetting.java index d2d0c0be74..61dd05d84e 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterGolemsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterGolemsSetting.java @@ -8,6 +8,7 @@ package net.wurstclient.settings.filters; import net.minecraft.entity.Entity; +import net.minecraft.entity.mob.ShulkerEntity; import net.minecraft.entity.passive.GolemEntity; public final class FilterGolemsSetting extends EntityFilterCheckbox @@ -20,18 +21,18 @@ public FilterGolemsSetting(String description, boolean checked) @Override public boolean test(Entity e) { - return !(e instanceof GolemEntity); + return !(e instanceof GolemEntity) || e instanceof ShulkerEntity; } public static FilterGolemsSetting genericCombat(boolean checked) { return new FilterGolemsSetting( - "Won't attack iron golems, snow golems and shulkers.", checked); + "Won't attack iron golems and snow golems.", checked); } public static FilterGolemsSetting genericVision(boolean checked) { return new FilterGolemsSetting( - "Won't show iron golems, snow golems and shulkers.", checked); + "Won't show iron golems and snow golems.", checked); } } diff --git a/src/main/java/net/wurstclient/settings/filters/FilterShulkersSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterShulkersSetting.java new file mode 100644 index 0000000000..a6797d4ad2 --- /dev/null +++ b/src/main/java/net/wurstclient/settings/filters/FilterShulkersSetting.java @@ -0,0 +1,35 @@ +/* + * 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.ShulkerEntity; + +public final class FilterShulkersSetting extends EntityFilterCheckbox +{ + public FilterShulkersSetting(String description, boolean checked) + { + super("Filter shulkers", description, checked); + } + + @Override + public boolean test(Entity e) + { + return !(e instanceof ShulkerEntity); + } + + public static FilterShulkersSetting genericCombat(boolean checked) + { + return new FilterShulkersSetting("Won't attack shulkers.", checked); + } + + public static FilterShulkersSetting genericVision(boolean checked) + { + return new FilterShulkersSetting("Won't show shulkers.", checked); + } +} From 5a8e0232523e8e18c92b8baccf11fbdfb59dfb7d Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 11 Oct 2023 19:45:50 +0200 Subject: [PATCH 26/61] Improve FilterTradersSetting description --- .../settings/filterlists/AnchorAuraFilterList.java | 5 ++--- .../settings/filterlists/CrystalAuraFilterList.java | 5 ++--- .../wurstclient/settings/filterlists/FollowFilterList.java | 2 +- .../settings/filterlists/RemoteViewFilterList.java | 2 +- .../wurstclient/settings/filters/FilterTradersSetting.java | 4 ++-- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java index 7154cdad5c..3859cdea1a 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java @@ -43,9 +43,8 @@ public static AnchorAuraFilterList create() + " \"ambient\" mobs when auto-placing anchors." + damageWarning, true)); - builder.add(new FilterTradersSetting( - "Won't target villagers, wandering traders, etc. when auto-placing anchors." - + damageWarning, + builder.add(new FilterTradersSetting("Won't target villagers and" + + " wandering traders when auto-placing anchors." + damageWarning, true)); builder.add(new FilterGolemsSetting("Won't target iron golems and snow" diff --git a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java index 7ca14c5dab..9e46b0723c 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java @@ -43,9 +43,8 @@ public static CrystalAuraFilterList create() + " \"ambient\" mobs when auto-placing crystals." + damageWarning, true)); - builder.add(new FilterTradersSetting( - "Won't target villagers, wandering traders, etc. when auto-placing crystals." - + damageWarning, + builder.add(new FilterTradersSetting("Won't target villagers and" + + " wandering traders when auto-placing crystals." + damageWarning, true)); builder.add(new FilterGolemsSetting("Won't target iron golems and snow" diff --git a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java index ef1490f31d..47dabe81d4 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -56,7 +56,7 @@ public static FollowFilterList create() "Won't follow tamed wolves, tamed horses, etc.", true)); builder.add(new FilterTradersSetting( - "Won't follow villagers, wandering traders, etc.", true)); + "Won't follow villagers and wandering traders.", true)); builder.add(new FilterGolemsSetting( "Won't follow iron golems and snow golems.", true)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java index e39d5445d6..dee683b21d 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -56,7 +56,7 @@ public static RemoteViewFilterList create() "Won't view tamed wolves, tamed horses, etc.", true)); builder.add(new FilterTradersSetting( - "Won't view villagers, wandering traders, etc.", true)); + "Won't view villagers and wandering traders.", true)); builder.add(new FilterGolemsSetting( "Won't view iron golems and snow golems.", true)); diff --git a/src/main/java/net/wurstclient/settings/filters/FilterTradersSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterTradersSetting.java index 5c7b07cca0..19d061bc89 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterTradersSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterTradersSetting.java @@ -26,12 +26,12 @@ public boolean test(Entity e) public static FilterTradersSetting genericCombat(boolean checked) { return new FilterTradersSetting( - "Won't attack villagers, wandering traders, etc.", checked); + "Won't attack villagers and wandering traders.", checked); } public static FilterTradersSetting genericVision(boolean checked) { return new FilterTradersSetting( - "Won't show villagers, wandering traders, etc.", checked); + "Won't show villagers and wandering traders.", checked); } } From 1327c46c9ea6db9a50e1c9a19bdc5a4c7bc9e644 Mon Sep 17 00:00:00 2001 From: Tejas Lamba <73745640+TejasLamba2006@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:36:42 +0530 Subject: [PATCH 27/61] Delete src/main/java/net/wurstclient/hacks/AimAssistHack.java --- .../net/wurstclient/hacks/AimAssistHack.java | 166 ------------------ 1 file changed, 166 deletions(-) delete mode 100644 src/main/java/net/wurstclient/hacks/AimAssistHack.java diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java deleted file mode 100644 index 3a60c7b17f..0000000000 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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.hacks; - -import java.util.Comparator; -import java.util.stream.Stream; - -import net.minecraft.client.gui.screen.ingame.HandledScreen; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.Entity; -import net.minecraft.util.math.Box; -import net.minecraft.util.math.MathHelper; -import net.wurstclient.Category; -import net.wurstclient.events.RenderListener; -import net.wurstclient.events.UpdateListener; -import net.wurstclient.hack.Hack; -import net.wurstclient.settings.SliderSetting; -import net.wurstclient.settings.SliderSetting.ValueDisplay; -import net.wurstclient.settings.filterlists.EntityFilterList; -import net.wurstclient.settings.filters.*; -import net.wurstclient.util.EntityUtils; -import net.wurstclient.util.RotationUtils; -import net.wurstclient.util.RotationUtils.Rotation; - -public final class AimAssistHack extends Hack - implements UpdateListener, RenderListener -{ - private final SliderSetting range = - new SliderSetting("Range", 4.5, 1, 6, 0.05, ValueDisplay.DECIMAL); - - private final SliderSetting rotationSpeed = - new SliderSetting("Rotation Speed", 600, 10, 3600, 10, - ValueDisplay.DEGREES.withSuffix("/s")); - - private final SliderSetting fov = new SliderSetting("FOV", - "Field Of View - how far away from your crosshair an entity can be before it's ignored.\n" - + "360\u00b0 = aims at entities all around you.", - 120, 30, 360, 10, ValueDisplay.DEGREES); - - private final EntityFilterList entityFilters = - new EntityFilterList(FilterPlayersSetting.genericCombat(false), - FilterSleepingSetting.genericCombat(false), - FilterFlyingSetting.genericCombat(0), - FilterMonstersSetting.genericCombat(false), - FilterPigmenSetting.genericCombat(false), - FilterEndermenSetting.genericCombat(false), - FilterAnimalsSetting.genericCombat(true), - FilterBabiesSetting.genericCombat(true), - FilterPetsSetting.genericCombat(true), - FilterTradersSetting.genericCombat(true), - FilterGolemsSetting.genericCombat(false), - FilterInvisibleSetting.genericCombat(true), - FilterNamedSetting.genericCombat(false), - FilterShulkerBulletSetting.genericCombat(false), - FilterArmorStandsSetting.genericCombat(true), - FilterCrystalsSetting.genericCombat(true)); - - private Entity target; - private float nextYaw; - private float nextPitch; - - public AimAssistHack() - { - super("AimAssist"); - setCategory(Category.COMBAT); - - addSetting(range); - addSetting(rotationSpeed); - addSetting(fov); - - entityFilters.forEach(this::addSetting); - } - - @Override - protected void onEnable() - { - // disable other killauras - WURST.getHax().clickAuraHack.setEnabled(false); - WURST.getHax().crystalAuraHack.setEnabled(false); - WURST.getHax().fightBotHack.setEnabled(false); - WURST.getHax().killauraHack.setEnabled(false); - WURST.getHax().killauraLegitHack.setEnabled(false); - WURST.getHax().multiAuraHack.setEnabled(false); - WURST.getHax().protectHack.setEnabled(false); - WURST.getHax().triggerBotHack.setEnabled(false); - WURST.getHax().tpAuraHack.setEnabled(false); - - EVENTS.add(UpdateListener.class, this); - EVENTS.add(RenderListener.class, this); - } - - @Override - protected void onDisable() - { - EVENTS.remove(UpdateListener.class, this); - EVENTS.remove(RenderListener.class, this); - target = null; - } - - @Override - public void onUpdate() - { - // don't aim when a container/inventory screen is open - if(MC.currentScreen instanceof HandledScreen) - return; - - Stream stream = EntityUtils.getAttackableEntities(); - double rangeSq = Math.pow(range.getValue(), 2); - stream = stream.filter(e -> MC.player.squaredDistanceTo(e) <= rangeSq); - - if(fov.getValue() < 360.0) - stream = stream.filter(e -> RotationUtils.getAngleToLookVec( - e.getBoundingBox().getCenter()) <= fov.getValue() / 2.0); - - stream = entityFilters.applyTo(stream); - - target = stream - .min(Comparator.comparingDouble(e -> RotationUtils - .getAngleToLookVec(e.getBoundingBox().getCenter()))) - .orElse(null); - if(target == null) - return; - - WURST.getHax().autoSwordHack.setSlot(); - faceEntityClient(target); - } - - private boolean faceEntityClient(Entity entity) - { - // get needed rotation - Box box = entity.getBoundingBox(); - Rotation needed = RotationUtils.getNeededRotations(box.getCenter()); - - // turn towards center of boundingBox - Rotation next = RotationUtils.slowlyTurnTowards(needed, - rotationSpeed.getValueI() / 20F); - nextYaw = next.getYaw(); - nextPitch = next.getPitch(); - - // check if facing center - if(RotationUtils.isAlreadyFacing(needed)) - return true; - - // if not facing center, check if facing anything in boundingBox - return RotationUtils.isFacingBox(box, range.getValue()); - } - - @Override - public void onRender(MatrixStack matrixStack, float partialTicks) - { - if(target == null) - return; - - // Not actually rendering anything, just using this method to rotate - // more smoothly. - float oldYaw = MC.player.prevYaw; - float oldPitch = MC.player.prevPitch; - MC.player.setYaw(MathHelper.lerp(partialTicks, oldYaw, nextYaw)); - MC.player.setPitch(MathHelper.lerp(partialTicks, oldPitch, nextPitch)); - } -} From 47dd56161b9d85916a205e0caff664ad11fa2634 Mon Sep 17 00:00:00 2001 From: Tejas Lamba <73745640+TejasLamba2006@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:37:07 +0530 Subject: [PATCH 28/61] Delete src/main/java/net/wurstclient/hacks/AutoSwordHack.java --- .../net/wurstclient/hacks/AutoSwordHack.java | 194 ------------------ 1 file changed, 194 deletions(-) delete mode 100644 src/main/java/net/wurstclient/hacks/AutoSwordHack.java diff --git a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java deleted file mode 100644 index b327a8dfe2..0000000000 --- a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * 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.hacks; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.LivingEntity; -import net.minecraft.item.Item; -import net.minecraft.item.MiningToolItem; -import net.minecraft.item.SwordItem; -import net.minecraft.item.ToolItem; -import net.minecraft.util.hit.EntityHitResult; -import net.minecraft.util.hit.HitResult; -import net.wurstclient.Category; -import net.wurstclient.SearchTags; -import net.wurstclient.events.UpdateListener; -import net.wurstclient.hack.Hack; -import net.wurstclient.settings.CheckboxSetting; -import net.wurstclient.settings.EnumSetting; -import net.wurstclient.settings.SliderSetting; -import net.wurstclient.settings.SliderSetting.ValueDisplay; -import net.wurstclient.util.ItemUtils; - -@SearchTags({"auto sword"}) -public final class AutoSwordHack extends Hack implements UpdateListener -{ - private final EnumSetting priority = - new EnumSetting<>("Priority", Priority.values(), Priority.SPEED); - - private final CheckboxSetting switchBack = new CheckboxSetting( - "Switch back", - "Switches back to the previously selected slot after \u00a7lRelease time\u00a7r has passed.", - true); - - private final SliderSetting releaseTime = new SliderSetting("Release time", - "Time until AutoSword will switch back from the weapon to the previously selected slot.\n\n" - + "Only works when \u00a7lSwitch back\u00a7r is checked.", - 10, 1, 200, 1, ValueDisplay.INTEGER.withSuffix(" ticks")); - - private int oldSlot; - private int timer; - - public AutoSwordHack() - { - super("AutoSword"); - setCategory(Category.COMBAT); - - addSetting(priority); - addSetting(switchBack); - addSetting(releaseTime); - } - - @Override - public void onEnable() - { - oldSlot = -1; - EVENTS.add(UpdateListener.class, this); - } - - @Override - public void onDisable() - { - EVENTS.remove(UpdateListener.class, this); - resetSlot(); - } - - @Override - public void onUpdate() - { - if(MC.crosshairTarget != null - && MC.crosshairTarget.getType() == HitResult.Type.ENTITY) - { - Entity entity = ((EntityHitResult)MC.crosshairTarget).getEntity(); - - if(entity instanceof LivingEntity - && ((LivingEntity)entity).getHealth() > 0) - setSlot(); - } - - // update timer - if(timer > 0) - { - timer--; - return; - } - - resetSlot(); - } - - public void setSlot() - { - // check if active - if(!isEnabled()) - return; - - // wait for AutoEat - if(WURST.getHax().autoEatHack.isEating()) - return; - - // find best weapon - float bestValue = Integer.MIN_VALUE; - int bestSlot = -1; - for(int i = 0; i < 9; i++) - { - // skip empty slots - if(MC.player.getInventory().getStack(i).isEmpty()) - continue; - - Item item = MC.player.getInventory().getStack(i).getItem(); - - // get damage - float value = getValue(item); - - // compare with previous best weapon - if(value > bestValue) - { - bestValue = value; - bestSlot = i; - } - } - - // check if any weapon was found - if(bestSlot == -1) - return; - - // save old slot - if(oldSlot == -1) - oldSlot = MC.player.getInventory().selectedSlot; - - // set slot - MC.player.getInventory().selectedSlot = bestSlot; - - // start timer - timer = releaseTime.getValueI(); - } - - private float getValue(Item item) - { - switch(priority.getSelected()) - { - case SPEED: - if(item instanceof ToolItem tool) - return ItemUtils.getAttackSpeed(tool); - break; - - case DAMAGE: - if(item instanceof SwordItem sword) - return sword.getAttackDamage(); - if(item instanceof MiningToolItem miningTool) - return miningTool.getAttackDamage(); - break; - } - - return Integer.MIN_VALUE; - } - - private void resetSlot() - { - if(!switchBack.isChecked()) - { - oldSlot = -1; - return; - } - - if(oldSlot != -1) - { - MC.player.getInventory().selectedSlot = oldSlot; - oldSlot = -1; - } - } - - private enum Priority - { - SPEED("Speed (swords)"), - DAMAGE("Damage (axes)"); - - private final String name; - - private Priority(String name) - { - this.name = name; - } - - @Override - public String toString() - { - return name; - } - } -} From ac30c73bd872f62dbe6c19e14b63f9fef73be27d Mon Sep 17 00:00:00 2001 From: Tejas Lamba <73745640+TejasLamba2006@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:37:26 +0530 Subject: [PATCH 29/61] Delete src/main/java/net/wurstclient/hacks/TriggerBotHack.java --- .../net/wurstclient/hacks/TriggerBotHack.java | 123 ------------------ 1 file changed, 123 deletions(-) delete mode 100644 src/main/java/net/wurstclient/hacks/TriggerBotHack.java diff --git a/src/main/java/net/wurstclient/hacks/TriggerBotHack.java b/src/main/java/net/wurstclient/hacks/TriggerBotHack.java deleted file mode 100644 index 593bf149c7..0000000000 --- a/src/main/java/net/wurstclient/hacks/TriggerBotHack.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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.hacks; - -import java.util.stream.Stream; - -import net.minecraft.client.gui.screen.ingame.HandledScreen; -import net.minecraft.client.network.ClientPlayerEntity; -import net.minecraft.entity.Entity; -import net.minecraft.util.Hand; -import net.minecraft.util.hit.EntityHitResult; -import net.wurstclient.Category; -import net.wurstclient.SearchTags; -import net.wurstclient.events.UpdateListener; -import net.wurstclient.hack.Hack; -import net.wurstclient.settings.AttackSpeedSliderSetting; -import net.wurstclient.settings.CheckboxSetting; -import net.wurstclient.settings.SliderSetting; -import net.wurstclient.settings.SliderSetting.ValueDisplay; -import net.wurstclient.settings.filterlists.EntityFilterList; -import net.wurstclient.util.EntityUtils; - -@SearchTags({"trigger bot"}) -public final class TriggerBotHack extends Hack implements UpdateListener -{ - private final SliderSetting range = - new SliderSetting("Range", 4.25, 1, 6, 0.05, ValueDisplay.DECIMAL); - - private final AttackSpeedSliderSetting speed = - new AttackSpeedSliderSetting(); - - private final CheckboxSetting attackWhileBlocking = new CheckboxSetting( - "Attack while blocking", - "Whether or not to attack while blocking with a shield / using items.", - false); - - private final EntityFilterList entityFilters = - EntityFilterList.genericCombat(); - - public TriggerBotHack() - { - super("TriggerBot"); - setCategory(Category.COMBAT); - - addSetting(range); - addSetting(speed); - addSetting(attackWhileBlocking); - - entityFilters.forEach(this::addSetting); - } - - @Override - public void onEnable() - { - // disable other killauras - WURST.getHax().clickAuraHack.setEnabled(false); - WURST.getHax().crystalAuraHack.setEnabled(false); - WURST.getHax().fightBotHack.setEnabled(false); - WURST.getHax().killauraLegitHack.setEnabled(false); - WURST.getHax().killauraHack.setEnabled(false); - WURST.getHax().multiAuraHack.setEnabled(false); - WURST.getHax().protectHack.setEnabled(false); - WURST.getHax().tpAuraHack.setEnabled(false); - - speed.resetTimer(); - EVENTS.add(UpdateListener.class, this); - } - - @Override - public void onDisable() - { - EVENTS.remove(UpdateListener.class, this); - } - - @Override - public void onUpdate() - { - speed.updateTimer(); - if(!speed.isTimeToAttack()) - return; - - // don't attack when a container/inventory screen is open - if(MC.currentScreen instanceof HandledScreen) - return; - - ClientPlayerEntity player = MC.player; - if(player.isUsingItem() && !attackWhileBlocking.isChecked()) - return; - - if(MC.crosshairTarget == null - || !(MC.crosshairTarget instanceof EntityHitResult)) - return; - - Entity target = ((EntityHitResult)MC.crosshairTarget).getEntity(); - if(!isCorrectEntity(target)) - return; - - WURST.getHax().autoSwordHack.setSlot(); - - WURST.getHax().criticalsHack.doCritical(); - MC.interactionManager.attackEntity(player, target); - player.swingHand(Hand.MAIN_HAND); - speed.resetTimer(); - } - - private boolean isCorrectEntity(Entity entity) - { - Stream stream = Stream.of(entity); - stream = stream.filter(EntityUtils.IS_ATTACKABLE); - - double rangeSq = Math.pow(range.getValue(), 2); - stream = stream.filter(e -> MC.player.squaredDistanceTo(e) <= rangeSq); - - stream = entityFilters.applyTo(stream); - - return stream.findFirst().isPresent(); - } -} From f2890c267b2935d7648297f6310643d50d100b3c Mon Sep 17 00:00:00 2001 From: Tejas Lamba <73745640+TejasLamba2006@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:38:55 +0530 Subject: [PATCH 30/61] Add files via upload --- .../net/wurstclient/hacks/AimAssistHack.java | 188 ++++++++++++++++++ .../net/wurstclient/hacks/TriggerBotHack.java | 123 ++++++++++++ 2 files changed, 311 insertions(+) create mode 100644 src/main/java/net/wurstclient/hacks/AimAssistHack.java create mode 100644 src/main/java/net/wurstclient/hacks/TriggerBotHack.java diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java new file mode 100644 index 0000000000..36218d0537 --- /dev/null +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -0,0 +1,188 @@ +/* + * 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.hacks; + +import java.util.Comparator; +import java.util.stream.Stream; + +import net.minecraft.client.gui.screen.ingame.HandledScreen; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.entity.Entity; +import net.minecraft.util.hit.HitResult; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; +import net.wurstclient.Category; +import net.minecraft.world.RaycastContext; +import net.wurstclient.events.RenderListener; +import net.wurstclient.events.UpdateListener; +import net.wurstclient.hack.Hack; +import net.wurstclient.settings.CheckboxSetting; +import net.wurstclient.settings.SliderSetting; +import net.wurstclient.settings.SliderSetting.ValueDisplay; +import net.wurstclient.settings.filterlists.EntityFilterList; +import net.wurstclient.settings.filters.*; +import net.wurstclient.util.EntityUtils; +import net.wurstclient.util.RotationUtils; +import net.wurstclient.util.RotationUtils.Rotation; + +public final class AimAssistHack extends Hack + implements UpdateListener, RenderListener +{ + private final SliderSetting range = + new SliderSetting("Range", 4.5, 1, 6, 0.05, ValueDisplay.DECIMAL); + + private final SliderSetting rotationSpeed = + new SliderSetting("Rotation Speed", 600, 10, 3600, 10, + ValueDisplay.DEGREES.withSuffix("/s")); + + private final SliderSetting fov = new SliderSetting("FOV", + "Field Of View - how far away from your crosshair an entity can be before it's ignored.\n" + + "360\u00b0 = aims at entities all around you.", + 120, 30, 360, 10, ValueDisplay.DEGREES); + + private final CheckboxSetting checkLOS = + new CheckboxSetting("Check line of sight", + "Ensures that you don't reach through blocks when attacking.\n\n" + + "Slower but can help with anti-cheat plugins.", + false); + + private final EntityFilterList entityFilters = + new EntityFilterList(FilterPlayersSetting.genericCombat(false), + FilterSleepingSetting.genericCombat(false), + FilterFlyingSetting.genericCombat(0), + FilterMonstersSetting.genericCombat(false), + FilterPigmenSetting.genericCombat(false), + FilterEndermenSetting.genericCombat(false), + FilterAnimalsSetting.genericCombat(true), + FilterBabiesSetting.genericCombat(true), + FilterPetsSetting.genericCombat(true), + FilterTradersSetting.genericCombat(true), + FilterGolemsSetting.genericCombat(false), + FilterInvisibleSetting.genericCombat(true), + FilterNamedSetting.genericCombat(false), + FilterShulkerBulletSetting.genericCombat(false), + FilterArmorStandsSetting.genericCombat(true), + FilterCrystalsSetting.genericCombat(true)); + + private Entity target; + private float nextYaw; + private float nextPitch; + + public AimAssistHack() + { + super("AimAssist"); + setCategory(Category.COMBAT); + + addSetting(range); + addSetting(rotationSpeed); + addSetting(fov); + addSetting(checkLOS); + + entityFilters.forEach(this::addSetting); + } + + @Override + protected void onEnable() + { + // disable other killauras + WURST.getHax().clickAuraHack.setEnabled(false); + WURST.getHax().crystalAuraHack.setEnabled(false); + WURST.getHax().fightBotHack.setEnabled(false); + WURST.getHax().killauraHack.setEnabled(false); + WURST.getHax().killauraLegitHack.setEnabled(false); + WURST.getHax().multiAuraHack.setEnabled(false); + WURST.getHax().protectHack.setEnabled(false); + WURST.getHax().tpAuraHack.setEnabled(false); + + EVENTS.add(UpdateListener.class, this); + EVENTS.add(RenderListener.class, this); + } + + @Override + protected void onDisable() + { + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(RenderListener.class, this); + target = null; + } + + @Override + public void onUpdate() + { + // don't aim when a container/inventory screen is open + if(MC.currentScreen instanceof HandledScreen) + return; + + Stream stream = EntityUtils.getAttackableEntities(); + double rangeSq = Math.pow(range.getValue(), 2); + stream = stream.filter(e -> MC.player.squaredDistanceTo(e) <= rangeSq); + + if(fov.getValue() < 360.0) + stream = stream.filter(e -> RotationUtils.getAngleToLookVec( + e.getBoundingBox().getCenter()) <= fov.getValue() / 2.0); + + stream = entityFilters.applyTo(stream); + + target = stream + .min(Comparator.comparingDouble(e -> RotationUtils + .getAngleToLookVec(e.getBoundingBox().getCenter()))) + .orElse(null); + if(target == null) + return; + + + Vec3d eyesPos = RotationUtils.getEyesPos(); + Vec3d hitVec = target.getBoundingBox().getCenter(); + if(checkLOS.isChecked() && MC.world + .raycast(new RaycastContext(eyesPos, hitVec, + RaycastContext.ShapeType.COLLIDER, + RaycastContext.FluidHandling.NONE, MC.player)) + .getType() != HitResult.Type.MISS) + { + target = null; + return; + } + WURST.getHax().autoSwordHack.setSlot(); + faceEntityClient(target); + } + + private boolean faceEntityClient(Entity entity) + { + // get needed rotation + Box box = entity.getBoundingBox(); + Rotation needed = RotationUtils.getNeededRotations(box.getCenter()); + + // turn towards center of boundingBox + Rotation next = RotationUtils.slowlyTurnTowards(needed, + rotationSpeed.getValueI() / 20F); + nextYaw = next.getYaw(); + nextPitch = next.getPitch(); + + // check if facing center + if(RotationUtils.isAlreadyFacing(needed)) + return true; + + // if not facing center, check if facing anything in boundingBox + return RotationUtils.isFacingBox(box, range.getValue()); + } + + @Override + public void onRender(MatrixStack matrixStack, float partialTicks) + { + if(target == null) + return; + + // Not actually rendering anything, just using this method to rotate + // more smoothly. + float oldYaw = MC.player.prevYaw; + float oldPitch = MC.player.prevPitch; + MC.player.setYaw(MathHelper.lerp(partialTicks, oldYaw, nextYaw)); + MC.player.setPitch(MathHelper.lerp(partialTicks, oldPitch, nextPitch)); + } +} diff --git a/src/main/java/net/wurstclient/hacks/TriggerBotHack.java b/src/main/java/net/wurstclient/hacks/TriggerBotHack.java new file mode 100644 index 0000000000..593bf149c7 --- /dev/null +++ b/src/main/java/net/wurstclient/hacks/TriggerBotHack.java @@ -0,0 +1,123 @@ +/* + * 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.hacks; + +import java.util.stream.Stream; + +import net.minecraft.client.gui.screen.ingame.HandledScreen; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.entity.Entity; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.EntityHitResult; +import net.wurstclient.Category; +import net.wurstclient.SearchTags; +import net.wurstclient.events.UpdateListener; +import net.wurstclient.hack.Hack; +import net.wurstclient.settings.AttackSpeedSliderSetting; +import net.wurstclient.settings.CheckboxSetting; +import net.wurstclient.settings.SliderSetting; +import net.wurstclient.settings.SliderSetting.ValueDisplay; +import net.wurstclient.settings.filterlists.EntityFilterList; +import net.wurstclient.util.EntityUtils; + +@SearchTags({"trigger bot"}) +public final class TriggerBotHack extends Hack implements UpdateListener +{ + private final SliderSetting range = + new SliderSetting("Range", 4.25, 1, 6, 0.05, ValueDisplay.DECIMAL); + + private final AttackSpeedSliderSetting speed = + new AttackSpeedSliderSetting(); + + private final CheckboxSetting attackWhileBlocking = new CheckboxSetting( + "Attack while blocking", + "Whether or not to attack while blocking with a shield / using items.", + false); + + private final EntityFilterList entityFilters = + EntityFilterList.genericCombat(); + + public TriggerBotHack() + { + super("TriggerBot"); + setCategory(Category.COMBAT); + + addSetting(range); + addSetting(speed); + addSetting(attackWhileBlocking); + + entityFilters.forEach(this::addSetting); + } + + @Override + public void onEnable() + { + // disable other killauras + WURST.getHax().clickAuraHack.setEnabled(false); + WURST.getHax().crystalAuraHack.setEnabled(false); + WURST.getHax().fightBotHack.setEnabled(false); + WURST.getHax().killauraLegitHack.setEnabled(false); + WURST.getHax().killauraHack.setEnabled(false); + WURST.getHax().multiAuraHack.setEnabled(false); + WURST.getHax().protectHack.setEnabled(false); + WURST.getHax().tpAuraHack.setEnabled(false); + + speed.resetTimer(); + EVENTS.add(UpdateListener.class, this); + } + + @Override + public void onDisable() + { + EVENTS.remove(UpdateListener.class, this); + } + + @Override + public void onUpdate() + { + speed.updateTimer(); + if(!speed.isTimeToAttack()) + return; + + // don't attack when a container/inventory screen is open + if(MC.currentScreen instanceof HandledScreen) + return; + + ClientPlayerEntity player = MC.player; + if(player.isUsingItem() && !attackWhileBlocking.isChecked()) + return; + + if(MC.crosshairTarget == null + || !(MC.crosshairTarget instanceof EntityHitResult)) + return; + + Entity target = ((EntityHitResult)MC.crosshairTarget).getEntity(); + if(!isCorrectEntity(target)) + return; + + WURST.getHax().autoSwordHack.setSlot(); + + WURST.getHax().criticalsHack.doCritical(); + MC.interactionManager.attackEntity(player, target); + player.swingHand(Hand.MAIN_HAND); + speed.resetTimer(); + } + + private boolean isCorrectEntity(Entity entity) + { + Stream stream = Stream.of(entity); + stream = stream.filter(EntityUtils.IS_ATTACKABLE); + + double rangeSq = Math.pow(range.getValue(), 2); + stream = stream.filter(e -> MC.player.squaredDistanceTo(e) <= rangeSq); + + stream = entityFilters.applyTo(stream); + + return stream.findFirst().isPresent(); + } +} From dba47c8e367f6d7464bf644904eb201d2c1cbd82 Mon Sep 17 00:00:00 2001 From: Tejas Lamba <73745640+TejasLamba2006@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:42:39 +0530 Subject: [PATCH 31/61] Add files via upload --- .../net/wurstclient/hacks/AutoSwordHack.java | 208 ++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 src/main/java/net/wurstclient/hacks/AutoSwordHack.java diff --git a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java new file mode 100644 index 0000000000..fe3eaf9c91 --- /dev/null +++ b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java @@ -0,0 +1,208 @@ +/* + * 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.hacks; + +import java.util.stream.Stream; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.item.Item; +import net.minecraft.item.MiningToolItem; +import net.minecraft.item.SwordItem; +import net.minecraft.item.ToolItem; +import net.minecraft.util.hit.EntityHitResult; +import net.minecraft.util.hit.HitResult; +import net.wurstclient.Category; +import net.wurstclient.SearchTags; +import net.wurstclient.events.UpdateListener; +import net.wurstclient.hack.Hack; +import net.wurstclient.settings.CheckboxSetting; +import net.wurstclient.settings.EnumSetting; +import net.wurstclient.settings.SliderSetting; +import net.wurstclient.settings.SliderSetting.ValueDisplay; +import net.wurstclient.util.ItemUtils; +import net.wurstclient.util.EntityUtils; + +@SearchTags({"auto sword"}) +public final class AutoSwordHack extends Hack implements UpdateListener +{ + private final EnumSetting priority = + new EnumSetting<>("Priority", Priority.values(), Priority.SPEED); + + private final CheckboxSetting switchBack = new CheckboxSetting( + "Switch back", + "Switches back to the previously selected slot after \u00a7lRelease time\u00a7r has passed.", + true); + + private final SliderSetting releaseTime = new SliderSetting("Release time", + "Time until AutoSword will switch back from the weapon to the previously selected slot.\n\n" + + "Only works when \u00a7lSwitch back\u00a7r is checked.", + 10, 1, 200, 1, ValueDisplay.INTEGER.withSuffix(" ticks")); + + private int oldSlot; + private int timer; + + public AutoSwordHack() + { + super("AutoSword"); + setCategory(Category.COMBAT); + + addSetting(priority); + addSetting(switchBack); + addSetting(releaseTime); + } + + @Override + public void onEnable() + { + oldSlot = -1; + EVENTS.add(UpdateListener.class, this); + } + + @Override + public void onDisable() + { + EVENTS.remove(UpdateListener.class, this); + resetSlot(); + } + + @Override + public void onUpdate() + { + if(MC.crosshairTarget != null + && MC.crosshairTarget.getType() == HitResult.Type.ENTITY) + { + Entity entity = ((EntityHitResult)MC.crosshairTarget).getEntity(); + //check if entity is correct + if(!isCorrectEntity(entity)) + return; + + if(entity instanceof LivingEntity + && ((LivingEntity)entity).getHealth() > 0) + setSlot(); + } + + // update timer + if(timer > 0) + { + timer--; + return; + } + + resetSlot(); + } + + public void setSlot() + { + // check if active + if(!isEnabled()) + return; + + // wait for AutoEat + if(WURST.getHax().autoEatHack.isEating()) + return; + + // find best weapon + float bestValue = Integer.MIN_VALUE; + int bestSlot = -1; + for(int i = 0; i < 9; i++) + { + // skip empty slots + if(MC.player.getInventory().getStack(i).isEmpty()) + continue; + + Item item = MC.player.getInventory().getStack(i).getItem(); + + // get damage + float value = getValue(item); + + // compare with previous best weapon + if(value > bestValue) + { + bestValue = value; + bestSlot = i; + } + } + + // check if any weapon was found + if(bestSlot == -1) + return; + + // save old slot + if(oldSlot == -1) + oldSlot = MC.player.getInventory().selectedSlot; + + // set slot + MC.player.getInventory().selectedSlot = bestSlot; + + // start timer + timer = releaseTime.getValueI(); + } + + private float getValue(Item item) + { + switch(priority.getSelected()) + { + case SPEED: + if(item instanceof ToolItem tool) + return ItemUtils.getAttackSpeed(tool); + break; + + case DAMAGE: + if(item instanceof SwordItem sword) + return sword.getAttackDamage(); + if(item instanceof MiningToolItem miningTool) + return miningTool.getAttackDamage(); + break; + } + + return Integer.MIN_VALUE; + } + + private void resetSlot() + { + if(!switchBack.isChecked()) + { + oldSlot = -1; + return; + } + + if(oldSlot != -1) + { + MC.player.getInventory().selectedSlot = oldSlot; + oldSlot = -1; + } + } + + private enum Priority + { + SPEED("Speed (swords)"), + DAMAGE("Damage (axes)"); + + private final String name; + + private Priority(String name) + { + this.name = name; + } + + @Override + public String toString() + { + return name; + } + } + private boolean isCorrectEntity(Entity entity) + { + Stream stream = Stream.of(entity); + stream = stream.filter(EntityUtils.IS_ATTACKABLE); + + return stream.findFirst().isPresent(); + } +} + From e1b41a47f544e4a4284ea6ff7d928da27f8c053d Mon Sep 17 00:00:00 2001 From: Tejas Lamba <73745640+TejasLamba2006@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:54:29 +0530 Subject: [PATCH 32/61] Update AutoSwordHack.java --- src/main/java/net/wurstclient/hacks/AutoSwordHack.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java index fe3eaf9c91..a66c40cd78 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java @@ -199,10 +199,10 @@ public String toString() } private boolean isCorrectEntity(Entity entity) { - Stream stream = Stream.of(entity); + try (Stream stream = Stream.of(entity)) { stream = stream.filter(EntityUtils.IS_ATTACKABLE); - return stream.findFirst().isPresent(); + } } } From 257ff9aea7d983479510687f0bf19b17bc91343f Mon Sep 17 00:00:00 2001 From: Tejas Lamba <73745640+TejasLamba2006@users.noreply.github.com> Date: Thu, 12 Oct 2023 22:55:59 +0530 Subject: [PATCH 33/61] Update AutoSwordHack.java --- .../net/wurstclient/hacks/AutoSwordHack.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java index a66c40cd78..b327a8dfe2 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java @@ -7,8 +7,6 @@ */ package net.wurstclient.hacks; -import java.util.stream.Stream; - import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.item.Item; @@ -26,7 +24,6 @@ import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; import net.wurstclient.util.ItemUtils; -import net.wurstclient.util.EntityUtils; @SearchTags({"auto sword"}) public final class AutoSwordHack extends Hack implements UpdateListener @@ -78,10 +75,7 @@ public void onUpdate() && MC.crosshairTarget.getType() == HitResult.Type.ENTITY) { Entity entity = ((EntityHitResult)MC.crosshairTarget).getEntity(); - //check if entity is correct - if(!isCorrectEntity(entity)) - return; - + if(entity instanceof LivingEntity && ((LivingEntity)entity).getHealth() > 0) setSlot(); @@ -197,12 +191,4 @@ public String toString() return name; } } - private boolean isCorrectEntity(Entity entity) - { - try (Stream stream = Stream.of(entity)) { - stream = stream.filter(EntityUtils.IS_ATTACKABLE); - return stream.findFirst().isPresent(); - } - } } - From f5ea55dc092bbb010ece0bd68298ba21ec00c0e5 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 13 Oct 2023 12:18:04 +0200 Subject: [PATCH 34/61] Make VirusTotal scan only run on push There is a permission issue that causes this step to always fail on pull requests. --- .github/workflows/gradle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index e53160eaac..42e26139a4 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -34,6 +34,7 @@ jobs: - name: Execute Gradle build run: ./gradlew build - name: VirusTotal scan + if: github.event_name == 'push' uses: crazy-max/ghaction-virustotal@v4 with: vt_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }} From fd3da83a55ef0c4419a5c84ade109cae83ec94be Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 13 Oct 2023 14:34:24 +0200 Subject: [PATCH 35/61] Rename file to stale.yml --- .github/{actions/stale.yaml => workflows/stale.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{actions/stale.yaml => workflows/stale.yml} (100%) diff --git a/.github/actions/stale.yaml b/.github/workflows/stale.yml similarity index 100% rename from .github/actions/stale.yaml rename to .github/workflows/stale.yml From 6c62dbb601b9f5e8d4ae22ae06fc97b94b83ebcb Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 13 Oct 2023 14:34:59 +0200 Subject: [PATCH 36/61] Close 7 days after stale --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 1bd15cadfa..17e9cb3803 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -17,4 +17,4 @@ jobs: - They are no longer relevant - There are not enough details days-before-stale: 60 - days-before-close: 30 + days-before-close: 7 From 122af2990bbae1066e5b9ada381adfee575debb8 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 13 Oct 2023 14:35:51 +0200 Subject: [PATCH 37/61] Add custom stale label --- .github/workflows/stale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 17e9cb3803..12a88e7cb8 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -18,3 +18,5 @@ jobs: - There are not enough details days-before-stale: 60 days-before-close: 7 + stale-issue-label: "status:stale" + stale-pr-label: "status:stale" From 33836f08093a8920bf77e2a021ec0a493c9c3a4d Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 13 Oct 2023 14:36:32 +0200 Subject: [PATCH 38/61] Change wording of stale message --- .github/workflows/stale.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 12a88e7cb8..9ae6bdb955 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -10,12 +10,13 @@ jobs: - uses: actions/stale@v4 with: stale-issue-message: | - This issue has been open for a while. It will be closed soon if nobody comments on it. + This issue has been open for a while with no recent activity. If this issue is still important to you, please add a comment within the next 7 days to keep it open. Otherwise, the issue will be automatically closed to free up time for other tasks. + Issues should be closed if: - - They are duplicates of other issues - - There is not enough demand - - They are no longer relevant - - There are not enough details + - They are duplicates of other issues + - There is not enough demand + - They are no longer relevant + - There are not enough details days-before-stale: 60 days-before-close: 7 stale-issue-label: "status:stale" From 508c0bba17652ca0ebda239f6bdf4316fe5be168 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 13 Oct 2023 14:37:32 +0200 Subject: [PATCH 39/61] Add stale message for pull requests --- .github/workflows/stale.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 9ae6bdb955..0ece44abf8 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,4 +1,4 @@ -name: "Close stale issues / pull requests" +name: "Close stale issues and pull requests" on: schedule: - cron: "30 1 * * *" @@ -17,6 +17,14 @@ jobs: - There is not enough demand - They are no longer relevant - There are not enough details + stale-pr-message: | + This pull request has been open for a while with no recent activity. If you're still working on this or waiting for a review, please add a comment or commit within the next 7 days to keep it open. Otherwise, the pull request will be automatically closed to free up time for other tasks. + + Pull requests should be closed if: + - They have been superseded by another pull request + - They are out of scope or don't align with the project + - They have become obsolete due to other changes + - They have bugs or conflicts that won't be resolved days-before-stale: 60 days-before-close: 7 stale-issue-label: "status:stale" From 84bd3827264971bab96f0faa7d293a6b30b73820 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 13 Oct 2023 15:37:51 +0200 Subject: [PATCH 40/61] Adjust checkLOS description and enable it by default --- .../java/net/wurstclient/hacks/AimAssistHack.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 36218d0537..fcfc46aa05 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -17,8 +17,8 @@ import net.minecraft.util.math.Box; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; -import net.wurstclient.Category; import net.minecraft.world.RaycastContext; +import net.wurstclient.Category; import net.wurstclient.events.RenderListener; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; @@ -46,12 +46,9 @@ public final class AimAssistHack extends Hack + "360\u00b0 = aims at entities all around you.", 120, 30, 360, 10, ValueDisplay.DEGREES); - private final CheckboxSetting checkLOS = - new CheckboxSetting("Check line of sight", - "Ensures that you don't reach through blocks when attacking.\n\n" - + "Slower but can help with anti-cheat plugins.", - false); - + private final CheckboxSetting checkLOS = new CheckboxSetting( + "Check line of sight", "Won't aim at entities behind blocks.", true); + private final EntityFilterList entityFilters = new EntityFilterList(FilterPlayersSetting.genericCombat(false), FilterSleepingSetting.genericCombat(false), @@ -136,10 +133,9 @@ public void onUpdate() if(target == null) return; - Vec3d eyesPos = RotationUtils.getEyesPos(); Vec3d hitVec = target.getBoundingBox().getCenter(); - if(checkLOS.isChecked() && MC.world + if(checkLOS.isChecked() && MC.world .raycast(new RaycastContext(eyesPos, hitVec, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.NONE, MC.player)) From 93b87db1381e20679d6529ffb11c108bf3a6dad1 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 13 Oct 2023 15:41:40 +0200 Subject: [PATCH 41/61] Revert TriggerBot change --- src/main/java/net/wurstclient/hacks/AimAssistHack.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index fcfc46aa05..9c76065abe 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -95,6 +95,7 @@ protected void onEnable() WURST.getHax().killauraLegitHack.setEnabled(false); WURST.getHax().multiAuraHack.setEnabled(false); WURST.getHax().protectHack.setEnabled(false); + WURST.getHax().triggerBotHack.setEnabled(false); WURST.getHax().tpAuraHack.setEnabled(false); EVENTS.add(UpdateListener.class, this); From fccddc57206d9c44cf338694146c134168279b9c Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 13 Oct 2023 16:28:55 +0200 Subject: [PATCH 42/61] Add BlockUtils methods for raycasting --- .../net/wurstclient/hacks/AnchorAuraHack.java | 16 ++++--------- .../net/wurstclient/hacks/AutoBuildHack.java | 8 ++----- .../wurstclient/hacks/BonemealAuraHack.java | 8 +------ .../wurstclient/hacks/CrystalAuraHack.java | 9 ++----- .../net/wurstclient/hacks/KillauraHack.java | 10 ++------ .../net/wurstclient/hacks/TillauraHack.java | 21 ++++------------ .../wurstclient/hacks/TrajectoriesHack.java | 7 ++---- .../net/wurstclient/hacks/TunnellerHack.java | 13 +--------- .../net/wurstclient/treebot/TreeBotUtils.java | 15 +----------- .../net/wurstclient/util/BlockBreaker.java | 8 +------ .../net/wurstclient/util/BlockPlacer.java | 8 +------ .../java/net/wurstclient/util/BlockUtils.java | 24 +++++++++++++++++++ 12 files changed, 45 insertions(+), 102 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AnchorAuraHack.java b/src/main/java/net/wurstclient/hacks/AnchorAuraHack.java index 5eca0dc6c6..824fa6922c 100644 --- a/src/main/java/net/wurstclient/hacks/AnchorAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/AnchorAuraHack.java @@ -20,13 +20,11 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.item.Items; import net.minecraft.util.Hand; -import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.Direction; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; -import net.minecraft.world.RaycastContext; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.UpdateListener; @@ -240,11 +238,8 @@ private boolean rightClickBlock(BlockPos pos) if(distanceSqHitVec >= distanceSqPosVec) continue; - if(checkLOS.isChecked() && MC.world - .raycast(new RaycastContext(eyesPos, hitVec, - RaycastContext.ShapeType.COLLIDER, - RaycastContext.FluidHandling.NONE, MC.player)) - .getType() != HitResult.Type.MISS) + if(checkLOS.isChecked() + && !BlockUtils.hasLineOfSight(eyesPos, hitVec)) continue; faceBlocks.getSelected().face(hitVec); @@ -284,11 +279,8 @@ private boolean placeAnchor(BlockPos pos) if(distanceSqPosVec > eyesPos.squaredDistanceTo(posVec.add(dirVec))) continue; - if(checkLOS.isChecked() && MC.world - .raycast(new RaycastContext(eyesPos, hitVec, - RaycastContext.ShapeType.COLLIDER, - RaycastContext.FluidHandling.NONE, MC.player)) - .getType() != HitResult.Type.MISS) + if(checkLOS.isChecked() + && !BlockUtils.hasLineOfSight(eyesPos, hitVec)) continue; InventoryUtils.selectItem(Items.RESPAWN_ANCHOR, diff --git a/src/main/java/net/wurstclient/hacks/AutoBuildHack.java b/src/main/java/net/wurstclient/hacks/AutoBuildHack.java index 2347809ef7..021d196c74 100644 --- a/src/main/java/net/wurstclient/hacks/AutoBuildHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoBuildHack.java @@ -26,7 +26,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.minecraft.world.RaycastContext; import net.wurstclient.Category; import net.wurstclient.events.RenderListener; import net.wurstclient.events.RightClickListener; @@ -253,11 +252,8 @@ private boolean tryToPlace(BlockPos pos, Vec3d eyesPos, double rangeSq) continue; // check line of sight - if(checkLOS.isChecked() && MC.world - .raycast(new RaycastContext(eyesPos, hitVec, - RaycastContext.ShapeType.COLLIDER, - RaycastContext.FluidHandling.NONE, MC.player)) - .getType() != HitResult.Type.MISS) + if(checkLOS.isChecked() + && !BlockUtils.hasLineOfSight(eyesPos, hitVec)) continue; // face block diff --git a/src/main/java/net/wurstclient/hacks/BonemealAuraHack.java b/src/main/java/net/wurstclient/hacks/BonemealAuraHack.java index 83016073d3..abf5e59365 100644 --- a/src/main/java/net/wurstclient/hacks/BonemealAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/BonemealAuraHack.java @@ -18,11 +18,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.util.Hand; -import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.minecraft.world.RaycastContext; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.UpdateListener; @@ -244,11 +242,7 @@ private boolean rightClickBlockLegit(BlockPos pos) continue; // check line of sight - if(MC.world - .raycast(new RaycastContext(eyesPos, hitVec, - RaycastContext.ShapeType.COLLIDER, - RaycastContext.FluidHandling.NONE, MC.player)) - .getType() != HitResult.Type.MISS) + if(!BlockUtils.hasLineOfSight(eyesPos, hitVec)) continue; // face block diff --git a/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java b/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java index 9a672919e6..28cb935353 100644 --- a/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java @@ -21,12 +21,10 @@ import net.minecraft.entity.decoration.EndCrystalEntity; import net.minecraft.item.Items; import net.minecraft.util.Hand; -import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.minecraft.world.RaycastContext; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.UpdateListener; @@ -200,11 +198,8 @@ private boolean placeCrystal(BlockPos pos) if(distanceSqPosVec > eyesPos.squaredDistanceTo(posVec.add(dirVec))) continue; - if(checkLOS.isChecked() && MC.world - .raycast(new RaycastContext(eyesPos, hitVec, - RaycastContext.ShapeType.COLLIDER, - RaycastContext.FluidHandling.NONE, MC.player)) - .getType() != HitResult.Type.MISS) + if(checkLOS.isChecked() + && !BlockUtils.hasLineOfSight(eyesPos, hitVec)) continue; InventoryUtils.selectItem(Items.END_CRYSTAL, diff --git a/src/main/java/net/wurstclient/hacks/KillauraHack.java b/src/main/java/net/wurstclient/hacks/KillauraHack.java index 3bb4ebabe5..b330c1c117 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraHack.java @@ -21,11 +21,9 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.util.Hand; -import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.Vec3d; -import net.minecraft.world.RaycastContext; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.PostMotionListener; @@ -39,6 +37,7 @@ import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; import net.wurstclient.settings.filterlists.EntityFilterList; +import net.wurstclient.util.BlockUtils; import net.wurstclient.util.EntityUtils; import net.wurstclient.util.RegionPos; import net.wurstclient.util.RenderUtils; @@ -161,13 +160,8 @@ public void onUpdate() WURST.getHax().autoSwordHack.setSlot(); - Vec3d eyesPos = RotationUtils.getEyesPos(); Vec3d hitVec = target.getBoundingBox().getCenter(); - if(checkLOS.isChecked() && MC.world - .raycast(new RaycastContext(eyesPos, hitVec, - RaycastContext.ShapeType.COLLIDER, - RaycastContext.FluidHandling.NONE, MC.player)) - .getType() != HitResult.Type.MISS) + if(checkLOS.isChecked() && !BlockUtils.hasLineOfSight(hitVec)) { target = null; return; diff --git a/src/main/java/net/wurstclient/hacks/TillauraHack.java b/src/main/java/net/wurstclient/hacks/TillauraHack.java index 7be585e969..8650dfcb28 100644 --- a/src/main/java/net/wurstclient/hacks/TillauraHack.java +++ b/src/main/java/net/wurstclient/hacks/TillauraHack.java @@ -19,13 +19,9 @@ import net.minecraft.item.HoeItem; import net.minecraft.item.ItemStack; import net.minecraft.util.Hand; -import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.minecraft.world.RaycastContext; -import net.minecraft.world.RaycastContext.FluidHandling; -import net.minecraft.world.RaycastContext.ShapeType; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.UpdateListener; @@ -165,7 +161,8 @@ private boolean rightClickBlockLegit(BlockPos pos) if(distanceSqHitVec >= distanceSqPosVec) continue; - if(checkLOS.isChecked() && !hasLineOfSight(eyesPos, hitVec)) + if(checkLOS.isChecked() + && !BlockUtils.hasLineOfSight(eyesPos, hitVec)) continue; // face block @@ -201,7 +198,8 @@ private boolean rightClickBlockSimple(BlockPos pos) if(distanceSqHitVec >= distanceSqPosVec) continue; - if(checkLOS.isChecked() && !hasLineOfSight(eyesPos, hitVec)) + if(checkLOS.isChecked() + && !BlockUtils.hasLineOfSight(eyesPos, hitVec)) continue; IMC.getInteractionManager().rightClickBlock(pos, side, hitVec); @@ -210,15 +208,4 @@ private boolean rightClickBlockSimple(BlockPos pos) return false; } - - private boolean hasLineOfSight(Vec3d from, Vec3d to) - { - ShapeType type = RaycastContext.ShapeType.COLLIDER; - FluidHandling fluid = RaycastContext.FluidHandling.NONE; - - RaycastContext context = - new RaycastContext(from, to, type, fluid, MC.player); - - return MC.world.raycast(context).getType() == HitResult.Type.MISS; - } } diff --git a/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java b/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java index b9b821e047..4d910d9332 100644 --- a/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java +++ b/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java @@ -33,12 +33,12 @@ import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.Box; import net.minecraft.util.math.Vec3d; -import net.minecraft.world.RaycastContext; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.RenderListener; import net.wurstclient.hack.Hack; import net.wurstclient.settings.ColorSetting; +import net.wurstclient.util.BlockUtils; import net.wurstclient.util.EntityUtils; import net.wurstclient.util.RenderUtils; import net.wurstclient.util.RotationUtils; @@ -216,10 +216,7 @@ private Trajectory getTrajectory(float partialTicks) : RotationUtils.getEyesPos(); // check for block collision - BlockHitResult bResult = - MC.world.raycast(new RaycastContext(lastPos, arrowPos, - RaycastContext.ShapeType.COLLIDER, - RaycastContext.FluidHandling.NONE, MC.player)); + BlockHitResult bResult = BlockUtils.raycast(lastPos, arrowPos); if(bResult.getType() != HitResult.Type.MISS) { // replace last pos with the collision point diff --git a/src/main/java/net/wurstclient/hacks/TunnellerHack.java b/src/main/java/net/wurstclient/hacks/TunnellerHack.java index 0b0bbcfc39..3e97cbddf0 100644 --- a/src/main/java/net/wurstclient/hacks/TunnellerHack.java +++ b/src/main/java/net/wurstclient/hacks/TunnellerHack.java @@ -39,7 +39,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.network.packet.c2s.play.HandSwingC2SPacket; import net.minecraft.util.Hand; -import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.Direction; @@ -47,7 +46,6 @@ import net.minecraft.util.math.Vec3i; import net.minecraft.util.shape.VoxelShape; import net.minecraft.world.EmptyBlockView; -import net.minecraft.world.RaycastContext; import net.wurstclient.Category; import net.wurstclient.events.RenderListener; import net.wurstclient.events.UpdateListener; @@ -923,7 +921,7 @@ private boolean breakBlock(BlockPos pos) if(distancesSq[i] >= distanceSqToCenter) continue; - linesOfSight[i] = hasLineOfSight(eyesPos, hitVecs[i]); + linesOfSight[i] = BlockUtils.hasLineOfSight(eyesPos, hitVecs[i]); } Direction side = sides[0]; @@ -957,15 +955,6 @@ private boolean breakBlock(BlockPos pos) return true; } - private boolean hasLineOfSight(Vec3d from, Vec3d to) - { - RaycastContext context = - new RaycastContext(from, to, RaycastContext.ShapeType.COLLIDER, - RaycastContext.FluidHandling.NONE, MC.player); - - return MC.world.raycast(context).getType() == HitResult.Type.MISS; - } - private enum TunnelSize { SIZE_1X2("1x2", new Vec3i(0, 1, 0), new Vec3i(0, 0, 0), 4, 13), diff --git a/src/main/java/net/wurstclient/treebot/TreeBotUtils.java b/src/main/java/net/wurstclient/treebot/TreeBotUtils.java index 58cfad2833..fb609157d7 100644 --- a/src/main/java/net/wurstclient/treebot/TreeBotUtils.java +++ b/src/main/java/net/wurstclient/treebot/TreeBotUtils.java @@ -12,13 +12,10 @@ import net.minecraft.block.Block; import net.minecraft.block.Blocks; -import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3i; -import net.minecraft.world.RaycastContext; -import net.wurstclient.WurstClient; import net.wurstclient.util.BlockUtils; import net.wurstclient.util.RotationUtils; @@ -79,7 +76,7 @@ public static Direction getLineOfSightSide(Vec3d eyesPos, BlockPos pos) if(distancesSq[i] >= distanceSqToCenter) continue; - linesOfSight[i] = hasLineOfSight(eyesPos, hitVecs[i]); + linesOfSight[i] = BlockUtils.hasLineOfSight(eyesPos, hitVecs[i]); } Direction side = null; @@ -104,14 +101,4 @@ public static Direction getLineOfSightSide(Vec3d eyesPos, BlockPos pos) // will be null if no LOS was found return side; } - - private static boolean hasLineOfSight(Vec3d from, Vec3d to) - { - RaycastContext context = - new RaycastContext(from, to, RaycastContext.ShapeType.COLLIDER, - RaycastContext.FluidHandling.NONE, WurstClient.MC.player); - - return WurstClient.MC.world.raycast(context) - .getType() == HitResult.Type.MISS; - } } diff --git a/src/main/java/net/wurstclient/util/BlockBreaker.java b/src/main/java/net/wurstclient/util/BlockBreaker.java index 16398f6f4f..47c84f134f 100644 --- a/src/main/java/net/wurstclient/util/BlockBreaker.java +++ b/src/main/java/net/wurstclient/util/BlockBreaker.java @@ -14,14 +14,12 @@ import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action; import net.minecraft.util.Hand; -import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3i; import net.minecraft.util.shape.VoxelShape; -import net.minecraft.world.RaycastContext; import net.wurstclient.WurstClient; public enum BlockBreaker @@ -94,11 +92,7 @@ public static BlockBreakingParams getBlockBreakingParams(BlockPos pos) if(distancesSq[i] >= distanceSqToCenter) continue; - linesOfSight[i] = MC.world - .raycast(new RaycastContext(eyesPos, hitVecs[i], - RaycastContext.ShapeType.COLLIDER, - RaycastContext.FluidHandling.NONE, MC.player)) - .getType() == HitResult.Type.MISS; + linesOfSight[i] = BlockUtils.hasLineOfSight(eyesPos, hitVecs[i]); } Direction side = sides[0]; diff --git a/src/main/java/net/wurstclient/util/BlockPlacer.java b/src/main/java/net/wurstclient/util/BlockPlacer.java index 829d967764..96121057fe 100644 --- a/src/main/java/net/wurstclient/util/BlockPlacer.java +++ b/src/main/java/net/wurstclient/util/BlockPlacer.java @@ -10,14 +10,12 @@ import net.minecraft.block.BlockState; import net.minecraft.client.MinecraftClient; import net.minecraft.util.hit.BlockHitResult; -import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3i; import net.minecraft.util.shape.VoxelShape; -import net.minecraft.world.RaycastContext; import net.wurstclient.WurstClient; import net.wurstclient.mixinterface.IMinecraftClient; import net.wurstclient.util.BlockBreaker.BlockBreakingParams; @@ -124,11 +122,7 @@ public static BlockPlacingParams getBlockPlacingParams(BlockPos pos) if(distancesSq[i] <= distanceSqToPosVec) continue; - linesOfSight[i] = MC.world - .raycast(new RaycastContext(eyesPos, hitVecs[i], - RaycastContext.ShapeType.COLLIDER, - RaycastContext.FluidHandling.NONE, MC.player)) - .getType() == HitResult.Type.MISS; + linesOfSight[i] = BlockUtils.hasLineOfSight(eyesPos, hitVecs[i]); } // decide which side to use diff --git a/src/main/java/net/wurstclient/util/BlockUtils.java b/src/main/java/net/wurstclient/util/BlockUtils.java index 139b0a6c66..8cdfbb30f1 100644 --- a/src/main/java/net/wurstclient/util/BlockUtils.java +++ b/src/main/java/net/wurstclient/util/BlockUtils.java @@ -17,10 +17,14 @@ import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; import net.minecraft.util.InvalidIdentifierException; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; +import net.minecraft.util.math.Vec3d; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; +import net.minecraft.world.RaycastContext; import net.wurstclient.WurstClient; public enum BlockUtils @@ -125,6 +129,26 @@ public static boolean isOpaqueFullCube(BlockPos pos) return getState(pos).isOpaqueFullCube(MC.world, pos); } + public static BlockHitResult raycast(Vec3d from, Vec3d to) + { + RaycastContext context = + new RaycastContext(from, to, RaycastContext.ShapeType.COLLIDER, + RaycastContext.FluidHandling.NONE, MC.player); + + return MC.world.raycast(context); + } + + public static boolean hasLineOfSight(Vec3d from, Vec3d to) + { + return raycast(from, to).getType() == HitResult.Type.MISS; + } + + public static boolean hasLineOfSight(Vec3d to) + { + return raycast(RotationUtils.getEyesPos(), to) + .getType() == HitResult.Type.MISS; + } + public static ArrayList getAllInBox(BlockPos from, BlockPos to) { ArrayList blocks = new ArrayList<>(); From e69d5f78ae76329f8d8342f47ab17cd2dc9edb8f Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 13 Oct 2023 16:36:14 +0200 Subject: [PATCH 43/61] Use BlockUtils.hasLineOfSight() in AimAssist --- .../java/net/wurstclient/hacks/AimAssistHack.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index c6acfa27f3..5b970aa0a8 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -13,11 +13,9 @@ import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.Entity; -import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.Box; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; -import net.minecraft.world.RaycastContext; import net.wurstclient.Category; import net.wurstclient.events.RenderListener; import net.wurstclient.events.UpdateListener; @@ -27,6 +25,7 @@ import net.wurstclient.settings.SliderSetting.ValueDisplay; import net.wurstclient.settings.filterlists.EntityFilterList; import net.wurstclient.settings.filters.*; +import net.wurstclient.util.BlockUtils; import net.wurstclient.util.EntityUtils; import net.wurstclient.util.RotationUtils; import net.wurstclient.util.RotationUtils.Rotation; @@ -138,17 +137,13 @@ public void onUpdate() if(target == null) return; - Vec3d eyesPos = RotationUtils.getEyesPos(); Vec3d hitVec = target.getBoundingBox().getCenter(); - if(checkLOS.isChecked() && MC.world - .raycast(new RaycastContext(eyesPos, hitVec, - RaycastContext.ShapeType.COLLIDER, - RaycastContext.FluidHandling.NONE, MC.player)) - .getType() != HitResult.Type.MISS) + if(checkLOS.isChecked() && !BlockUtils.hasLineOfSight(hitVec)) { target = null; return; } + WURST.getHax().autoSwordHack.setSlot(); faceEntityClient(target); } From 55ac55749649c276d4a53fcfd09304d1a121248b Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 13 Oct 2023 17:42:40 +0200 Subject: [PATCH 44/61] Rename FilterTradersSetting to FilterVillagersSetting --- .../java/net/wurstclient/hacks/AimAssistHack.java | 2 +- .../net/wurstclient/hacks/KillauraLegitHack.java | 2 +- .../java/net/wurstclient/hacks/ProtectHack.java | 2 +- .../settings/filterlists/AnchorAuraFilterList.java | 2 +- .../filterlists/CrystalAuraFilterList.java | 2 +- .../settings/filterlists/EntityFilterList.java | 2 +- .../settings/filterlists/FollowFilterList.java | 2 +- .../settings/filterlists/MobEspFilterList.java | 2 +- .../settings/filterlists/RemoteViewFilterList.java | 2 +- ...ersSetting.java => FilterVillagersSetting.java} | 14 +++++++------- 10 files changed, 16 insertions(+), 16 deletions(-) rename src/main/java/net/wurstclient/settings/filters/{FilterTradersSetting.java => FilterVillagersSetting.java} (59%) diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 5b970aa0a8..b71d377b00 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -61,7 +61,7 @@ public final class AimAssistHack extends Hack FilterBabiesSetting.genericCombat(true), FilterBatsSetting.genericCombat(true), FilterPetsSetting.genericCombat(true), - FilterTradersSetting.genericCombat(true), + FilterVillagersSetting.genericCombat(true), FilterGolemsSetting.genericCombat(false), FilterShulkersSetting.genericCombat(false), FilterInvisibleSetting.genericCombat(true), diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index 8b14bac92a..25bd005af1 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -87,7 +87,7 @@ public final class KillauraLegitHack extends Hack FilterBabiesSetting.genericCombat(false), FilterBatsSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), - FilterTradersSetting.genericCombat(false), + FilterVillagersSetting.genericCombat(false), FilterGolemsSetting.genericCombat(false), FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index a8fd41637e..f5f7eed399 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -61,7 +61,7 @@ public final class ProtectHack extends Hack FilterBabiesSetting.genericCombat(false), FilterBatsSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), - FilterTradersSetting.genericCombat(false), + FilterVillagersSetting.genericCombat(false), FilterGolemsSetting.genericCombat(false), FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java index 3859cdea1a..969c8bc136 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java @@ -43,7 +43,7 @@ public static AnchorAuraFilterList create() + " \"ambient\" mobs when auto-placing anchors." + damageWarning, true)); - builder.add(new FilterTradersSetting("Won't target villagers and" + 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 9e46b0723c..cb504368e2 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java @@ -43,7 +43,7 @@ public static CrystalAuraFilterList create() + " \"ambient\" mobs when auto-placing crystals." + damageWarning, true)); - builder.add(new FilterTradersSetting("Won't target villagers and" + 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 76ce78c444..dd30134a5c 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java @@ -64,7 +64,7 @@ public static EntityFilterList genericCombat() FilterBabiesSetting.genericCombat(false), FilterBatsSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), - FilterTradersSetting.genericCombat(false), + FilterVillagersSetting.genericCombat(false), FilterGolemsSetting.genericCombat(false), FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.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 47dabe81d4..f850af3199 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -55,7 +55,7 @@ public static FollowFilterList create() builder.add(new FilterPetsSetting( "Won't follow tamed wolves, tamed horses, etc.", true)); - builder.add(new FilterTradersSetting( + builder.add(new FilterVillagersSetting( "Won't follow villagers and wandering traders.", true)); builder.add(new FilterGolemsSetting( diff --git a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java index 799f987c6c..ba8b9dcbdc 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -30,7 +30,7 @@ public static MobEspFilterList create() builder.add(FilterPassiveSetting.genericVision(false)); builder.add(FilterBatsSetting.genericVision(false)); builder.add(FilterPetsSetting.genericVision(false)); - builder.add(FilterTradersSetting.genericVision(false)); + builder.add(FilterVillagersSetting.genericVision(false)); builder.add(FilterGolemsSetting.genericVision(false)); builder.add(FilterShulkersSetting.genericVision(false)); builder.add(FilterAllaysSetting.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 dee683b21d..824bbc53a3 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -55,7 +55,7 @@ public static RemoteViewFilterList create() builder.add(new FilterPetsSetting( "Won't view tamed wolves, tamed horses, etc.", true)); - builder.add(new FilterTradersSetting( + builder.add(new FilterVillagersSetting( "Won't view villagers and wandering traders.", true)); builder.add(new FilterGolemsSetting( diff --git a/src/main/java/net/wurstclient/settings/filters/FilterTradersSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterVillagersSetting.java similarity index 59% rename from src/main/java/net/wurstclient/settings/filters/FilterTradersSetting.java rename to src/main/java/net/wurstclient/settings/filters/FilterVillagersSetting.java index 19d061bc89..31f6f649b4 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterTradersSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterVillagersSetting.java @@ -10,11 +10,11 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.passive.MerchantEntity; -public final class FilterTradersSetting extends EntityFilterCheckbox +public final class FilterVillagersSetting extends EntityFilterCheckbox { - public FilterTradersSetting(String description, boolean checked) + public FilterVillagersSetting(String description, boolean checked) { - super("Filter traders", description, checked); + super("Filter villagers", description, checked); } @Override @@ -23,15 +23,15 @@ public boolean test(Entity e) return !(e instanceof MerchantEntity); } - public static FilterTradersSetting genericCombat(boolean checked) + public static FilterVillagersSetting genericCombat(boolean checked) { - return new FilterTradersSetting( + return new FilterVillagersSetting( "Won't attack villagers and wandering traders.", checked); } - public static FilterTradersSetting genericVision(boolean checked) + public static FilterVillagersSetting genericVision(boolean checked) { - return new FilterTradersSetting( + return new FilterVillagersSetting( "Won't show villagers and wandering traders.", checked); } } From d1939cfc25413c48911c98a288bd2efd29b84ea5 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 13 Oct 2023 17:53:51 +0200 Subject: [PATCH 45/61] Add zombie villager filter Closes #464 --- .../net/wurstclient/hacks/AimAssistHack.java | 1 + .../wurstclient/hacks/KillauraLegitHack.java | 1 + .../net/wurstclient/hacks/ProtectHack.java | 1 + .../filterlists/AnchorAuraFilterList.java | 3 ++ .../filterlists/CrystalAuraFilterList.java | 3 ++ .../filterlists/EntityFilterList.java | 1 + .../filterlists/FollowFilterList.java | 3 ++ .../filterlists/MobEspFilterList.java | 1 + .../filterlists/RemoteViewFilterList.java | 3 ++ .../filters/FilterZombieVillagersSetting.java | 37 +++++++++++++++++++ 10 files changed, 54 insertions(+) create mode 100644 src/main/java/net/wurstclient/settings/filters/FilterZombieVillagersSetting.java diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index b71d377b00..99d0ea4dab 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -62,6 +62,7 @@ public final class AimAssistHack extends Hack FilterBatsSetting.genericCombat(true), FilterPetsSetting.genericCombat(true), FilterVillagersSetting.genericCombat(true), + FilterZombieVillagersSetting.genericCombat(true), FilterGolemsSetting.genericCombat(false), FilterShulkersSetting.genericCombat(false), FilterInvisibleSetting.genericCombat(true), diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index 25bd005af1..d86dc74a24 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -88,6 +88,7 @@ public final class KillauraLegitHack extends Hack FilterBatsSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), FilterVillagersSetting.genericCombat(false), + FilterZombieVillagersSetting.genericCombat(false), FilterGolemsSetting.genericCombat(false), FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index f5f7eed399..45e7fe987b 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -62,6 +62,7 @@ public final class ProtectHack extends Hack FilterBatsSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), FilterVillagersSetting.genericCombat(false), + FilterZombieVillagersSetting.genericCombat(false), FilterGolemsSetting.genericCombat(false), FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java index 969c8bc136..9819bb3dd9 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java @@ -47,6 +47,9 @@ public static AnchorAuraFilterList create() + " wandering traders when auto-placing anchors." + damageWarning, true)); + builder.add(new FilterZombieVillagersSetting("Won't target zombified" + + " villagers when auto-placing anchors." + damageWarning, true)); + builder.add(new FilterGolemsSetting("Won't target iron golems and snow" + " golems 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 cb504368e2..a16c5fefbf 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java @@ -47,6 +47,9 @@ public static CrystalAuraFilterList create() + " wandering traders when auto-placing crystals." + damageWarning, true)); + builder.add(new FilterZombieVillagersSetting("Won't target zombified" + + " villagers when auto-placing crystals." + damageWarning, true)); + builder.add(new FilterGolemsSetting("Won't target iron golems and snow" + " golems 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 dd30134a5c..6f342a4747 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java @@ -65,6 +65,7 @@ public static EntityFilterList genericCombat() FilterBatsSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), FilterVillagersSetting.genericCombat(false), + FilterZombieVillagersSetting.genericCombat(false), FilterGolemsSetting.genericCombat(false), FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.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 f850af3199..15f177b5ce 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -58,6 +58,9 @@ public static FollowFilterList create() builder.add(new FilterVillagersSetting( "Won't follow villagers and wandering traders.", true)); + builder.add(new FilterZombieVillagersSetting( + "Won't follow zombified villagers.", true)); + builder.add(new FilterGolemsSetting( "Won't follow iron golems and snow golems.", true)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java index ba8b9dcbdc..4bd1020b25 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -31,6 +31,7 @@ public static MobEspFilterList create() builder.add(FilterBatsSetting.genericVision(false)); builder.add(FilterPetsSetting.genericVision(false)); builder.add(FilterVillagersSetting.genericVision(false)); + builder.add(FilterZombieVillagersSetting.genericVision(false)); builder.add(FilterGolemsSetting.genericVision(false)); builder.add(FilterShulkersSetting.genericVision(false)); builder.add(FilterAllaysSetting.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 824bbc53a3..9090b6d96a 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -58,6 +58,9 @@ public static RemoteViewFilterList create() builder.add(new FilterVillagersSetting( "Won't view villagers and wandering traders.", true)); + builder.add(new FilterZombieVillagersSetting( + "Won't view zombified villagers.", true)); + builder.add(new FilterGolemsSetting( "Won't view iron golems and snow golems.", true)); diff --git a/src/main/java/net/wurstclient/settings/filters/FilterZombieVillagersSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterZombieVillagersSetting.java new file mode 100644 index 0000000000..205ba327d2 --- /dev/null +++ b/src/main/java/net/wurstclient/settings/filters/FilterZombieVillagersSetting.java @@ -0,0 +1,37 @@ +/* + * 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.ZombieVillagerEntity; + +public final class FilterZombieVillagersSetting extends EntityFilterCheckbox +{ + public FilterZombieVillagersSetting(String description, boolean checked) + { + super("Filter zombie villagers", description, checked); + } + + @Override + public boolean test(Entity e) + { + return !(e instanceof ZombieVillagerEntity); + } + + public static FilterZombieVillagersSetting genericCombat(boolean checked) + { + return new FilterZombieVillagersSetting( + "Won't attack zombified villagers.", checked); + } + + public static FilterZombieVillagersSetting genericVision(boolean checked) + { + return new FilterZombieVillagersSetting( + "Won't show zombified villagers.", checked); + } +} From d81c6be822c8aac5ac03f297c2947a33e53835f5 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 13 Oct 2023 18:48:14 +0200 Subject: [PATCH 46/61] Add filter for regular piglins --- .../net/wurstclient/hacks/AimAssistHack.java | 6 +- .../wurstclient/hacks/KillauraLegitHack.java | 6 +- .../net/wurstclient/hacks/ProtectHack.java | 6 +- .../filterlists/AnchorAuraFilterList.java | 8 +++ .../filterlists/CrystalAuraFilterList.java | 8 +++ .../filterlists/EntityFilterList.java | 6 +- .../filterlists/FollowFilterList.java | 9 ++- .../filterlists/MobEspFilterList.java | 6 +- .../filterlists/RemoteViewFilterList.java | 9 ++- .../filters/FilterPiglinsSetting.java | 68 +++++++++++++++++++ 10 files changed, 116 insertions(+), 16 deletions(-) create mode 100644 src/main/java/net/wurstclient/settings/filters/FilterPiglinsSetting.java diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 99d0ea4dab..96606f45ff 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -53,8 +53,6 @@ public final class AimAssistHack extends Hack FilterSleepingSetting.genericCombat(false), FilterFlyingSetting.genericCombat(0), FilterHostileSetting.genericCombat(false), - FilterZombiePiglinsSetting - .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterEndermenSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(true), @@ -64,6 +62,10 @@ public final class AimAssistHack extends Hack FilterVillagersSetting.genericCombat(true), FilterZombieVillagersSetting.genericCombat(true), FilterGolemsSetting.genericCombat(false), + FilterPiglinsSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), + FilterZombiePiglinsSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterShulkersSetting.genericCombat(false), FilterInvisibleSetting.genericCombat(true), FilterNamedSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index d86dc74a24..548034c2c9 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -79,8 +79,6 @@ public final class KillauraLegitHack extends Hack FilterSleepingSetting.genericCombat(true), FilterFlyingSetting.genericCombat(0.5), FilterHostileSetting.genericCombat(false), - FilterZombiePiglinsSetting - .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterEndermenSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(false), @@ -90,6 +88,10 @@ public final class KillauraLegitHack extends Hack FilterVillagersSetting.genericCombat(false), FilterZombieVillagersSetting.genericCombat(false), FilterGolemsSetting.genericCombat(false), + FilterPiglinsSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), + FilterZombiePiglinsSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.genericCombat(false), FilterInvisibleSetting.genericCombat(true), diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index 45e7fe987b..d7d6d5b8f9 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -53,8 +53,6 @@ public final class ProtectHack extends Hack FilterSleepingSetting.genericCombat(false), FilterFlyingSetting.genericCombat(0), FilterHostileSetting.genericCombat(false), - FilterZombiePiglinsSetting - .genericCombat(FilterZombiePiglinsSetting.Mode.OFF), FilterEndermenSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(false), @@ -64,6 +62,10 @@ public final class ProtectHack extends Hack FilterVillagersSetting.genericCombat(false), FilterZombieVillagersSetting.genericCombat(false), FilterGolemsSetting.genericCombat(false), + FilterPiglinsSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), + FilterZombiePiglinsSetting + .genericCombat(FilterZombiePiglinsSetting.Mode.OFF), FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.genericCombat(false), FilterInvisibleSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java index 9819bb3dd9..41ba3c523b 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java @@ -53,6 +53,14 @@ public static AnchorAuraFilterList create() builder.add(new FilterGolemsSetting("Won't target iron golems and snow" + " golems when auto-placing anchors." + damageWarning, true)); + builder.add(new FilterPiglinsSetting( + "Won't target piglins when auto-placing anchors.", + AttackDetectingEntityFilter.Mode.ON)); + + builder.add(new FilterZombiePiglinsSetting("Won't target" + + " zombified piglins when auto-placing anchors." + damageWarning, + AttackDetectingEntityFilter.Mode.ON)); + builder.add(new FilterShulkersSetting("Won't target shulkers 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 a16c5fefbf..d239fca0bc 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java @@ -53,6 +53,14 @@ public static CrystalAuraFilterList create() builder.add(new FilterGolemsSetting("Won't target iron golems and snow" + " golems when auto-placing crystals." + damageWarning, true)); + builder.add(new FilterPiglinsSetting("Won't target piglins when" + + " auto-placing crystals." + damageWarning, + AttackDetectingEntityFilter.Mode.ON)); + + builder.add(new FilterZombiePiglinsSetting("Won't target" + + " zombified piglins when auto-placing crystals." + damageWarning, + AttackDetectingEntityFilter.Mode.ON)); + builder.add(new FilterShulkersSetting("Won't target shulkers 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 6f342a4747..45c5a1a515 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java @@ -56,8 +56,6 @@ public static EntityFilterList genericCombat() FilterSleepingSetting.genericCombat(false), FilterFlyingSetting.genericCombat(0), FilterHostileSetting.genericCombat(false), - FilterZombiePiglinsSetting - .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterEndermenSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(false), @@ -67,6 +65,10 @@ public static EntityFilterList genericCombat() FilterVillagersSetting.genericCombat(false), FilterZombieVillagersSetting.genericCombat(false), FilterGolemsSetting.genericCombat(false), + FilterPiglinsSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), + FilterZombiePiglinsSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.genericCombat(false), FilterInvisibleSetting.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 15f177b5ce..83c9e0a934 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -36,9 +36,6 @@ public static FollowFilterList create() builder.add(new FilterHostileSetting( "Won't follow hostile mobs like zombies and creepers.", true)); - builder.add(FilterZombiePiglinsSetting - .onOffOnly("Won't follow zombified piglins.", true)); - builder.add( FilterEndermenSetting.onOffOnly("Won't follow endermen.", true)); @@ -64,6 +61,12 @@ public static FollowFilterList create() builder.add(new FilterGolemsSetting( "Won't follow iron golems and snow golems.", true)); + builder + .add(FilterPiglinsSetting.onOffOnly("Won't follow piglins.", true)); + + builder.add(FilterZombiePiglinsSetting + .onOffOnly("Won't follow zombified piglins.", true)); + builder.add(new FilterShulkersSetting("Won't follow shulkers.", true)); builder.add(new FilterAllaysSetting("Won't follow allays.", true)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java index 4bd1020b25..896c0b064d 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -23,8 +23,6 @@ public static MobEspFilterList create() { ArrayList builder = new ArrayList<>(); builder.add(FilterHostileSetting.genericVision(false)); - builder.add(FilterZombiePiglinsSetting - .genericVision(AttackDetectingEntityFilter.Mode.OFF)); builder.add(FilterEndermenSetting .genericVision(AttackDetectingEntityFilter.Mode.OFF)); builder.add(FilterPassiveSetting.genericVision(false)); @@ -33,6 +31,10 @@ public static MobEspFilterList create() builder.add(FilterVillagersSetting.genericVision(false)); builder.add(FilterZombieVillagersSetting.genericVision(false)); builder.add(FilterGolemsSetting.genericVision(false)); + builder.add(FilterPiglinsSetting + .genericVision(AttackDetectingEntityFilter.Mode.OFF)); + builder.add(FilterZombiePiglinsSetting + .genericVision(AttackDetectingEntityFilter.Mode.OFF)); builder.add(FilterShulkersSetting.genericVision(false)); builder.add(FilterAllaysSetting.genericVision(false)); builder.add(FilterInvisibleSetting.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 9090b6d96a..c3ca36de9f 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -36,9 +36,6 @@ public static RemoteViewFilterList create() builder.add(new FilterHostileSetting( "Won't view hostile mobs like zombies and creepers.", true)); - builder.add(FilterZombiePiglinsSetting - .onOffOnly("Won't view zombified piglins.", true)); - builder .add(FilterEndermenSetting.onOffOnly("Won't view endermen.", true)); @@ -64,6 +61,12 @@ public static RemoteViewFilterList create() builder.add(new FilterGolemsSetting( "Won't view iron golems and snow golems.", true)); + builder + .add(FilterPiglinsSetting.onOffOnly("Won't view piglins.", true)); + + builder.add(FilterZombiePiglinsSetting + .onOffOnly("Won't view zombified piglins.", true)); + builder.add(new FilterShulkersSetting("Won't view shulkers.", true)); builder.add(new FilterAllaysSetting("Won't view allays.", true)); diff --git a/src/main/java/net/wurstclient/settings/filters/FilterPiglinsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterPiglinsSetting.java new file mode 100644 index 0000000000..005191ff20 --- /dev/null +++ b/src/main/java/net/wurstclient/settings/filters/FilterPiglinsSetting.java @@ -0,0 +1,68 @@ +/* + * 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.PiglinEntity; + +public final class FilterPiglinsSetting extends AttackDetectingEntityFilter +{ + private static final String EXCEPTIONS_TEXT = + "\n\nThis filter does not affect piglin brutes."; + + private FilterPiglinsSetting(String description, Mode selected, + boolean checked) + { + super("Filter piglins", description + EXCEPTIONS_TEXT, selected, + checked); + } + + public FilterPiglinsSetting(String description, Mode selected) + { + this(description, selected, false); + } + + @Override + public boolean onTest(Entity e) + { + return !(e instanceof PiglinEntity); + } + + @Override + public boolean ifCalmTest(Entity e) + { + return !(e instanceof PiglinEntity pe) || pe.isAttacking(); + } + + public static FilterPiglinsSetting genericCombat(Mode selected) + { + return new FilterPiglinsSetting("When set to \u00a7lOn\u00a7r," + + " piglins won't be attacked at all.\n\n" + + "When set to \u00a7lIf calm\u00a7r, piglins won't be attacked" + + " until they attack first. Be warned that this filter cannot" + + " detect if the piglins are attacking you or someone else.\n\n" + + "When set to \u00a7lOff\u00a7r, this filter does nothing and" + + " piglins can be attacked.", selected); + } + + public static FilterPiglinsSetting genericVision(Mode selected) + { + return new FilterPiglinsSetting("When set to \u00a7lOn\u00a7r," + + " piglins won't be shown at all.\n\n" + + "When set to \u00a7lIf calm\u00a7r, piglins won't be shown until" + + " they attack something.\n\n" + + "When set to \u00a7lOff\u00a7r, this filter does nothing and" + + " piglins can be shown.", selected); + } + + public static FilterPiglinsSetting onOffOnly(String description, + boolean onByDefault) + { + return new FilterPiglinsSetting(description, null, onByDefault); + } +} From aefe4b2cbb912636951ccfe05362c4e321883b5d Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sat, 14 Oct 2023 10:40:17 +0200 Subject: [PATCH 47/61] Add recommended permissions --- .github/workflows/stale.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 0ece44abf8..5b86f9b74e 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -3,6 +3,10 @@ on: schedule: - cron: "30 1 * * *" +permissions: + issues: write + pull-requests: write + jobs: stale: runs-on: ubuntu-latest From 8c3384fb04b2c7323305a40141eebc4b543be9b7 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sat, 14 Oct 2023 18:51:31 +0200 Subject: [PATCH 48/61] Add FilterNeutralSetting --- .../net/wurstclient/hacks/AimAssistHack.java | 4 +- .../wurstclient/hacks/KillauraLegitHack.java | 4 +- .../net/wurstclient/hacks/ProtectHack.java | 4 +- .../filterlists/AnchorAuraFilterList.java | 4 + .../filterlists/CrystalAuraFilterList.java | 4 + .../filterlists/EntityFilterList.java | 4 +- .../filterlists/FollowFilterList.java | 7 +- .../filterlists/MobEspFilterList.java | 4 +- .../filterlists/RemoteViewFilterList.java | 7 +- .../filters/FilterNeutralSetting.java | 77 +++++++++++++++++++ 10 files changed, 110 insertions(+), 9 deletions(-) create mode 100644 src/main/java/net/wurstclient/settings/filters/FilterNeutralSetting.java diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 96606f45ff..24b49fb630 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -53,7 +53,7 @@ public final class AimAssistHack extends Hack FilterSleepingSetting.genericCombat(false), FilterFlyingSetting.genericCombat(0), FilterHostileSetting.genericCombat(false), - FilterEndermenSetting + FilterNeutralSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(true), FilterBabiesSetting.genericCombat(true), @@ -66,6 +66,8 @@ public final class AimAssistHack extends Hack .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterZombiePiglinsSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), + FilterEndermenSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterShulkersSetting.genericCombat(false), FilterInvisibleSetting.genericCombat(true), FilterNamedSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index 548034c2c9..5159174d76 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -79,7 +79,7 @@ public final class KillauraLegitHack extends Hack FilterSleepingSetting.genericCombat(true), FilterFlyingSetting.genericCombat(0.5), FilterHostileSetting.genericCombat(false), - FilterEndermenSetting + FilterNeutralSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), @@ -92,6 +92,8 @@ public final class KillauraLegitHack extends Hack .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterZombiePiglinsSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), + FilterEndermenSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.genericCombat(false), FilterInvisibleSetting.genericCombat(true), diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index d7d6d5b8f9..66f27ea946 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -53,7 +53,7 @@ public final class ProtectHack extends Hack FilterSleepingSetting.genericCombat(false), FilterFlyingSetting.genericCombat(0), FilterHostileSetting.genericCombat(false), - FilterEndermenSetting + FilterNeutralSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), @@ -66,6 +66,8 @@ public final class ProtectHack extends Hack .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterZombiePiglinsSetting .genericCombat(FilterZombiePiglinsSetting.Mode.OFF), + FilterEndermenSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.genericCombat(false), FilterInvisibleSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java index 41ba3c523b..27ab5d68cd 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java @@ -34,6 +34,10 @@ public static AnchorAuraFilterList create() + " zombies and creepers when auto-placing anchors." + damageWarning, true)); + builder.add(new FilterNeutralSetting("Won't target neutral mobs like" + + " endermen and wolves when auto-placing anchors." + damageWarning, + AttackDetectingEntityFilter.Mode.ON)); + builder.add(new FilterPassiveSetting("Won't target animals like pigs" + " and cows, ambient mobs like bats, and water mobs like fish," + " squid and dolphins when auto-placing anchors." + damageWarning, diff --git a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java index d239fca0bc..b64279c33e 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java @@ -34,6 +34,10 @@ public static CrystalAuraFilterList create() + " zombies and creepers when auto-placing crystals." + damageWarning, true)); + builder.add(new FilterNeutralSetting("Won't target neutral mobs like" + + " endermen and wolves when auto-placing crystals." + + damageWarning, AttackDetectingEntityFilter.Mode.ON)); + builder.add(new FilterPassiveSetting("Won't target animals like pigs" + " and cows, ambient mobs like bats, and water mobs like fish," + " squid and dolphins when auto-placing crystals." + damageWarning, diff --git a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java index 45c5a1a515..223a58de5e 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java @@ -56,7 +56,7 @@ public static EntityFilterList genericCombat() FilterSleepingSetting.genericCombat(false), FilterFlyingSetting.genericCombat(0), FilterHostileSetting.genericCombat(false), - FilterEndermenSetting + FilterNeutralSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), @@ -69,6 +69,8 @@ public static EntityFilterList genericCombat() .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterZombiePiglinsSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), + FilterEndermenSetting + .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterShulkersSetting.genericCombat(false), FilterAllaysSetting.genericCombat(false), FilterInvisibleSetting.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 83c9e0a934..c0bcfca566 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -36,8 +36,8 @@ public static FollowFilterList create() builder.add(new FilterHostileSetting( "Won't follow hostile mobs like zombies and creepers.", true)); - builder.add( - FilterEndermenSetting.onOffOnly("Won't follow endermen.", true)); + builder.add(FilterNeutralSetting.onOffOnly( + "Won't follow neutral mobs like endermen and wolves.", true)); builder.add(new FilterPassiveSetting("Won't follow animals like pigs" + " and cows, ambient mobs like bats, and water mobs like" @@ -67,6 +67,9 @@ public static FollowFilterList create() builder.add(FilterZombiePiglinsSetting .onOffOnly("Won't follow zombified piglins.", true)); + builder.add( + FilterEndermenSetting.onOffOnly("Won't follow endermen.", true)); + builder.add(new FilterShulkersSetting("Won't follow shulkers.", true)); builder.add(new FilterAllaysSetting("Won't follow allays.", true)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java index 896c0b064d..c96d360939 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -23,7 +23,7 @@ public static MobEspFilterList create() { ArrayList builder = new ArrayList<>(); builder.add(FilterHostileSetting.genericVision(false)); - builder.add(FilterEndermenSetting + builder.add(FilterNeutralSetting .genericVision(AttackDetectingEntityFilter.Mode.OFF)); builder.add(FilterPassiveSetting.genericVision(false)); builder.add(FilterBatsSetting.genericVision(false)); @@ -35,6 +35,8 @@ public static MobEspFilterList create() .genericVision(AttackDetectingEntityFilter.Mode.OFF)); builder.add(FilterZombiePiglinsSetting .genericVision(AttackDetectingEntityFilter.Mode.OFF)); + builder.add(FilterEndermenSetting + .genericVision(AttackDetectingEntityFilter.Mode.OFF)); builder.add(FilterShulkersSetting.genericVision(false)); builder.add(FilterAllaysSetting.genericVision(false)); builder.add(FilterInvisibleSetting.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 c3ca36de9f..7d940f9738 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -36,8 +36,8 @@ public static RemoteViewFilterList create() builder.add(new FilterHostileSetting( "Won't view hostile mobs like zombies and creepers.", true)); - builder - .add(FilterEndermenSetting.onOffOnly("Won't view endermen.", true)); + builder.add(FilterNeutralSetting.onOffOnly( + "Won't view neutral mobs like endermen and wolves.", true)); builder.add(new FilterPassiveSetting("Won't view animals like pigs and" + " cows, ambient mobs like bats, and water mobs like fish, squid" @@ -67,6 +67,9 @@ public static RemoteViewFilterList create() builder.add(FilterZombiePiglinsSetting .onOffOnly("Won't view zombified piglins.", true)); + builder + .add(FilterEndermenSetting.onOffOnly("Won't view endermen.", true)); + builder.add(new FilterShulkersSetting("Won't view shulkers.", true)); builder.add(new FilterAllaysSetting("Won't view allays.", true)); diff --git a/src/main/java/net/wurstclient/settings/filters/FilterNeutralSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterNeutralSetting.java new file mode 100644 index 0000000000..48c94dc665 --- /dev/null +++ b/src/main/java/net/wurstclient/settings/filters/FilterNeutralSetting.java @@ -0,0 +1,77 @@ +/* + * 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.MobEntity; +import net.minecraft.entity.mob.PiglinEntity; +import net.minecraft.entity.passive.PufferfishEntity; + +public final class FilterNeutralSetting extends AttackDetectingEntityFilter +{ + private FilterNeutralSetting(String description, Mode selected, + boolean checked) + { + super("Filter neutral mobs", description, selected, checked); + } + + public FilterNeutralSetting(String description, Mode selected) + { + this(description, selected, false); + } + + @Override + public boolean onTest(Entity e) + { + return !(e instanceof Angerable || e instanceof PufferfishEntity + || e instanceof PiglinEntity); + } + + @Override + public boolean ifCalmTest(Entity e) + { + // special case for pufferfish + if(e instanceof PufferfishEntity pfe) + return pfe.getPuffState() > 0; + + if(e instanceof Angerable || e instanceof PiglinEntity) + if(e instanceof MobEntity me) + return me.isAttacking(); + + return true; + } + + public static FilterNeutralSetting genericCombat(Mode selected) + { + return new FilterNeutralSetting("When set to \u00a7lOn\u00a7r," + + " neutral mobs won't be attacked at all.\n\n" + + "When set to \u00a7lIf calm\u00a7r, neutral mobs won't be" + + " attacked until they attack first. Be warned that this filter" + + " cannot detect if the neutral mobs are attacking you or someone" + + " else.\n\n" + + "When set to \u00a7lOff\u00a7r, this filter does nothing and" + + " neutral mobs can be attacked.", selected); + } + + public static FilterNeutralSetting genericVision(Mode selected) + { + return new FilterNeutralSetting("When set to \u00a7lOn\u00a7r," + + " neutral mobs won't be shown at all.\n\n" + + "When set to \u00a7lIf calm\u00a7r, neutral mobs won't be shown" + + " until they attack something.\n\n" + + "When set to \u00a7lOff\u00a7r, this filter does nothing and" + + " neutral mobs can be shown.", selected); + } + + public static FilterNeutralSetting onOffOnly(String description, + boolean onByDefault) + { + return new FilterNeutralSetting(description, null, onByDefault); + } +} From cc3c8dedb9d5f6309d425a567f84642858878276 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 18 Oct 2023 14:31:03 +0200 Subject: [PATCH 49/61] Update actions/stale to v8 --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 5b86f9b74e..446ff89a0f 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -11,7 +11,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v4 + - uses: actions/stale@v8 with: stale-issue-message: | This issue has been open for a while with no recent activity. If this issue is still important to you, please add a comment within the next 7 days to keep it open. Otherwise, the issue will be automatically closed to free up time for other tasks. From 102885c68c0b87615b1cda53facf87e8e6d6df3f Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 18 Oct 2023 17:22:43 +0200 Subject: [PATCH 50/61] Add FilterPassiveWaterSetting --- .../net/wurstclient/hacks/AimAssistHack.java | 1 + .../wurstclient/hacks/KillauraLegitHack.java | 1 + .../net/wurstclient/hacks/ProtectHack.java | 1 + .../java/net/wurstclient/hacks/RadarHack.java | 2 + .../filterlists/AnchorAuraFilterList.java | 4 ++ .../filterlists/CrystalAuraFilterList.java | 4 ++ .../filterlists/EntityFilterList.java | 1 + .../filterlists/FollowFilterList.java | 3 ++ .../filterlists/MobEspFilterList.java | 1 + .../filterlists/RemoteViewFilterList.java | 3 ++ .../filters/FilterPassiveWaterSetting.java | 48 +++++++++++++++++++ 11 files changed, 69 insertions(+) create mode 100644 src/main/java/net/wurstclient/settings/filters/FilterPassiveWaterSetting.java diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 24b49fb630..3f4ba60448 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -56,6 +56,7 @@ public final class AimAssistHack extends Hack FilterNeutralSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(true), + FilterPassiveWaterSetting.genericCombat(true), FilterBabiesSetting.genericCombat(true), FilterBatsSetting.genericCombat(true), FilterPetsSetting.genericCombat(true), diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index 5159174d76..f720ca85af 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -82,6 +82,7 @@ public final class KillauraLegitHack extends Hack FilterNeutralSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(false), + FilterPassiveWaterSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), FilterBatsSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index 66f27ea946..7055a3a9b2 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -56,6 +56,7 @@ public final class ProtectHack extends Hack FilterNeutralSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(false), + FilterPassiveWaterSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), FilterBatsSetting.genericCombat(false), FilterPetsSetting.genericCombat(false), diff --git a/src/main/java/net/wurstclient/hacks/RadarHack.java b/src/main/java/net/wurstclient/hacks/RadarHack.java index 85683869fb..16e98010e7 100644 --- a/src/main/java/net/wurstclient/hacks/RadarHack.java +++ b/src/main/java/net/wurstclient/hacks/RadarHack.java @@ -31,6 +31,7 @@ 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.util.FakePlayerEntity; @@ -51,6 +52,7 @@ public final class RadarHack extends Hack implements UpdateListener FilterSleepingSetting.genericVision(false), FilterHostileSetting.genericVision(false), FilterPassiveSetting.genericVision(false), + FilterPassiveWaterSetting.genericVision(false), FilterBatsSetting.genericVision(true), FilterInvisibleSetting.genericVision(false)); diff --git a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java index 27ab5d68cd..c639816c9c 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java @@ -43,6 +43,10 @@ public static AnchorAuraFilterList create() + " squid and dolphins when auto-placing anchors." + damageWarning, true)); + builder.add(new FilterPassiveWaterSetting("Won't target passive water" + + " mobs like fish, squid, dolphins and axolotls when auto-placing" + + " anchors." + damageWarning, true)); + builder.add(new FilterBatsSetting("Won't target bats and any other" + " \"ambient\" mobs 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 b64279c33e..776b7ec920 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java @@ -43,6 +43,10 @@ public static CrystalAuraFilterList create() + " squid and dolphins when auto-placing crystals." + damageWarning, true)); + builder.add(new FilterPassiveWaterSetting("Won't target passive water" + + " mobs like fish, squid, dolphins and axolotls when auto-placing" + + " crystals." + damageWarning, true)); + builder.add(new FilterBatsSetting("Won't target bats and any other" + " \"ambient\" mobs 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 223a58de5e..6de9163806 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java @@ -59,6 +59,7 @@ public static EntityFilterList genericCombat() FilterNeutralSetting .genericCombat(AttackDetectingEntityFilter.Mode.OFF), FilterPassiveSetting.genericCombat(false), + FilterPassiveWaterSetting.genericCombat(false), FilterBabiesSetting.genericCombat(false), FilterBatsSetting.genericCombat(false), FilterPetsSetting.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 c0bcfca566..7d0a33368e 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -43,6 +43,9 @@ public static FollowFilterList create() + " and cows, ambient mobs like bats, and water mobs like" + " fish, squid and dolphins.", true)); + builder.add(new FilterPassiveWaterSetting("Won't follow passive water" + + " mobs like fish, squid, dolphins and axolotls.", true)); + builder.add(new FilterBabiesSetting( "Won't follow baby pigs, baby villagers, 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 c96d360939..ae17f6de89 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java @@ -26,6 +26,7 @@ public static MobEspFilterList create() builder.add(FilterNeutralSetting .genericVision(AttackDetectingEntityFilter.Mode.OFF)); builder.add(FilterPassiveSetting.genericVision(false)); + builder.add(FilterPassiveWaterSetting.genericVision(false)); builder.add(FilterBatsSetting.genericVision(false)); builder.add(FilterPetsSetting.genericVision(false)); builder.add(FilterVillagersSetting.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 7d940f9738..fbc731c52f 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -43,6 +43,9 @@ public static RemoteViewFilterList create() + " cows, ambient mobs like bats, and water mobs like fish, squid" + " and dolphins.", true)); + builder.add(new FilterPassiveWaterSetting("Won't view passive water" + + " mobs like fish, squid, dolphins and axolotls.", true)); + builder.add(new FilterBabiesSetting( "Won't view baby pigs, baby villagers, etc.", true)); diff --git a/src/main/java/net/wurstclient/settings/filters/FilterPassiveWaterSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterPassiveWaterSetting.java new file mode 100644 index 0000000000..86664dc322 --- /dev/null +++ b/src/main/java/net/wurstclient/settings/filters/FilterPassiveWaterSetting.java @@ -0,0 +1,48 @@ +/* + * 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.WaterCreatureEntity; +import net.minecraft.entity.passive.AxolotlEntity; +import net.minecraft.entity.passive.PufferfishEntity; + +public final class FilterPassiveWaterSetting extends EntityFilterCheckbox +{ + private static final String EXCEPTIONS_TEXT = + "\n\nThis filter does not affect guardians, drowned, and pufferfish."; + + public FilterPassiveWaterSetting(String description, boolean checked) + { + super("Filter passive water mobs", description + EXCEPTIONS_TEXT, + checked); + } + + @Override + public boolean test(Entity e) + { + // never filter out pufferfish + if(e instanceof PufferfishEntity) + return true; + + return !(e instanceof WaterCreatureEntity + || e instanceof AxolotlEntity); + } + + public static FilterPassiveWaterSetting genericCombat(boolean checked) + { + return new FilterPassiveWaterSetting("Won't attack passive water mobs" + + " like fish, squid, dolphins and axolotls.", checked); + } + + public static FilterPassiveWaterSetting genericVision(boolean checked) + { + return new FilterPassiveWaterSetting("Won't show passive water mobs" + + " like fish, squid, dolphins and axolotls.", checked); + } +} From dd847ee6d23673963d90502fa1b8c8db3ef12709 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 18 Oct 2023 23:13:43 +0200 Subject: [PATCH 51/61] Add FilterSlimesSetting --- .../net/wurstclient/hacks/AimAssistHack.java | 1 + .../wurstclient/hacks/KillauraLegitHack.java | 1 + .../net/wurstclient/hacks/ProtectHack.java | 1 + .../java/net/wurstclient/hacks/RadarHack.java | 9 +---- .../filterlists/AnchorAuraFilterList.java | 3 ++ .../filterlists/CrystalAuraFilterList.java | 3 ++ .../filterlists/EntityFilterList.java | 1 + .../filterlists/FollowFilterList.java | 2 + .../filterlists/MobEspFilterList.java | 1 + .../filterlists/RemoteViewFilterList.java | 2 + .../settings/filters/FilterSlimesSetting.java | 39 +++++++++++++++++++ 11 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 src/main/java/net/wurstclient/settings/filters/FilterSlimesSetting.java 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); + } +} From a17ac45c07c01191be499c1e0774dbec51ab33c9 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Wed, 18 Oct 2023 23:18:08 +0200 Subject: [PATCH 52/61] Merge MobEspFilterList back into MobEspHack --- .../net/wurstclient/hacks/MobEspHack.java | 25 +++++++++- .../filterlists/MobEspFilterList.java | 48 ------------------- 2 files changed, 23 insertions(+), 50 deletions(-) delete mode 100644 src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java diff --git a/src/main/java/net/wurstclient/hacks/MobEspHack.java b/src/main/java/net/wurstclient/hacks/MobEspHack.java index f4fce2472a..d18f657a47 100644 --- a/src/main/java/net/wurstclient/hacks/MobEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobEspHack.java @@ -39,7 +39,7 @@ import net.wurstclient.settings.EspBoxSizeSetting; import net.wurstclient.settings.EspStyleSetting; import net.wurstclient.settings.filterlists.EntityFilterList; -import net.wurstclient.settings.filterlists.MobEspFilterList; +import net.wurstclient.settings.filters.*; import net.wurstclient.util.EntityUtils; import net.wurstclient.util.RegionPos; import net.wurstclient.util.RenderUtils; @@ -55,7 +55,28 @@ public final class MobEspHack extends Hack implements UpdateListener, "\u00a7lAccurate\u00a7r mode shows the exact hitbox of each mob.\n" + "\u00a7lFancy\u00a7r mode shows slightly larger boxes that look better."); - private final EntityFilterList entityFilters = MobEspFilterList.create(); + private final EntityFilterList entityFilters = + new EntityFilterList(FilterHostileSetting.genericVision(false), + FilterNeutralSetting + .genericVision(AttackDetectingEntityFilter.Mode.OFF), + FilterPassiveSetting.genericVision(false), + FilterPassiveWaterSetting.genericVision(false), + FilterBatsSetting.genericVision(false), + FilterSlimesSetting.genericVision(false), + FilterPetsSetting.genericVision(false), + FilterVillagersSetting.genericVision(false), + FilterZombieVillagersSetting.genericVision(false), + FilterGolemsSetting.genericVision(false), + FilterPiglinsSetting + .genericVision(AttackDetectingEntityFilter.Mode.OFF), + FilterZombiePiglinsSetting + .genericVision(AttackDetectingEntityFilter.Mode.OFF), + FilterEndermenSetting + .genericVision(AttackDetectingEntityFilter.Mode.OFF), + FilterShulkersSetting.genericVision(false), + FilterAllaysSetting.genericVision(false), + FilterInvisibleSetting.genericVision(false), + FilterArmorStandsSetting.genericVision(true)); private final ArrayList mobs = new ArrayList<>(); private VertexBuffer mobBox; diff --git a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java deleted file mode 100644 index d04864da96..0000000000 --- a/src/main/java/net/wurstclient/settings/filterlists/MobEspFilterList.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.filterlists; - -import java.util.ArrayList; -import java.util.List; - -import net.wurstclient.settings.filters.*; - -public final class MobEspFilterList extends EntityFilterList -{ - private MobEspFilterList(List filters) - { - super(filters); - } - - public static MobEspFilterList create() - { - ArrayList builder = new ArrayList<>(); - builder.add(FilterHostileSetting.genericVision(false)); - builder.add(FilterNeutralSetting - .genericVision(AttackDetectingEntityFilter.Mode.OFF)); - 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)); - builder.add(FilterGolemsSetting.genericVision(false)); - builder.add(FilterPiglinsSetting - .genericVision(AttackDetectingEntityFilter.Mode.OFF)); - builder.add(FilterZombiePiglinsSetting - .genericVision(AttackDetectingEntityFilter.Mode.OFF)); - builder.add(FilterEndermenSetting - .genericVision(AttackDetectingEntityFilter.Mode.OFF)); - builder.add(FilterShulkersSetting.genericVision(false)); - builder.add(FilterAllaysSetting.genericVision(false)); - builder.add(FilterInvisibleSetting.genericVision(false)); - builder.add(FilterArmorStandsSetting.genericVision(true)); - return new MobEspFilterList(builder); - } -} From 65118e8feaedf10a3b32d7211c512521e0182d07 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 19 Oct 2023 21:58:57 +0200 Subject: [PATCH 53/61] Attempt to fix stale bot See https://github.com/actions/stale/issues/792 --- .github/workflows/stale.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 446ff89a0f..aa21f4db85 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -11,7 +11,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v8 + - uses: actions/stale@main with: stale-issue-message: | This issue has been open for a while with no recent activity. If this issue is still important to you, please add a comment within the next 7 days to keep it open. Otherwise, the issue will be automatically closed to free up time for other tasks. @@ -33,3 +33,5 @@ jobs: days-before-close: 7 stale-issue-label: "status:stale" stale-pr-label: "status:stale" + operations-per-run: 60 + enable-statistics: true From 01d25e3e1c9c1f6b25f97cad9b90553ee064a865 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 19 Oct 2023 22:10:17 +0200 Subject: [PATCH 54/61] Refactor FilterSleepingSetting --- .../wurstclient/settings/filters/FilterSleepingSetting.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java index 7f76b197fb..b78d0c7155 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java @@ -21,10 +21,10 @@ public FilterSleepingSetting(String description, boolean checked) @Override public boolean test(Entity e) { - if(!(e instanceof PlayerEntity)) + if(!(e instanceof PlayerEntity pe)) return true; - - return e.getPose() != EntityPose.SLEEPING && !((PlayerEntity)e).isSleeping(); + + return !pe.isSleeping() && pe.getPose() != EntityPose.SLEEPING; } public static FilterSleepingSetting genericCombat(boolean checked) From e573edb5cd891b6b1c7b0c2833a726077ffcf203 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Thu, 19 Oct 2023 22:32:50 +0200 Subject: [PATCH 55/61] Make AimAssist and TriggerBot compatible with each other Closes #855 --- src/main/java/net/wurstclient/hacks/AimAssistHack.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 38bae783c2..d8ab2f0592 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -105,7 +105,6 @@ protected void onEnable() WURST.getHax().killauraLegitHack.setEnabled(false); WURST.getHax().multiAuraHack.setEnabled(false); WURST.getHax().protectHack.setEnabled(false); - WURST.getHax().triggerBotHack.setEnabled(false); WURST.getHax().tpAuraHack.setEnabled(false); EVENTS.add(UpdateListener.class, this); From 929266584bfb5c1ef65f4277b311b92662c03acd Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 20 Oct 2023 11:28:53 +0200 Subject: [PATCH 56/61] Prevent CI from failing if VirusTotal upload fails --- .github/workflows/gradle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 42e26139a4..ca9850e8e3 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -40,3 +40,4 @@ jobs: vt_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }} files: | ./build/libs/*.jar + continue-on-error: true From 106eee459fa48a36fb58450684c58f176847c7bc Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Fri, 20 Oct 2023 17:23:36 +0200 Subject: [PATCH 57/61] Fix typo --- src/main/resources/assets/wurst/lang/ja_jp.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/wurst/lang/ja_jp.json b/src/main/resources/assets/wurst/lang/ja_jp.json index b5a3f8d9f8..2f2eae7e45 100644 --- a/src/main/resources/assets/wurst/lang/ja_jp.json +++ b/src/main/resources/assets/wurst/lang/ja_jp.json @@ -16,7 +16,7 @@ "description.wurst.setting.arrowdmg.trident_yeet_mode": "有効時、トライデントがより遠くまで飛ばせるようになる。ダメージ量や激流エンチャントには影響しない模様。\n\n§c§l注意: §rこのオプションを有効化した場合、トライデントをロストしやすくなる。", "description.wurst.hack.autoarmor": "防具を自動で管理する。", "description.wurst.hack.autobuild": "自動で建築を行う。\nブロックを一つ設置することで建築が開始される。", - "description.wurst.hack.autocomplete": "大規模な言語モデルを使用してチャット メッセージをオートコンプリートします。 API アクセスのある OpenAI アカウント、または oababooga Web UI を使用してローカルにインストールされた言語モデルのいずれかが必要です。", + "description.wurst.hack.autocomplete": "大規模な言語モデルを使用してチャット メッセージをオートコンプリートします。 API アクセスのある OpenAI アカウント、または oobabooga Web UI を使用してローカルにインストールされた言語モデルのいずれかが必要です。", "description.wurst.hack.autodrop": "必要のないアイテムを自動で捨てる。", "description.wurst.hack.autoleave": "残り体力が少なくなるとに自動的にサーバーから切断する。", "description.wurst.hack.autolibrarian": "村人を自動的に訓練して、特定の魔法の本を販売する司書にします。 このハックを使用すると、すぐに取引ホール全体をセットアップできます。", @@ -189,4 +189,4 @@ "description.wurst.nochatreports.message_is_reportable": "このメッセージには有効な署名があるため、不正なチャット レポートに対して脆弱です。", "gui.wurst.generic.allcaps_blocked": "ブロックされました", "gui.wurst.generic.allcaps_allowed": "許可された" -} \ No newline at end of file +} From 55afc91a513496f8889ffe3008e8c8ce6d7bea43 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sat, 21 Oct 2023 12:48:10 +0200 Subject: [PATCH 58/61] Fix KillauraLegit attacking through blocks Closes #804 --- .../java/net/wurstclient/hacks/KillauraLegitHack.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index 29752c90ae..7572fefb3c 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -37,6 +37,7 @@ import net.wurstclient.settings.SliderSetting.ValueDisplay; import net.wurstclient.settings.filterlists.EntityFilterList; import net.wurstclient.settings.filters.*; +import net.wurstclient.util.BlockUtils; import net.wurstclient.util.EntityUtils; import net.wurstclient.util.RegionPos; import net.wurstclient.util.RenderUtils; @@ -179,6 +180,13 @@ public void onUpdate() WURST.getHax().autoSwordHack.setSlot(); + // check line of sight + if(!BlockUtils.hasLineOfSight(target.getBoundingBox().getCenter())) + { + target = null; + return; + } + // face entity if(!faceEntityClient(target)) return; From b1076bd0b220f19b776f6099057772fb93dd93fd Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Sun, 22 Oct 2023 12:00:20 +0200 Subject: [PATCH 59/61] Pause stale bot on weekends and reduce ops per run back to 30 --- .github/workflows/stale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index aa21f4db85..d03ba0245c 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,7 +1,7 @@ name: "Close stale issues and pull requests" on: schedule: - - cron: "30 1 * * *" + - cron: "30 1 * * 1-5" permissions: issues: write @@ -33,5 +33,5 @@ jobs: days-before-close: 7 stale-issue-label: "status:stale" stale-pr-label: "status:stale" - operations-per-run: 60 + operations-per-run: 30 enable-statistics: true From c4189fbb073cb6fe1a513b30ccf730fa74a03384 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 23 Oct 2023 15:59:09 +0200 Subject: [PATCH 60/61] Simplify AntiBlind mixins --- .../net/wurstclient/hacks/AntiBlindHack.java | 3 +- .../mixin/BackgroundRendererMixin.java | 14 --------- .../mixin/ClientPlayerEntityMixin.java | 3 ++ .../mixin/LightTextureManagerMixin.java | 30 ------------------- src/main/resources/wurst.mixins.json | 1 - 5 files changed, 5 insertions(+), 46 deletions(-) delete mode 100644 src/main/java/net/wurstclient/mixin/LightTextureManagerMixin.java diff --git a/src/main/java/net/wurstclient/hacks/AntiBlindHack.java b/src/main/java/net/wurstclient/hacks/AntiBlindHack.java index dc9ea4042c..fc76a3a2ff 100644 --- a/src/main/java/net/wurstclient/hacks/AntiBlindHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiBlindHack.java @@ -23,5 +23,6 @@ public AntiBlindHack() setCategory(Category.RENDER); } - // See BackgroundRendererMixin, LightTextureManagerMixin, WorldRendererMixin + // See BackgroundRendererMixin, WorldRendererMixin, + // ClientPlayerEntityMixin.hasStatusEffect() } diff --git a/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java b/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java index 70df223b05..62e03146b2 100644 --- a/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java @@ -10,14 +10,11 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import net.minecraft.client.render.BackgroundRenderer; import net.minecraft.client.render.BackgroundRenderer.StatusEffectFogModifier; import net.minecraft.entity.Entity; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.effect.StatusEffect; import net.wurstclient.WurstClient; @Mixin(BackgroundRenderer.class) @@ -32,15 +29,4 @@ private static void onGetFogModifier(Entity entity, float tickDelta, if(WurstClient.INSTANCE.getHax().antiBlindHack.isEnabled()) ci.setReturnValue(null); } - - @Redirect(at = @At(value = "INVOKE", - target = "Lnet/minecraft/entity/LivingEntity;hasStatusEffect(Lnet/minecraft/entity/effect/StatusEffect;)Z", - ordinal = 1), method = "render(Lnet/minecraft/client/render/Camera;FLnet/minecraft/client/world/ClientWorld;IF)V") - private static boolean onCheckDarkness(LivingEntity living, StatusEffect effect) - { - if(WurstClient.INSTANCE.getHax().antiBlindHack.isEnabled()) - return false; - - return living.hasStatusEffect(effect); - } } diff --git a/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java b/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java index 38e5a130e1..55aeac4e8c 100644 --- a/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java @@ -270,6 +270,9 @@ public boolean hasStatusEffect(StatusEffect effect) && hax.noLevitationHack.isEnabled()) return false; + if(effect == StatusEffects.DARKNESS && hax.antiBlindHack.isEnabled()) + return false; + return super.hasStatusEffect(effect); } } diff --git a/src/main/java/net/wurstclient/mixin/LightTextureManagerMixin.java b/src/main/java/net/wurstclient/mixin/LightTextureManagerMixin.java deleted file mode 100644 index 684e118239..0000000000 --- a/src/main/java/net/wurstclient/mixin/LightTextureManagerMixin.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.client.render.LightmapTextureManager; -import net.wurstclient.WurstClient; - -@Mixin(LightmapTextureManager.class) -public class LightTextureManagerMixin -{ - @Inject(at = @At("HEAD"), - method = "getDarknessFactor(F)F", - cancellable = true) - private void onGetDarknessFactor(float delta, - CallbackInfoReturnable ci) - { - if(WurstClient.INSTANCE.getHax().antiBlindHack.isEnabled()) - ci.setReturnValue(0F); - } -} diff --git a/src/main/resources/wurst.mixins.json b/src/main/resources/wurst.mixins.json index b650abf67c..5f3cbbb07d 100644 --- a/src/main/resources/wurst.mixins.json +++ b/src/main/resources/wurst.mixins.json @@ -40,7 +40,6 @@ "KeyBindingMixin", "KeyboardMixin", "LanguageManagerMixin", - "LightTextureManagerMixin", "LivingEntityRendererMixin", "MinecraftClientMixin", "MouseMixin", From beb493569873210964ba0e43d177ca6e904f42c6 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Mon, 23 Oct 2023 17:31:20 +0200 Subject: [PATCH 61/61] Update Fabric stuff --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index a8ed75891f..92f4456b7d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,10 +7,10 @@ org.gradle.parallel=true # https://www.curseforge.com/minecraft/mc-mods/fabric-api minecraft_version=1.20.2 yarn_mappings=1.20.2+build.4 -loader_version=0.14.22 +loader_version=0.14.23 #Fabric api -fabric_version=0.89.3+1.20.2 +fabric_version=0.90.4+1.20.2 # Mod Properties mod_version = v7.38-MC1.20.2