Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BarrierEsp #743

Merged
merged 9 commits into from
Nov 16, 2023
1 change: 1 addition & 0 deletions src/main/java/net/wurstclient/hack/HackList.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public final class HackList implements UpdateListener
public final AutoToolHack autoToolHack = new AutoToolHack();
public final AutoTotemHack autoTotemHack = new AutoTotemHack();
public final AutoWalkHack autoWalkHack = new AutoWalkHack();
public final BarrierEspHack barrierEspHack = new BarrierEspHack();
public final BaseFinderHack baseFinderHack = new BaseFinderHack();
public final BlinkHack blinkHack = new BlinkHack();
public final BoatFlyHack boatFlyHack = new BoatFlyHack();
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/net/wurstclient/hacks/BarrierEspHack.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.hack.Hack;

@SearchTags({"barrier esp"})
public class BarrierEspHack extends Hack
{
public BarrierEspHack()
{
super("BarrierESP");
setCategory(Category.RENDER);
}

// See ClientWorldMixin
}
51 changes: 51 additions & 0 deletions src/main/java/net/wurstclient/mixin/ClientWorldMixin.java
Original file line number Diff line number Diff line change
@@ -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.mixin;

import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
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.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.item.Items;
import net.minecraft.world.GameMode;
import net.wurstclient.WurstClient;

@Mixin(ClientWorld.class)
public class ClientWorldMixin
{
@Shadow
@Final
private MinecraftClient client;

/**
* This is the part that makes BarrierESP work.
*/
@Inject(at = @At("HEAD"),
method = "getBlockParticle()Lnet/minecraft/block/Block;",
cancellable = true)
Alexander01998 marked this conversation as resolved.
Show resolved Hide resolved
private void getBlockParticle(CallbackInfoReturnable<Block> cir)
{
if(!WurstClient.INSTANCE.getHax().barrierEspHack.isEnabled())
return;
Alexander01998 marked this conversation as resolved.
Show resolved Hide resolved

// Pause BarrierESP when holding a light in Creative Mode, since it
// would otherwise prevent the player from seeing light blocks.
if(client.interactionManager.getCurrentGameMode() == GameMode.CREATIVE
&& client.player.getMainHandStack().getItem() == Items.LIGHT)
return;
Alexander01998 marked this conversation as resolved.
Show resolved Hide resolved

cir.setReturnValue(Blocks.BARRIER);
Alexander01998 marked this conversation as resolved.
Show resolved Hide resolved
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/wurst/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"description.wurst.hack.autotool": "Automatically equips the fastest applicable tool in your hotbar when you try to break a block.",
"description.wurst.hack.autototem": "Automatically moves totems of undying to your off-hand.",
"description.wurst.hack.autowalk": "Makes you walk automatically.",
"description.wurst.hack.barrieresp": "Allows you to see nearby barrier blocks.\n\nNote: Due to Minecraft bug MC-47607, this hack does not work if your \"Particles\" option is set to \"Minimal\".",
"description.wurst.hack.basefinder": "Finds player bases by searching for man-made blocks.\nThe blocks that it finds will be highlighted in the selected color.\nGood for finding faction bases.",
"description.wurst.hack.blink": "Suspends all motion updates while enabled.",
"description.wurst.hack.boatfly": "Allows you to fly with boats and other vehicles.\nPress the sprint key to go down faster.",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/wurst.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"ClientPlayerEntityMixin",
"ClientPlayerInteractionManagerMixin",
"ClientPlayNetworkHandlerMixin",
"ClientWorldMixin",
"CreativeInventoryScreenMixin",
"DeathScreenMixin",
"DirectConnectScreenMixin",
Expand Down