@Override protected void actionPerformed(GuiButton b) { // ReikaJavaLibrary.pConsole(this.getClickCooldown()+" @ "+b.id+" > // "+buttonList.size()+":"+buttonList); // ReikaJavaLibrary.pConsole(b.id+":"+this.getClickCooldown()); // Thread.dumpStack(); if (this.getClickCooldown() < 1) return; switch (b.id) { case 0: if (dx == 0) { if (index > 0) { dx++; this.markButtons(false); } else { index = list.size() - 1; } } break; case 1: if (dx == 0) { if (index < list.size() - 1) { dx--; this.markButtons(false); } else { index = 0; } } break; case 2: index = 0; ReikaPacketHelper.sendStringPacket( ChromatiCraft.packetChannel, ChromaPackets.ASPECT.ordinal(), "", tile); break; case 3: mode = mode.next(); ReikaPacketHelper.sendDataPacket( ChromatiCraft.packetChannel, ChromaPackets.ASPECTMODE.ordinal(), tile); index = 0; ReikaPacketHelper.sendStringPacket( ChromatiCraft.packetChannel, ChromaPackets.ASPECT.ordinal(), "", tile); this.initGui(); for (int i = 0; i < 3; i++) ((GuiButton) buttonList.get(i)).visible = mode == AspectMode.DEMAND; break; } // this.initGui(); }
@Override protected void mouseClicked(int x, int y, int button) { super.mouseClicked(x, y, button); int j = (width - xSize) / 2; int k = (height - ySize) / 2; int minx = 120; int miny = 24; int w = 36; int maxx = minx + w; int maxy = miny + w; if (mode == AspectMode.DEMAND) { if (api.isMouseInBox(j + minx, j + maxx, k + miny, k + maxy)) { // Minecraft.getMinecraft().thePlayer.playSound("random.click", 1, 1); ReikaSoundHelper.playClientSound(ChromaSounds.GUICLICK, player, 1, 1); clickDelay = 90; ReikaPacketHelper.sendStringPacket( ChromatiCraft.packetChannel, ChromaPackets.ASPECT.ordinal(), this.getActive().getTag(), tile); } } }