-
-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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) | ||
private void onGetBlockParticle(CallbackInfoReturnable<Block> cir) | ||
{ | ||
if(!WurstClient.INSTANCE.getHax().barrierEspHack.isEnabled()) | ||
return; | ||
|
||
// 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; | ||
|
||
cir.setReturnValue(Blocks.BARRIER); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters