Class InventoryTracker
java.lang.Object
me.agent.vgui.core.internal.InventoryTracker
Caches each player's backend-owned inventory by observing window-0 packets.
Every backend connection has a generation: switching invalidates the old cache,
packets captured for an older generation are rejected, and SET_SLOT updates are
ignored until the new backend supplies a complete WINDOW_ITEMS baseline.
Window 0 layout: 0 = craft result, 1-4 = craft grid, 5-8 = armor, 9-35 = main inventory, 36-44 = hotbar, 45 = offhand.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongbackendConnected(UUID uuid) Marks the latest backend generation connected and ready to accept a baseline.voidbackendSwitchAborted(UUID uuid) Ends a failed connection attempt without reviving the invalidated old cache.longbeginBackendSwitch(UUID uuid) Invalidates the current cache before a backend connection attempt.voidclear()Drops every cached player, used when the owning bootstrap shuts down.voidDrops all connection and inventory state for a disconnected player.longgeneration(UUID uuid) Current backend generation, captured by packet listeners before an update.booleanisSwitching(UUID uuid) Whether a backend transition is in progress; proxy views should not open yet.com.github.retrooper.packetevents.protocol.item.ItemStack[]mainAndHotbar(UUID uuid) The 36 main-inventory + hotbar items in container-window order.voidRecords a single window-0 slot update for the current generation.voidsetSlot(UUID uuid, long generation, int slot, com.github.retrooper.packetevents.protocol.item.ItemStack item) Records a slot update only for a live generation with a full baseline.voidwindowItems(UUID uuid, long generation, List<com.github.retrooper.packetevents.protocol.item.ItemStack> items) Records a full window-0 packet only if its captured generation is still live.voidwindowItems(UUID uuid, List<com.github.retrooper.packetevents.protocol.item.ItemStack> items) Records a full window-0 contents packet for the current generation.
-
Constructor Details
-
InventoryTracker
public InventoryTracker()
-
-
Method Details
-
beginBackendSwitch
Invalidates the current cache before a backend connection attempt. -
backendConnected
Marks the latest backend generation connected and ready to accept a baseline. -
backendSwitchAborted
Ends a failed connection attempt without reviving the invalidated old cache. -
generation
Current backend generation, captured by packet listeners before an update. -
isSwitching
Whether a backend transition is in progress; proxy views should not open yet. -
windowItems
-
windowItems
-
setSlot
public void setSlot(UUID uuid, int slot, com.github.retrooper.packetevents.protocol.item.ItemStack item) Records a single window-0 slot update for the current generation. -
setSlot
public void setSlot(UUID uuid, long generation, int slot, com.github.retrooper.packetevents.protocol.item.ItemStack item) Records a slot update only for a live generation with a full baseline. This prevents late old-backend deltas from seeding a newly connected cache. -
mainAndHotbar
The 36 main-inventory + hotbar items in container-window order. An empty snapshot is returned until the current backend provides a complete baseline. -
evict
Drops all connection and inventory state for a disconnected player. -
clear
public void clear()Drops every cached player, used when the owning bootstrap shuts down.
-