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.
void HandleClientPacket(IPlayer byPlayer, int packetId, byte[] data)
Parameters
byPlayerIPlayerThe player the packet came from
packetIdintthe ID of the packet.
databyte[]the contents of the packet.
SendInventoryRollback(IServerPlayer, int, ReadOnlySpan<byte>)
Discards a packet that would normally be passed into HandleClientPacket(IPlayer, int, ReadOnlySpan<T>) and tells the client to revert the interaction.
void SendInventoryRollback(IServerPlayer byPlayer, int forClientPacketId, ReadOnlySpan<byte> forClientPacketData)
Parameters
byPlayerIServerPlayerThe player the packet came from
forClientPacketIdintThe packet id the client sent us, which we need to roll back client side
forClientPacketDataReadOnlySpan<byte>The packet data the client sent us, which we need to roll back client side