예제 #1
0
 @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);
     }
   }
 }
예제 #2
0
 @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());
       }
     }
   }
 }
예제 #3
0
 @Override
 public void initContainer(Container container, EntityPlayer player) {
   if (!player.worldObj.isRemote) {
     RarmorUtil.syncTab((EntityPlayerMP) player, this);
   }
 }