@Override public void onPacketBool(EntityPlayer player, int id, boolean bool) { for (Map.Entry<GuiCheckBox, RarmorSettings.Settings> entry : this.checks.entrySet()) { if (entry.getValue().ordinal() == id) { entry.getKey().setState(bool); RarmorSettings.setSetting(RarmorUtil.getRarmorChestplate(player), entry.getValue(), bool); } } }
@SideOnly(Side.CLIENT) @Override public void onMouseClick( GuiContainer gui, EntityPlayer player, int guiLeft, int guiTop, int mouseX, int mouseY, int btnID) { if (btnID == 0) { for (GuiCheckBox box : this.checks.keySet()) { if (box.isMouseOver(guiLeft, guiTop, mouseX, mouseY)) { box.onMouseClick(guiLeft, guiTop, mouseX, mouseY); RarmorSettings.setSetting( RarmorUtil.getRarmorChestplate(player), this.checks.get(box), box.getState()); RarmorUtil.syncBoolToServer(player, this, this.checks.get(box).ordinal(), box.getState()); } } } }
@Override public void initContainer(Container container, EntityPlayer player) { if (!player.worldObj.isRemote) { RarmorUtil.syncTab((EntityPlayerMP) player, this); } }