Interface IInventoryNetworkUtil
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
public interface IInventoryNetworkUtil
- Extension Methods
Properties
Api
The core API
ICoreAPI Api { get; set; }
Property Value
PauseInventoryUpdates
bool PauseInventoryUpdates { get; set; }
Property Value
Methods
DidClose(IPlayer)
Closes the target inventory attached to a player.
object DidClose(IPlayer player)
Parameters
playerIPlayer
Returns
DidOpen(IPlayer)
Opens a target inventory, passing it to the player.
object DidOpen(IPlayer player)
Parameters
playerIPlayer
Returns
GetActivateSlotPacket(int, ItemStackMoveOperation)
Gets the active slot packet.
object GetActivateSlotPacket(int slotId, ItemStackMoveOperation op)
Parameters
slotIdintThe slot ID
opItemStackMoveOperationThe operation of the slot.
Returns
GetFlipSlotsPacket(IInventory, int, int)
Flips the items between the source slot and target slot.
object GetFlipSlotsPacket(IInventory sourceInv, int sourceSlotId, int targetSlotId)
Parameters
sourceInvIInventoryThe inventory.
sourceSlotIdintThe source slot ID
targetSlotIdintThe target slot ID
Returns
HandleClientPacket(IPlayer, int, byte[])
Handles the client packet.
[Obsolete("prefer using the SerializedData overload.", true)]
void HandleClientPacket(IPlayer byPlayer, int packetId, byte[] packetData)
Parameters
byPlayerIPlayerThe player the packet came from
packetIdintthe ID of the packet.
packetDatabyte[]
HandleClientPacket(IServerPlayer, int, SerializedData)
Handles the client packet.
void HandleClientPacket(IServerPlayer byPlayer, int packetId, SerializedData packetData)
Parameters
byPlayerIServerPlayerThe player the packet came from
packetIdintthe ID of the packet.
packetDataSerializedData
SendInventoryRollback(IServerPlayer, int, SerializedData)
Discards a packet that would normally be passed into HandleClientPacket(IPlayer, int, SerializedData) and tells the client to revert the interaction.
void SendInventoryRollback(IServerPlayer byPlayer, int forClientPacketId, SerializedData forClientPacketData)
Parameters
byPlayerIServerPlayerThe player the packet came from
forClientPacketIdintThe packet id the client sent us, which we need to roll back client side
forClientPacketDataSerializedDataThe packet data the client sent us, which we need to roll back client side