use of minechem.network.message.PolytoolUpdateMessage in project Minechem by iopleke.
the class PolytoolInventory method setInventorySlotContents.
@Override
public void setInventorySlotContents(int i, ItemStack itemstack) {
item = itemstack;
if (itemstack != null && itemstack.stackSize == 64 && (itemstack.getItem() instanceof ElementItem) && PolytoolHelper.getTypeFromElement(ElementItem.getElement(itemstack), 1) != null && PolytoolItem.validAlloyInfusion(player.getCurrentEquippedItem(), itemstack)) {
item = null;
PolytoolUpgradeType upgrade = PolytoolHelper.getTypeFromElement(ElementItem.getElement(itemstack), 1);
PolytoolItem.addTypeToNBT(player.inventory.getCurrentItem(), upgrade);
if (!player.worldObj.isRemote) {
PolytoolUpdateMessage message = new PolytoolUpdateMessage(upgrade);
MessageHandler.INSTANCE.sendTo(message, (EntityPlayerMP) player);
}
}
}
Aggregations