Package thaumic.tinkerer.common.network.packet

Examples of thaumic.tinkerer.common.network.packet.PacketEnchanterAddEnchant


    if (par1GuiButton.id == 0) {
      ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterStartWorking(enchanter));
    } else if (par1GuiButton.id <= 16) {
      GuiButtonEnchantment button = enchantButtons[par1GuiButton.id - 1];
      if (button != null && button.enchant != null)
        ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(enchanter, button.enchant.effectId, 0));
    } else {
      int type = (par1GuiButton.id - 17) % 3;
      int index = (par1GuiButton.id - 17) / 3;

      if (index >= enchanter.enchantments.size() || index >= enchanter.levels.size())
        return;

      int level = enchanter.levels.get(index);

      Enchantment enchant = Enchantment.enchantmentsList[enchanter.enchantments.get(index)];

      switch (type) {
        case 0: {
          ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(enchanter, enchant.effectId, -1));
          break;
        }
        case 1: {
          ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(enchanter, enchant.effectId, level == 1 ? -1 : level - 1));
          break;
        }
        case 2: {
          ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterAddEnchant(enchanter, enchant.effectId, level + 1));
          break;
        }
      }
    }
View Full Code Here

TOP

Related Classes of thaumic.tinkerer.common.network.packet.PacketEnchanterAddEnchant

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.