Ledger icon indicating copy to clipboard operation
Ledger copied to clipboard

Entity kill and Item change preview

Open DrexHD opened this issue 1 year ago • 0 comments

Adds entity kill and item change preview

Entity Kill

  • Each preview object keeps track of entities that have been removed or added on the client. cleanup is invoked to get the client back in sync with the server.

(Support for the recent item-drop and item-pickup actions could be added similarly)

Item change

  • Each preview objects keeps track of the items added/removed at a certain position.
  • Whenever an inventory screen packet is sent to the player, we check if that screen has a position attached and if the players current preview has changes for that position. The packets items are modified accordingly.

Limitations

  • Entities may disappear / reappear shortly when applying a preview (old fake preview entities are removed, before actual entities are spawned, this is to ensure the client and servers states are in sync)
  • You can't preview item changes in blocks that are also part of the preview (a chest that was removed and then rolled back in preview)

DrexHD avatar Feb 11 '24 13:02 DrexHD