diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-07-18 15:41:13 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-07-18 15:41:13 +0800 |
| commit | d4d23b0b0170f605463c49f5790e7326c7e38cf2 (patch) | |
| tree | 77d6ef0d22d5582158ac966e2ebf99b54a78e197 /src/main/java/me/shedaniel/rei/impl/InternalWidgets.java | |
| parent | d57067c1e6cd6fb400d43cfc4149515df1fb8435 (diff) | |
| download | RoughlyEnoughItems-d4d23b0b0170f605463c49f5790e7326c7e38cf2.tar.gz RoughlyEnoughItems-d4d23b0b0170f605463c49f5790e7326c7e38cf2.tar.bz2 RoughlyEnoughItems-d4d23b0b0170f605463c49f5790e7326c7e38cf2.zip | |
Fix #385 and optimise favourites rendering
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'src/main/java/me/shedaniel/rei/impl/InternalWidgets.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/impl/InternalWidgets.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java b/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java index 497d67727..a74b8121e 100644 --- a/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java +++ b/src/main/java/me/shedaniel/rei/impl/InternalWidgets.java @@ -175,15 +175,27 @@ public final class InternalWidgets { } @Override - public boolean keyPressed(int int_1, int int_2, int int_3) { - if (displaySupplier.get().getRecipeLocation().isPresent() && ConfigObject.getInstance().getCopyRecipeIdentifierKeybind().matchesKey(int_1, int_2) && containsMouse(PointHelper.ofMouse())) { + public boolean keyPressed(int keyCode, int scanCode, int modifiers) { + if (displaySupplier.get().getRecipeLocation().isPresent() && ConfigObject.getInstance().getCopyRecipeIdentifierKeybind().matchesKey(keyCode, scanCode) && containsMouse(PointHelper.ofMouse())) { minecraft.keyboard.setClipboard(displaySupplier.get().getRecipeLocation().get().toString()); if (ConfigObject.getInstance().isToastDisplayedOnCopyIdentifier()) { CopyRecipeIdentifierToast.addToast(I18n.translate("msg.rei.copied_recipe_id"), I18n.translate("msg.rei.recipe_id_details", displaySupplier.get().getRecipeLocation().get().toString())); } return true; } - return super.keyPressed(int_1, int_2, int_3); + return super.keyPressed(keyCode, scanCode, modifiers); + } + + @Override + public boolean mouseClicked(double mouseX, double mouseY, int button) { + if (displaySupplier.get().getRecipeLocation().isPresent() && ConfigObject.getInstance().getCopyRecipeIdentifierKeybind().matchesMouse(button) && containsMouse(PointHelper.ofMouse())) { + minecraft.keyboard.setClipboard(displaySupplier.get().getRecipeLocation().get().toString()); + if (ConfigObject.getInstance().isToastDisplayedOnCopyIdentifier()) { + CopyRecipeIdentifierToast.addToast(I18n.translate("msg.rei.copied_recipe_id"), I18n.translate("msg.rei.recipe_id_details", displaySupplier.get().getRecipeLocation().get().toString())); + } + return true; + } + return super.mouseClicked(mouseX, mouseY, button); } }; } |
