Skip to content

Commit

Permalink
fix using the hotbar in buildphaser
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeRNG committed May 18, 2024
1 parent aea6ea5 commit 1dedf12
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main/java/dev/dfonline/codeclient/mixin/MMouse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package dev.dfonline.codeclient.mixin;

import dev.dfonline.codeclient.dev.BuildPhaser;
import net.minecraft.client.Mouse;
import net.minecraft.client.network.ClientPlayerEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(Mouse.class)
public class MMouse {
@Redirect(method = "onMouseScroll", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isSpectator()Z"))
public boolean spectator(ClientPlayerEntity instance) {
if(BuildPhaser.isClipping()) return false;
else return instance.isSpectator();
}
}
1 change: 1 addition & 0 deletions src/main/resources/CodeClient.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"MChatScreen",
"MHandledScreens",
"MKeyboard",
"MMouse",
"entity.MEntity",
"entity.MLivingEntity",
"entity.player.ClientPlayerInteractionManagerAccessor",
Expand Down

0 comments on commit 1dedf12

Please sign in to comment.