use of pneumaticCraft.common.network.PacketUpdateSearchStack in project PneumaticCraft by MineMaarten.
the class GuiSearchUpgradeOptions method initGui.
@Override
public void initGui(IGuiScreen gui) {
gui.getButtonList().add(new GuiButton(10, 30, 40, 150, 20, "Search for item..."));
gui.getButtonList().add(new GuiButton(11, 30, 128, 150, 20, "Move Stat Screen..."));
if (searchGui != null && player.getCurrentArmor(3) != null) {
ItemStack searchStack = searchGui.getSearchStack();
ItemStack helmetStack = ItemPneumaticArmor.getSearchedStack(player.getCurrentArmor(3));
if (searchStack == null && helmetStack != null || searchStack != null && helmetStack == null || searchStack != null && helmetStack != null && !searchStack.isItemEqual(helmetStack)) {
NetworkHandler.sendToServer(new PacketUpdateSearchStack(searchStack));
NBTTagCompound tag = NBTUtil.getCompoundTag(player.getCurrentArmor(3), "SearchStack");
tag.setInteger("itemID", searchStack != null ? Item.getIdFromItem(searchStack.getItem()) : -1);
tag.setInteger("itemDamage", searchStack != null ? searchStack.getItemDamage() : -1);
}
}
}
use of pneumaticCraft.common.network.PacketUpdateSearchStack in project PneumaticCraft by MineMaarten.
the class InventorySearch method setInventorySlotContents.
@Override
public void setInventorySlotContents(int i, ItemStack itemstack) {
NBTTagCompound tag = NBTUtil.getCompoundTag(helmetStack, "SearchStack");
tag.setInteger("itemID", itemstack != null ? Item.getIdFromItem(itemstack.getItem()) : -1);
tag.setInteger("itemDamage", itemstack != null ? itemstack.getItemDamage() : -1);
NetworkHandler.sendToServer(new PacketUpdateSearchStack(itemstack));
}
Aggregations