package dev.crucifixbeta.mod.gui.items.buttons;

import dev.crucifixbeta.api.utils.i18n.LangUtil;
import dev.crucifixbeta.api.utils.render.Render2DUtil;
import dev.crucifixbeta.mod.modules.impl.client.ClickGui;
import dev.crucifixbeta.mod.modules.settings.impl.EnumSetting;
import java.awt.Color;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.InputUtil;
import net.minecraft.util.Formatting;

@Environment(EnvType.CLIENT)
public class EnumButton extends Button {
   public final EnumSetting<?> setting;
   private boolean open;

   public EnumButton(EnumSetting<?> setting) {
      super(setting.getName());
      this.setting = setting;
   }

   @Override
   public void drawScreen(DrawContext context, int mouseX, int mouseY, float partialTicks) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.NullPointerException: Cannot invoke "org.jetbrains.java.decompiler.struct.gen.VarType.isGeneric()" because "newRet" is null
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.getInferredExprType(InvocationExprent.java:634)
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.FunctionExprent.getInferredExprType(FunctionExprent.java:243)
      //   at org.jetbrains.java.decompiler.modules.decompiler.stats.DoStatement.toJava(DoStatement.java:146)
      //   at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.jmpWrapper(ExprProcessor.java:833)
      //   at org.jetbrains.java.decompiler.modules.decompiler.stats.SequenceStatement.toJava(SequenceStatement.java:107)
      //   at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.jmpWrapper(ExprProcessor.java:833)
      //   at org.jetbrains.java.decompiler.modules.decompiler.stats.IfStatement.toJava(IfStatement.java:241)
      //   at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.jmpWrapper(ExprProcessor.java:833)
      //   at org.jetbrains.java.decompiler.modules.decompiler.stats.SequenceStatement.toJava(SequenceStatement.java:107)
      //   at org.jetbrains.java.decompiler.modules.decompiler.stats.RootStatement.toJava(RootStatement.java:36)
      //   at org.jetbrains.java.decompiler.main.ClassWriter.writeMethod(ClassWriter.java:1283)
      //
      // Bytecode:
      // 000: aload 0
      // 001: iload 2
      // 002: iload 3
      // 003: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.isHovering (II)Z
      // 006: istore 5
      // 008: aload 0
      // 009: iload 5
      // 00b: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.updateHoverSound (Z)V
      // 00e: aload 0
      // 00f: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.getColorDelay ()D
      // 012: dstore 6
      // 014: aload 0
      // 015: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.width I
      // 018: i2f
      // 019: ldc 7.0
      // 01b: fadd
      // 01c: fstore 8
      // 01e: aload 0
      // 01f: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.height I
      // 022: i2f
      // 023: ldc 0.5
      // 025: fsub
      // 026: fstore 9
      // 028: invokestatic dev/crucifixbeta/mod/modules/impl/client/ClickGui.getInstance ()Ldev/crucifixbeta/mod/modules/impl/client/ClickGui;
      // 02b: getfield dev/crucifixbeta/mod/modules/impl/client/ClickGui.colorMode Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;
      // 02e: invokevirtual dev/crucifixbeta/mod/modules/settings/impl/EnumSetting.getValue ()Ljava/lang/Enum;
      // 031: getstatic dev/crucifixbeta/mod/modules/impl/client/ClickGui$ColorMode.Spectrum Ldev/crucifixbeta/mod/modules/impl/client/ClickGui$ColorMode;
      // 034: if_acmpne 07e
      // 037: aload 0
      // 038: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.getState ()Z
      // 03b: ifeq 07e
      // 03e: iload 5
      // 040: ifeq 04f
      // 043: invokestatic dev/crucifixbeta/mod/modules/impl/client/ClickGui.getInstance ()Ldev/crucifixbeta/mod/modules/impl/client/ClickGui;
      // 046: getfield dev/crucifixbeta/mod/modules/impl/client/ClickGui.hoverAlpha Ldev/crucifixbeta/mod/modules/settings/impl/SliderSetting;
      // 049: invokevirtual dev/crucifixbeta/mod/modules/settings/impl/SliderSetting.getValueInt ()I
      // 04c: goto 058
      // 04f: invokestatic dev/crucifixbeta/mod/modules/impl/client/ClickGui.getInstance ()Ldev/crucifixbeta/mod/modules/impl/client/ClickGui;
      // 052: getfield dev/crucifixbeta/mod/modules/impl/client/ClickGui.alpha Ldev/crucifixbeta/mod/modules/settings/impl/SliderSetting;
      // 055: invokevirtual dev/crucifixbeta/mod/modules/settings/impl/SliderSetting.getValueInt ()I
      // 058: istore 10
      // 05a: aload 1
      // 05b: invokevirtual net/minecraft/client/gui/DrawContext.getMatrices ()Lnet/minecraft/client/util/math/MatrixStack;
      // 05e: aload 0
      // 05f: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.x F
      // 062: aload 0
      // 063: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.y F
      // 066: fload 8
      // 068: fload 9
      // 06a: invokestatic dev/crucifixbeta/mod/modules/impl/client/ClickGui.getInstance ()Ldev/crucifixbeta/mod/modules/impl/client/ClickGui;
      // 06d: invokevirtual dev/crucifixbeta/mod/modules/impl/client/ClickGui.getSpectrumLutId ()Lnet/minecraft/util/Identifier;
      // 070: invokestatic dev/crucifixbeta/mod/modules/impl/client/ClickGui.getInstance ()Ldev/crucifixbeta/mod/modules/impl/client/ClickGui;
      // 073: invokevirtual dev/crucifixbeta/mod/modules/impl/client/ClickGui.getSpectrumLutHeight ()I
      // 076: iload 10
      // 078: invokestatic dev/crucifixbeta/api/utils/render/Render2DUtil.drawLutRect (Lnet/minecraft/client/util/math/MatrixStack;FFFFLnet/minecraft/util/Identifier;II)V
      // 07b: goto 0c8
      // 07e: invokestatic dev/crucifixbeta/mod/modules/impl/client/ClickGui.getInstance ()Ldev/crucifixbeta/mod/modules/impl/client/ClickGui;
      // 081: dload 6
      // 083: invokevirtual dev/crucifixbeta/mod/modules/impl/client/ClickGui.getColor (D)Ljava/awt/Color;
      // 086: astore 10
      // 088: aload 1
      // 089: invokevirtual net/minecraft/client/gui/DrawContext.getMatrices ()Lnet/minecraft/client/util/math/MatrixStack;
      // 08c: aload 0
      // 08d: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.x F
      // 090: aload 0
      // 091: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.y F
      // 094: aload 0
      // 095: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.x F
      // 098: fload 8
      // 09a: fadd
      // 09b: aload 0
      // 09c: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.y F
      // 09f: aload 0
      // 0a0: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.height I
      // 0a3: i2f
      // 0a4: fadd
      // 0a5: ldc 0.5
      // 0a7: fsub
      // 0a8: aload 0
      // 0a9: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.getState ()Z
      // 0ac: ifeq 0b7
      // 0af: aload 10
      // 0b1: invokevirtual java/awt/Color.getRGB ()I
      // 0b4: goto 0c5
      // 0b7: iload 5
      // 0b9: ifne 0c2
      // 0bc: getstatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.defaultColor I
      // 0bf: goto 0c5
      // 0c2: getstatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.hoverColor I
      // 0c5: invokestatic dev/crucifixbeta/api/utils/render/Render2DUtil.rect (Lnet/minecraft/client/util/math/MatrixStack;FFFFI)V
      // 0c8: aload 0
      // 0c9: aload 0
      // 0ca: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.y F
      // 0cd: aload 0
      // 0ce: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.height I
      // 0d1: i2f
      // 0d2: ldc 0.5
      // 0d4: fsub
      // 0d5: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.getCenteredTextY (FF)F
      // 0d8: fstore 10
      // 0da: aload 0
      // 0db: iload 2
      // 0dc: iload 3
      // 0dd: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.isHovering (II)Z
      // 0e0: ifeq 135
      // 0e3: getstatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.mc Lnet/minecraft/client/MinecraftClient;
      // 0e6: invokevirtual net/minecraft/client/MinecraftClient.getWindow ()Lnet/minecraft/client/util/Window;
      // 0e9: invokevirtual net/minecraft/client/util/Window.getHandle ()J
      // 0ec: sipush 340
      // 0ef: invokestatic net/minecraft/client/util/InputUtil.isKeyPressed (JI)Z
      // 0f2: ifeq 135
      // 0f5: aload 0
      // 0f6: aload 0
      // 0f7: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.setting Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;
      // 0fa: invokevirtual dev/crucifixbeta/mod/modules/settings/impl/EnumSetting.getName ()Ljava/lang/String;
      // 0fd: ldc -581238784
      // 0ff: i2c
      // 100: invokestatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.a (C)Ljava/lang/Object;
      // 103: checkcast java/lang/String
      // 106: invokevirtual java/lang/String.equalsIgnoreCase (Ljava/lang/String;)Z
      // 109: ifeq 118
      // 10c: ldc 1211891713
      // 10e: i2c
      // 10f: invokestatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.a (C)Ljava/lang/Object;
      // 112: checkcast java/lang/String
      // 115: goto 121
      // 118: ldc 83689474
      // 11a: i2c
      // 11b: invokestatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.a (C)Ljava/lang/Object;
      // 11e: checkcast java/lang/String
      // 121: aload 0
      // 122: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.x F
      // 125: ldc 2.3
      // 127: fadd
      // 128: f2d
      // 129: fload 10
      // 12b: f2d
      // 12c: getstatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.enableTextColor I
      // 12f: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.drawString (Ljava/lang/String;DDI)V
      // 132: goto 198
      // 135: aload 0
      // 136: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.setting Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;
      // 139: invokevirtual dev/crucifixbeta/mod/modules/settings/impl/EnumSetting.getValue ()Ljava/lang/Enum;
      // 13c: astore 11
      // 13e: aload 11
      // 140: invokevirtual java/lang/Enum.name ()Ljava/lang/String;
      // 143: ldc -394330109
      // 145: i2c
      // 146: invokestatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.a (C)Ljava/lang/Object;
      // 149: checkcast java/lang/String
      // 14c: invokevirtual java/lang/String.equalsIgnoreCase (Ljava/lang/String;)Z
      // 14f: ifeq 15e
      // 152: ldc -367460349
      // 154: i2c
      // 155: invokestatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.a (C)Ljava/lang/Object;
      // 158: checkcast java/lang/String
      // 15b: goto 163
      // 15e: aload 11
      // 160: invokestatic dev/crucifixbeta/api/utils/i18n/LangUtil.enumValue (Ljava/lang/Enum;)Ljava/lang/String;
      // 163: astore 12
      // 165: aload 0
      // 166: aload 0
      // 167: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.setting Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;
      // 16a: invokevirtual dev/crucifixbeta/mod/modules/settings/impl/EnumSetting.getDisplayName ()Ljava/lang/String;
      // 16d: getstatic net/minecraft/util/Formatting.GRAY Lnet/minecraft/util/Formatting;
      // 170: invokestatic java/lang/String.valueOf (Ljava/lang/Object;)Ljava/lang/String;
      // 173: aload 12
      // 175: invokedynamic makeConcatWithConstants (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; bsm=java/lang/invoke/StringConcatFactory.makeConcatWithConstants (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite; args=[ "\u0001 \u0001\u0001" ]
      // 17a: aload 0
      // 17b: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.x F
      // 17e: ldc 2.3
      // 180: fadd
      // 181: f2d
      // 182: fload 10
      // 184: f2d
      // 185: aload 0
      // 186: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.getState ()Z
      // 189: ifeq 192
      // 18c: getstatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.enableTextColor I
      // 18f: goto 195
      // 192: getstatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.defaultTextColor I
      // 195: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.drawSettingString (Ljava/lang/String;DDI)V
      // 198: aload 0
      // 199: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.open Z
      // 19c: ifeq 231
      // 19f: aload 0
      // 1a0: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.y F
      // 1a3: f2i
      // 1a4: istore 11
      // 1a6: aload 0
      // 1a7: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.setting Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;
      // 1aa: invokevirtual dev/crucifixbeta/mod/modules/settings/impl/EnumSetting.getValue ()Ljava/lang/Enum;
      // 1ad: invokevirtual java/lang/Enum.getDeclaringClass ()Ljava/lang/Class;
      // 1b0: invokevirtual java/lang/Class.getEnumConstants ()[Ljava/lang/Object;
      // 1b3: checkcast [Ljava/lang/Enum;
      // 1b6: astore 12
      // 1b8: aload 12
      // 1ba: arraylength
      // 1bb: istore 13
      // 1bd: bipush 0
      // 1be: istore 14
      // 1c0: iload 14
      // 1c2: iload 13
      // 1c4: if_icmpge 231
      // 1c7: aload 12
      // 1c9: iload 14
      // 1cb: aaload
      // 1cc: astore 15
      // 1ce: aload 15
      // 1d0: invokestatic dev/crucifixbeta/api/utils/i18n/LangUtil.enumValue (Ljava/lang/Enum;)Ljava/lang/String;
      // 1d3: astore 16
      // 1d5: aload 0
      // 1d6: iload 11
      // 1d8: i2f
      // 1d9: aload 0
      // 1da: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.height I
      // 1dd: i2f
      // 1de: fadd
      // 1df: fconst_1
      // 1e0: fadd
      // 1e1: ldc 11.0
      // 1e3: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.getCenteredTextY (FF)F
      // 1e6: fstore 17
      // 1e8: aload 0
      // 1e9: aload 16
      // 1eb: aload 0
      // 1ec: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.width I
      // 1ef: i2f
      // 1f0: fconst_2
      // 1f1: fdiv
      // 1f2: aload 0
      // 1f3: aload 16
      // 1f5: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.getSettingWidth (Ljava/lang/String;)I
      // 1f8: i2f
      // 1f9: fconst_2
      // 1fa: fdiv
      // 1fb: fsub
      // 1fc: fconst_2
      // 1fd: fadd
      // 1fe: aload 0
      // 1ff: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.x F
      // 202: fadd
      // 203: f2d
      // 204: fload 17
      // 206: f2d
      // 207: aload 0
      // 208: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.setting Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;
      // 20b: invokevirtual dev/crucifixbeta/mod/modules/settings/impl/EnumSetting.getValue ()Ljava/lang/Enum;
      // 20e: invokevirtual java/lang/Enum.name ()Ljava/lang/String;
      // 211: aload 15
      // 213: invokevirtual java/lang/Enum.name ()Ljava/lang/String;
      // 216: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 219: ifeq 222
      // 21c: getstatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.enableTextColor I
      // 21f: goto 225
      // 222: getstatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.defaultTextColor I
      // 225: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.drawSettingString (Ljava/lang/String;DDI)V
      // 228: iinc 11 11
      // 22b: iinc 14 1
      // 22e: goto 1c0
      // 231: return
   }

   @Override
   public void update() {
      this.setHidden(!this.setting.isVisible());
   }

   @Override
   public void mouseClicked(int mouseX, int mouseY, int mouseButton) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.NullPointerException: Cannot invoke "org.jetbrains.java.decompiler.struct.gen.VarType.isGeneric()" because "newRet" is null
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.getInferredExprType(InvocationExprent.java:634)
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.FunctionExprent.getInferredExprType(FunctionExprent.java:243)
      //   at org.jetbrains.java.decompiler.modules.decompiler.stats.DoStatement.toJava(DoStatement.java:146)
      //   at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.jmpWrapper(ExprProcessor.java:833)
      //   at org.jetbrains.java.decompiler.modules.decompiler.stats.SequenceStatement.toJava(SequenceStatement.java:107)
      //   at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.jmpWrapper(ExprProcessor.java:833)
      //   at org.jetbrains.java.decompiler.modules.decompiler.stats.IfStatement.toJava(IfStatement.java:241)
      //   at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.jmpWrapper(ExprProcessor.java:833)
      //   at org.jetbrains.java.decompiler.modules.decompiler.stats.IfStatement.toJava(IfStatement.java:254)
      //   at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.jmpWrapper(ExprProcessor.java:833)
      //   at org.jetbrains.java.decompiler.modules.decompiler.stats.SequenceStatement.toJava(SequenceStatement.java:107)
      //   at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.jmpWrapper(ExprProcessor.java:833)
      //   at org.jetbrains.java.decompiler.modules.decompiler.stats.IfStatement.toJava(IfStatement.java:241)
      //   at org.jetbrains.java.decompiler.modules.decompiler.stats.RootStatement.toJava(RootStatement.java:36)
      //   at org.jetbrains.java.decompiler.main.ClassWriter.writeMethod(ClassWriter.java:1283)
      //
      // Bytecode:
      // 000: iload 3
      // 001: ifne 0c7
      // 004: aload 0
      // 005: iload 1
      // 006: iload 2
      // 007: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.isHovering (II)Z
      // 00a: ifeq 0c7
      // 00d: getstatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.mc Lnet/minecraft/client/MinecraftClient;
      // 010: invokevirtual net/minecraft/client/MinecraftClient.getWindow ()Lnet/minecraft/client/util/Window;
      // 013: invokevirtual net/minecraft/client/util/Window.getHandle ()J
      // 016: sipush 340
      // 019: invokestatic net/minecraft/client/util/InputUtil.isKeyPressed (JI)Z
      // 01c: ifeq 0c7
      // 01f: aload 0
      // 020: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.setting Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;
      // 023: invokevirtual dev/crucifixbeta/mod/modules/settings/impl/EnumSetting.getName ()Ljava/lang/String;
      // 026: ldc_w 1844641792
      // 029: i2c
      // 02a: invokestatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.a (C)Ljava/lang/Object;
      // 02d: checkcast java/lang/String
      // 030: invokevirtual java/lang/String.equalsIgnoreCase (Ljava/lang/String;)Z
      // 033: ifeq 0ae
      // 036: bipush 0
      // 037: istore 4
      // 039: invokestatic dev/crucifixbeta/mod/gui/clickgui/ClickGuiScreen.getInstance ()Ldev/crucifixbeta/mod/gui/clickgui/ClickGuiScreen;
      // 03c: invokevirtual dev/crucifixbeta/mod/gui/clickgui/ClickGuiScreen.getComponents ()Ljava/util/ArrayList;
      // 03f: invokevirtual java/util/ArrayList.iterator ()Ljava/util/Iterator;
      // 042: astore 5
      // 044: aload 5
      // 046: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 04b: ifeq 0aa
      // 04e: aload 5
      // 050: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 055: checkcast dev/crucifixbeta/mod/gui/items/Component
      // 058: astore 6
      // 05a: aload 6
      // 05c: invokevirtual dev/crucifixbeta/mod/gui/items/Component.getItems ()Ljava/util/List;
      // 05f: invokeinterface java/util/List.iterator ()Ljava/util/Iterator; 1
      // 064: astore 7
      // 066: aload 7
      // 068: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 06d: ifeq 0a2
      // 070: aload 7
      // 072: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 077: checkcast dev/crucifixbeta/mod/gui/items/buttons/ModuleButton
      // 07a: astore 8
      // 07c: aload 8
      // 07e: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/ModuleButton.getModule ()Ldev/crucifixbeta/mod/modules/Module;
      // 081: invokevirtual dev/crucifixbeta/mod/modules/Module.getSettings ()Ljava/util/List;
      // 084: aload 0
      // 085: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.setting Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;
      // 088: invokeinterface java/util/List.contains (Ljava/lang/Object;)Z 2
      // 08d: ifne 093
      // 090: goto 066
      // 093: aload 8
      // 095: aload 0
      // 096: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.setting Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;
      // 099: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/ModuleButton.resetPageSettingsToDefault (Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;)V
      // 09c: bipush 1
      // 09d: istore 4
      // 09f: goto 0a2
      // 0a2: iload 4
      // 0a4: ifne 0aa
      // 0a7: goto 044
      // 0aa: invokestatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.sound ()V
      // 0ad: return
      // 0ae: aload 0
      // 0af: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.setting Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;
      // 0b2: invokevirtual dev/crucifixbeta/mod/modules/settings/impl/EnumSetting.getDefaultValue ()Ljava/lang/Enum;
      // 0b5: astore 4
      // 0b7: aload 0
      // 0b8: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.setting Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;
      // 0bb: aload 4
      // 0bd: invokevirtual java/lang/Enum.name ()Ljava/lang/String;
      // 0c0: invokevirtual dev/crucifixbeta/mod/modules/settings/impl/EnumSetting.setEnumValue (Ljava/lang/String;)V
      // 0c3: invokestatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.sound ()V
      // 0c6: return
      // 0c7: aload 0
      // 0c8: iload 1
      // 0c9: iload 2
      // 0ca: iload 3
      // 0cb: invokespecial dev/crucifixbeta/mod/gui/items/buttons/Button.mouseClicked (III)V
      // 0ce: iload 3
      // 0cf: bipush 1
      // 0d0: if_icmpne 0f2
      // 0d3: aload 0
      // 0d4: iload 1
      // 0d5: iload 2
      // 0d6: invokevirtual dev/crucifixbeta/mod/gui/items/buttons/EnumButton.isHovering (II)Z
      // 0d9: ifeq 0f2
      // 0dc: aload 0
      // 0dd: aload 0
      // 0de: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.open Z
      // 0e1: ifne 0e8
      // 0e4: bipush 1
      // 0e5: goto 0e9
      // 0e8: bipush 0
      // 0e9: putfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.open Z
      // 0ec: invokestatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.sound ()V
      // 0ef: goto 17b
      // 0f2: iload 3
      // 0f3: ifne 17b
      // 0f6: aload 0
      // 0f7: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.open Z
      // 0fa: ifeq 17b
      // 0fd: aload 0
      // 0fe: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.y F
      // 101: f2i
      // 102: istore 4
      // 104: aload 0
      // 105: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.setting Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;
      // 108: invokevirtual dev/crucifixbeta/mod/modules/settings/impl/EnumSetting.getValue ()Ljava/lang/Enum;
      // 10b: invokevirtual java/lang/Enum.getDeclaringClass ()Ljava/lang/Class;
      // 10e: invokevirtual java/lang/Class.getEnumConstants ()[Ljava/lang/Object;
      // 111: checkcast [Ljava/lang/Enum;
      // 114: astore 5
      // 116: aload 5
      // 118: arraylength
      // 119: istore 6
      // 11b: bipush 0
      // 11c: istore 7
      // 11e: iload 7
      // 120: iload 6
      // 122: if_icmpge 17b
      // 125: aload 5
      // 127: iload 7
      // 129: aaload
      // 12a: astore 8
      // 12c: iload 1
      // 12d: i2f
      // 12e: aload 0
      // 12f: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.x F
      // 132: fcmpl
      // 133: ifle 172
      // 136: iload 1
      // 137: i2f
      // 138: aload 0
      // 139: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.x F
      // 13c: aload 0
      // 13d: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.width I
      // 140: i2f
      // 141: fadd
      // 142: fcmpg
      // 143: ifge 172
      // 146: iload 2
      // 147: iload 4
      // 149: aload 0
      // 14a: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.height I
      // 14d: iadd
      // 14e: bipush 1
      // 14f: iadd
      // 150: if_icmplt 172
      // 153: iload 2
      // 154: iload 4
      // 156: aload 0
      // 157: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.height I
      // 15a: iadd
      // 15b: bipush 11
      // 15d: iadd
      // 15e: bipush 1
      // 15f: iadd
      // 160: if_icmpge 172
      // 163: aload 0
      // 164: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.setting Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;
      // 167: aload 8
      // 169: invokestatic java/lang/String.valueOf (Ljava/lang/Object;)Ljava/lang/String;
      // 16c: invokevirtual dev/crucifixbeta/mod/modules/settings/impl/EnumSetting.setEnumValue (Ljava/lang/String;)V
      // 16f: invokestatic dev/crucifixbeta/mod/gui/items/buttons/EnumButton.sound ()V
      // 172: iinc 4 11
      // 175: iinc 7 1
      // 178: goto 11e
      // 17b: return
   }

   @Override
   public int getHeight() {
      return super.getHeight() + (this.open ? 11 * this.setting.getValue().getDeclaringClass().getEnumConstants().length : 0);
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.NullPointerException: Cannot invoke "org.jetbrains.java.decompiler.struct.gen.VarType.isGeneric()" because "newRet" is null
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.getInferredExprType(InvocationExprent.java:634)
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.FunctionExprent.getInferredExprType(FunctionExprent.java:243)
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.FunctionExprent.getInferredExprType(FunctionExprent.java:313)
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.FunctionExprent.getInferredExprType(FunctionExprent.java:313)
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.FunctionExprent.getInferredExprType(FunctionExprent.java:287)
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.FunctionExprent.getInferredExprType(FunctionExprent.java:313)
      //   at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.getCastedExprent(ExprProcessor.java:966)
      //   at org.jetbrains.java.decompiler.modules.decompiler.exps.ExitExprent.toJava(ExitExprent.java:86)
      //   at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.listToJava(ExprProcessor.java:895)
      //   at org.jetbrains.java.decompiler.modules.decompiler.stats.BasicBlockStatement.toJava(BasicBlockStatement.java:90)
      //   at org.jetbrains.java.decompiler.modules.decompiler.stats.RootStatement.toJava(RootStatement.java:36)
      //   at org.jetbrains.java.decompiler.main.ClassWriter.writeMethod(ClassWriter.java:1283)
      //
      // Bytecode:
      // 00: aload 0
      // 01: invokespecial dev/crucifixbeta/mod/gui/items/buttons/Button.getHeight ()I
      // 04: aload 0
      // 05: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.open Z
      // 08: ifeq 22
      // 0b: bipush 11
      // 0d: aload 0
      // 0e: getfield dev/crucifixbeta/mod/gui/items/buttons/EnumButton.setting Ldev/crucifixbeta/mod/modules/settings/impl/EnumSetting;
      // 11: invokevirtual dev/crucifixbeta/mod/modules/settings/impl/EnumSetting.getValue ()Ljava/lang/Enum;
      // 14: invokevirtual java/lang/Enum.getDeclaringClass ()Ljava/lang/Class;
      // 17: invokevirtual java/lang/Class.getEnumConstants ()[Ljava/lang/Object;
      // 1a: checkcast [Ljava/lang/Enum;
      // 1d: arraylength
      // 1e: imul
      // 1f: goto 23
      // 22: bipush 0
      // 23: iadd
      // 24: ireturn
   }

   @Override
   public void toggle() {
      this.setting.increaseEnum();
   }

   @Override
   public boolean getState() {
      return true;
   }
}
