aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces/INetworkUpdatableItem.java
blob: 2e102e937cf5fe4dc73799d319229b851d5e73fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package gregtech.api.interfaces;

import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

/**
 * Together with {@link gregtech.api.net.GT_Packet_UpdateItem} you can request server side to update item in hand with
 * a NBT tag.
 *
 * Usual NBT tag size limit applies.
 */
public interface INetworkUpdatableItem {
	/**
	 * Receive update from client. Runs on server thread.
	 * @param stack Stack being updated
	 * @param player player holding the stack
	 * @param tag received data
	 * @return true if this stack should be kept inside the player inventory.
	 * false if this stack should vanish (i.e. slot content set to null)
	 */
	boolean receive(ItemStack stack, EntityPlayerMP player, NBTTagCompound tag);
}