Skip to content

Commit

Permalink
Close classic creative screen when pressing inventory key
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Jun 27, 2024
1 parent 687e33e commit 87f0634
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,9 @@ public void register() {
});
}

@Inject(method = "init", at = @At("HEAD"))
public void resetSnowing(CallbackInfo ci) {
CPEAdditions.setSnowing(false);
}

}

0 comments on commit 87f0634

Please sign in to comment.