Currently, with patchItemKickExploit set to true, creative inventories may have item NBT silently sanitized as the client resyncs the inventory with the server, even if nothing should be replaced or legalised to begin with. It's not a major problem when it's more patched out, but can still show through in certain scenarios, i.e. block or entity data stored in a block or spawn egg.
Do note, all other checks can be completely disabled and this will still occur.
Possible ways to reproduce the issue
All of the following will generally result in either reverts, or otherwise unobtainable glitched items.
After each of the following, all that is needed to trigger this is to either relog or open another inventory.
Place a chest, shulker, etc., place items inside of it, Ctrl+Pick-block
Write into book & quills and sign them. Written books results in no title, author, generation or page data.
Enchanting any items. This results in an item with a glint, but no enchantments.
Renaming any items.
Brewing any potion, tipping arrows or crafting suspicious stew. This results in uncraftable potions or arrows, or effectively normal stew.
A configuration option to not sanitize creative inventories unless absolutely needed. This can allow a strict survival setting for if you want all items to be cleared regardless, and disabling will have both be strictly cleared.
A check to allow creative players a free pass unless absolutely needed. This would be automatic and would not require any intervention by server admins, but still strictly clear before it's sent out to survival players if desired.
Change the current check to allow all NBT unless sanitizing is needed to not kick the client. This would be automatic and not require any intervention by server admins, but would remove all strict clearing of unnecessary data before sending to the client.
Description
Currently, with
patchItemKickExploit
set to true, creative inventories may have item NBT silently sanitized as the client resyncs the inventory with the server, even if nothing should be replaced or legalised to begin with. It's not a major problem when it's more patched out, but can still show through in certain scenarios, i.e. block or entity data stored in a block or spawn egg.Do note, all other checks can be completely disabled and this will still occur.
Possible ways to reproduce the issue
All of the following will generally result in either reverts, or otherwise unobtainable glitched items. After each of the following, all that is needed to trigger this is to either relog or open another inventory.
Cause
As discussed at https://github.com/samolego/GolfIV/issues/39#issuecomment-858232842, this is caused primarily by the code below. https://github.com/samolego/GolfIV/blob/705f6a1a1cfbb9e3c92cd149eb0b1c4e2d826383/src/main/java/org/samo_lego/golfiv/event/S2CPacket/ItemInventoryKickPatch.java#L34-L45
Possible fixes
A configuration option to not sanitize creative inventories unless absolutely needed. This can allow a strict survival setting for if you want all items to be cleared regardless, and disabling will have both be strictly cleared.
A check to allow creative players a free pass unless absolutely needed. This would be automatic and would not require any intervention by server admins, but still strictly clear before it's sent out to survival players if desired.
Change the current check to allow all NBT unless sanitizing is needed to not kick the client. This would be automatic and not require any intervention by server admins, but would remove all strict clearing of unnecessary data before sending to the client.