This repository has been archived by the owner on Oct 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
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
1 parent
6c487ec
commit 9184262
Showing
23 changed files
with
1,195 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/cally72jhb/addon/mixin/MinecraftClientMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cally72jhb.addon.mixin; | ||
|
||
import cally72jhb.addon.system.events.InteractEvent; | ||
import cally72jhb.addon.system.modules.player.MultiTask; | ||
import meteordevelopment.meteorclient.MeteorClient; | ||
import meteordevelopment.meteorclient.systems.modules.Modules; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.network.ClientPlayerEntity; | ||
import net.minecraft.client.network.ClientPlayerInteractionManager; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(MinecraftClient.class) | ||
public class MinecraftClientMixin { | ||
@Redirect(method = "handleBlockBreaking", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isUsingItem()Z")) | ||
public boolean onHandleBlockBreaking(ClientPlayerEntity player) { | ||
return !Modules.get().isActive(MultiTask.class) && MeteorClient.EVENT_BUS.post(InteractEvent.get(player.isUsingItem())).usingItem; | ||
} | ||
|
||
@Redirect(method = "doItemUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;isBreakingBlock()Z")) | ||
public boolean onDoItemUse(ClientPlayerInteractionManager manager) { | ||
return !Modules.get().isActive(MultiTask.class) && MeteorClient.EVENT_BUS.post(InteractEvent.get(manager.isBreakingBlock())).usingItem; | ||
} | ||
} |
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
1 change: 0 additions & 1 deletion
1
src/main/java/cally72jhb/addon/system/commands/TrashCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/cally72jhb/addon/system/events/InteractEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package cally72jhb.addon.system.events; | ||
|
||
public class InteractEvent { | ||
private static final InteractEvent INSTANCE = new InteractEvent(); | ||
public boolean usingItem; | ||
|
||
public static InteractEvent get(boolean usingItem) { | ||
INSTANCE.usingItem = usingItem; | ||
return INSTANCE; | ||
} | ||
} |
Oops, something went wrong.