Close classic creative screen when pressing inventory key

This commit is contained in:
FlorianMichael 2024-06-27 20:29:30 +02:00
parent 687e33ef1c
commit 87f0634fcc
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
2 changed files with 14 additions and 0 deletions

View File

@ -90,6 +90,15 @@ public class GridItemSelectionScreen extends VFPScreen {
return super.mouseClicked(mouseX, mouseY, button);
}
@Override
public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
if (client.options.inventoryKey.matchesKey(keyCode, scanCode)) {
this.close();
return true;
}
return super.keyPressed(keyCode, scanCode, modifiers);
}
@Override
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
final int halfWidth = this.width / 2;

View File

@ -65,4 +65,9 @@ public abstract class MixinProtocolc0_30cpeToc0_28_30 extends AbstractProtocol<C
});
}
@Inject(method = "init", at = @At("HEAD"))
public void resetSnowing(CallbackInfo ci) {
CPEAdditions.setSnowing(false);
}
}