diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-11-09 02:11:31 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-11-09 02:12:57 +0800 |
| commit | c6f180f73bcbf5aa23b8b741e6a4f617439214e5 (patch) | |
| tree | b004c1be1779747a3f4088fba2a058d514711295 | |
| parent | 2ac4538172cf27cc6873b43c442f3ec203b5057e (diff) | |
| download | RoughlyEnoughItems-c6f180f73bcbf5aa23b8b741e6a4f617439214e5.tar.gz RoughlyEnoughItems-c6f180f73bcbf5aa23b8b741e6a4f617439214e5.tar.bz2 RoughlyEnoughItems-c6f180f73bcbf5aa23b8b741e6a4f617439214e5.zip | |
Make config button yellow if no permission to cheat
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/ConfigButtonWidget.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/ConfigButtonWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/ConfigButtonWidget.java index 12ce8865c..b68708fc6 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/ConfigButtonWidget.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/ConfigButtonWidget.java @@ -68,10 +68,18 @@ public class ConfigButtonWidget { ConfigManager.getInstance().openConfigScreen(REIRuntime.getInstance().getPreviousScreen()); }) .onRender((matrices, button) -> { - if (ClientHelper.getInstance().isCheating() && !(Minecraft.getInstance().screen instanceof DisplayScreen) && ClientHelperImpl.getInstance().hasOperatorPermission()) { - button.setTint(ClientHelperImpl.getInstance().hasPermissionToUsePackets() ? 721354752 : 1476440063); - } else { + if (!ClientHelper.getInstance().isCheating() || Minecraft.getInstance().screen instanceof DisplayScreen) { button.removeTint(); + } else if (!ClientHelperImpl.getInstance().hasOperatorPermission()) { + if (Minecraft.getInstance().gameMode.hasInfiniteItems()) { + button.setTint(0x2aff0000); + } else { + button.setTint(0x58fcf003); + } + } else if (ClientHelperImpl.getInstance().hasPermissionToUsePackets()) { + button.setTint(0x2aff0000); + } else { + button.setTint(0x5800afff); } access.openOrClose(CONFIG_MENU_UUID, button.getBounds(), ConfigButtonWidget::menuEntries); |
