Skip to content

Commit

Permalink
Fix for 1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
PieKing1215 committed Apr 29, 2024
1 parent 62930f9 commit a2d72d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@

@Mixin(Screen.class)
public class BackgroundMixin {
@Group
@Inject(
method = {
"renderTransparentBackground"
},
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;fillGradient(IIIIII)V"),
cancellable = true
)
private void onRenderTransparentBackground(CallbackInfo ci) {
//noinspection ConstantConditions
if (InvMove.instance().shouldDisableScreenBackground((Screen) (Object) this)) {
ci.cancel();
}
}

@Inject(
method = {
"renderBackground*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ public class ButtonJumpKeyFixMixin {
cancellable = true
)
private void keyPressed(int i, int j, int k, CallbackInfoReturnable<Boolean> cir) {
// if button recieved space key it normally clicks the button
// if button received space key it normally clicks the button
// but if the player can jump in this inventory we cancel that
// (fix for https://github.com/PieKing1215/InvMove/issues/2)
if (i == 32 && InvMoveConfig.GENERAL.ENABLED.get() && InvMoveConfig.MOVEMENT.ENABLED.get() && InvMoveConfig.MOVEMENT.JUMP.get()) {
// TODO: consider doing this a better way
if(!((AbstractButton)(Object)this instanceof MerchantScreen.TradeOfferButton)) {
System.out.println(this + " " + i + " " + j + " " + k);
if (InvMove.instance().allowMovementInScreen(Minecraft.getInstance().screen)) {
cir.setReturnValue(false);
}
Expand Down

0 comments on commit a2d72d8

Please # to comment.