summaryrefslogtreecommitdiffstats
path: root/src/main/java/com
diff options
context:
space:
mode:
authorAizistral2022-07-30 13:05:22 +0200
committerAizistral2022-07-30 13:05:22 +0200
commit11f0c7df85fb2efa7bfd262cc3beb1dd854f60d0 (patch)
tree2f10d5e7923c1114f33bf308db67bce181d925b6 /src/main/java/com
parent05125d6f21b5cce6ab15668ef8c7484e92c2b5b1 (diff)
Style changes
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatOptionsScreen.java87
1 files changed, 43 insertions, 44 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatOptionsScreen.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatOptionsScreen.java
index 3163908..263abc0 100644
--- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatOptionsScreen.java
+++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatOptionsScreen.java
@@ -17,48 +17,47 @@ import java.util.List;
@Mixin(ChatOptionsScreen.class)
public class MixinChatOptionsScreen extends SimpleOptionsSubScreen {
- private AbstractWidget onlyShowSecureChat;
-
- /**
- * @implNote Using {@link net.minecraft.client.gui.Font#split} because
- * {@link net.minecraft.client.OptionInstance#splitTooltip(Minecraft, Component)} is protected.
- * Field {@link net.minecraft.client.gui.screens.Screen#minecraft} is not used because it can be null.
- * @author Kevinthegreat
- */
- @SuppressWarnings({"JavaDoc", "JavadocReference"})
- private final List<FormattedCharSequence> secureChatTooltip = Minecraft.getInstance().font.split(Component.translatable("gui.nochatreport.secureChat"), 200);
-
- public MixinChatOptionsScreen(Screen screen, Options options, Component component, OptionInstance<?>[] optionInstances) {
- super(screen, options, component, optionInstances);
- }
-
- /**
- * Gray out the only show secure chat option by deactivating the button when the screen is initialized.
- *
- * @author Kevinthegreat
- */
-
- @Override
- protected void init() {
- super.init();
- onlyShowSecureChat = list.findOption(Minecraft.getInstance().options.onlyShowSecureChat());
- if (onlyShowSecureChat != null) {
- onlyShowSecureChat.active = false;
- }
- }
-
- /**
- * Render the tooltip on mouseover for only show secure chat option.
- * Minecraft only render tooltips when the widget is active.
- *
- * @author Kevinthegreat
- */
-
- @Override
- public void render(@NotNull PoseStack poseStack, int x, int y, float f) {
- super.render(poseStack, x, y, f);
- if (onlyShowSecureChat != null && onlyShowSecureChat.visible && x >= (double) onlyShowSecureChat.x && y >= (double) onlyShowSecureChat.y && x < (double) (onlyShowSecureChat.x + onlyShowSecureChat.getWidth()) && y < (double) (onlyShowSecureChat.y + onlyShowSecureChat.getHeight())) {
- renderTooltip(poseStack, secureChatTooltip, x, y);
- }
- }
+ private AbstractWidget onlyShowSecureChat;
+
+ /**
+ * @implNote Using {@link net.minecraft.client.gui.Font#split} because
+ * {@link net.minecraft.client.OptionInstance#splitTooltip(Minecraft, Component)} is protected.
+ * Field {@link net.minecraft.client.gui.screens.Screen#minecraft} is not used because it can be null.
+ * @author Kevinthegreat
+ */
+ @SuppressWarnings({"JavaDoc", "JavadocReference"})
+ private final List<FormattedCharSequence> secureChatTooltip = Minecraft.getInstance().font.split(Component.translatable("gui.nochatreport.secureChat"), 200);
+
+ public MixinChatOptionsScreen(Screen screen, Options options, Component component, OptionInstance<?>[] optionInstances) {
+ super(screen, options, component, optionInstances);
+ throw new IllegalStateException("Can't touch this");
+ }
+
+ /**
+ * Gray out the only show secure chat option by deactivating the button when the screen is initialized.
+ * @author Kevinthegreat
+ */
+
+ @Override
+ protected void init() {
+ super.init();
+ this.onlyShowSecureChat = this.list.findOption(Minecraft.getInstance().options.onlyShowSecureChat());
+ if (this.onlyShowSecureChat != null) {
+ this.onlyShowSecureChat.active = false;
+ }
+ }
+
+ /**
+ * Render the tooltip on mouseover for only show secure chat option.
+ * Minecraft only render tooltips when the widget is active.
+ * @author Kevinthegreat
+ */
+
+ @Override
+ public void render(@NotNull PoseStack poseStack, int x, int y, float f) {
+ super.render(poseStack, x, y, f);
+ if (this.onlyShowSecureChat != null && this.onlyShowSecureChat.visible && x >= (double) this.onlyShowSecureChat.x && y >= (double) this.onlyShowSecureChat.y && x < (double) (this.onlyShowSecureChat.x + this.onlyShowSecureChat.getWidth()) && y < (double) (this.onlyShowSecureChat.y + this.onlyShowSecureChat.getHeight())) {
+ this.renderTooltip(poseStack, this.secureChatTooltip, x, y);
+ }
+ }
}