1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-14 04:00:30 +00:00

Allow using mouse in off-hand pocket computer screen (#918)

This commit is contained in:
MAGGen-hub 2021-09-19 13:24:55 +03:00 committed by GitHub
parent 2aa70b49c1
commit 647902c019
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -43,6 +43,10 @@ public class NoTermComputerScreen<T extends ContainerComputerBase> extends Scree
@Override @Override
protected void init() protected void init()
{ {
this.passEvents = true; // to allow gui click events pass through mouseHelper protection (see MouseHelper.OnPres:105 code string)
minecraft.mouseHandler.grabMouse();
minecraft.screen = this;
super.init(); super.init();
minecraft.keyboardHandler.setSendRepeatsToGui( true ); minecraft.keyboardHandler.setSendRepeatsToGui( true );
@ -66,6 +70,13 @@ public class NoTermComputerScreen<T extends ContainerComputerBase> extends Scree
terminal.update(); terminal.update();
} }
@Override
public boolean mouseScrolled( double pMouseX, double pMouseY, double pDelta )
{
minecraft.player.inventory.swapPaint( pDelta );
return super.mouseScrolled( pMouseX, pMouseY, pDelta );
}
@Override @Override
public void onClose() public void onClose()
{ {

View File

@ -5,3 +5,4 @@ public net.minecraft.client.renderer.FirstPersonRenderer func_228403_a_(Lcom/moj
# ClientTableFormatter # ClientTableFormatter
public net.minecraft.client.gui.NewChatGui func_146234_a(Lnet/minecraft/util/text/ITextComponent;I)V # printChatMessageWithOptionalDeletion public net.minecraft.client.gui.NewChatGui func_146234_a(Lnet/minecraft/util/text/ITextComponent;I)V # printChatMessageWithOptionalDeletion
public net.minecraft.client.gui.NewChatGui func_146242_c(I)V # deleteChatLine public net.minecraft.client.gui.NewChatGui func_146242_c(I)V # deleteChatLine
public net.minecraft.client.Minecraft field_71462_r # currentScreen