Auxilor / Reforges

Reforges plugin for the latest minecraft version
GNU General Public License v3.0
42 stars 23 forks source link

Junk data written to reforged item names, causes server crashes. #27

Open I0u0I opened 2 years ago

I0u0I commented 2 years ago

Occasionally after reforging an enchanted item, other held previously reforged items can have the Name NBT data spammed with extra shit, which on it's own isn't a problem, but if said item is then used for an event which would broadcast to chat/console (e.g. player killed player with [buggeditem]) the server will crash when attempting to read the trash data.

To Reproduce

  1. Spawn in two enchanted weapons /minecraft:give @p netherite_sword{Enchantments:[{id:looting,lvl:3},{id:mending,lvl:1},{id:sharpness,lvl:5},{id:sweeping,lvl:3}]} 2
  2. Reforge Item 1,
  3. Reforge Item 2,
  4. Check NBT data of both items.
    • If no extra data has appeared on either item between display: {Lore: []}}, Count: 1b} in the NBT Data continue to reforge either/both items.
    • When {Name: '{"italic":false,"extra":[{"italic":false,"extra":[{"translate":"item.minecraft.netherite_sword"}],"text":""}],"text":""}', appears between display: and {Lore: []}} the bug has been encountered

Expected behavior No extra junk data to ever be added to the Name NBT data.

Screenshots

Log from Game output as I was attempting to find the cause of the junk data.

22:18:49.364 [CHAT] Gave 2 [Netherite Sword] to ql0u0lp 22:18:58.531 [CHAT] ql0u0lp has the following entity data: {id: "minecraft:netherite_sword", tag: {Damage: 0, display: {Lore: []}, Enchantments: [{id: "minecraft:bane_of_arthropods", lvl: 5s}, {id: "minecraft:fire_aspect", lvl: 2s}, {id: "minecraft:knockback", lvl: 2s}, {id: "minecraft:looting", lvl: 3s}, {id: "minecraft:sharpness", lvl: 5s}, {id: "minecraft:silk_touch", lvl: 1s}, {id: "minecraft:smite", lvl: 5s}, {id: "minecraft:sweeping", lvl: 3s}]}, Count: 1b} 22:19:11.415 [CHAT] ql0u0lp has the following entity data: {id: "minecraft:netherite_sword", tag: {Damage: 0, display: {Lore: []}, Enchantments: [{id: "minecraft:bane_of_arthropods", lvl: 5s}, {id: "minecraft:fire_aspect", lvl: 2s}, {id: "minecraft:knockback", lvl: 2s}, {id: "minecraft:looting", lvl: 3s}, {id: "minecraft:sharpness", lvl: 5s}, {id: "minecraft:silk_touch", lvl: 1s}, {id: "minecraft:smite", lvl: 5s}, {id: "minecraft:sweeping", lvl: 3s}]}, Count: 1b} 22:19:16.965 [CHAT] Reforges » Applied Sharp reforge! 22:19:21.283 [CHAT] ql0u0lp has the following entity data: {id: "minecraft:netherite_sword", tag: {Damage: 0, display: {Lore: []}, Enchantments: [{id: "minecraft:bane_of_arthropods", lvl: 5s}, {id: "minecraft:fire_aspect", lvl: 2s}, {id: "minecraft:knockback", lvl: 2s}, {id: "minecraft:looting", lvl: 3s}, {id: "minecraft:sharpness", lvl: 5s}, {id: "minecraft:silk_touch", lvl: 1s}, {id: "minecraft:smite", lvl: 5s}, {id: "minecraft:sweeping", lvl: 3s}]}, Count: 1b} 22:19:25.399 [CHAT] ql0u0lp has the following entity data: {id: "minecraft:netherite_sword", tag: {PublicBukkitValues: {"reforges:reforge": "sharp", "reforges:reforge_amount": 1}, Enchantments: [{id: "minecraft:bane_of_arthropods", lvl: 5s}, {id: "minecraft:fire_aspect", lvl: 2s}, {id: "minecraft:knockback", lvl: 2s}, {id: "minecraft:looting", lvl: 3s}, {id: "minecraft:sharpness", lvl: 5s}, {id: "minecraft:silk_touch", lvl: 1s}, {id: "minecraft:smite", lvl: 5s}, {id: "minecraft:sweeping", lvl: 3s}], Damage: 0, display: {Lore: []}}, Count: 1b} 22:19:39.183 [CHAT] Reforges » Applied Gravitated reforge! 22:19:39.334 [CHAT] Reforges » Applied Strong reforge! 22:19:39.483 [CHAT] Reforges » Applied Sharp reforge! 22:19:39.634 [CHAT] Reforges » Applied Strong reforge! 22:19:39.767 [CHAT] Reforges » Applied Gravitated reforge! 22:19:39.934 [CHAT] Reforges » Applied Nautical reforge! 22:19:40.083 [CHAT] Reforges » Applied Gravitated reforge! 22:19:40.250 [CHAT] Reforges » Applied Light reforge! 22:19:40.400 [CHAT] Reforges » Applied Gravitated reforge! 22:19:40.583 [CHAT] Reforges » Applied Sharp reforge! 22:19:40.750 [CHAT] Reforges » Applied Strong reforge! 22:19:40.900 [CHAT] Reforges » Applied Sharp reforge! 22:19:41.050 [CHAT] Reforges » Applied Light reforge! 22:19:41.200 [CHAT] Reforges » Applied Gravitated reforge! 22:19:45.834 [CHAT] ql0u0lp has the following entity data: {id: "minecraft:netherite_sword", tag: {PublicBukkitValues: {"reforges:reforge": "gravitated", "reforges:reforge_amount": 14}, Enchantments: [{id: "minecraft:bane_of_arthropods", lvl: 5s}, {id: "minecraft:fire_aspect", lvl: 2s}, {id: "minecraft:knockback", lvl: 2s}, {id: "minecraft:looting", lvl: 3s}, {id: "minecraft:sharpness", lvl: 5s}, {id: "minecraft:silk_touch", lvl: 1s}, {id: "minecraft:smite", lvl: 5s}, {id: "minecraft:sweeping", lvl: 3s}], Damage: 0, display: {Lore: []}}, Count: 1b} 22:19:50.351 [CHAT] ql0u0lp has the following entity data: {id: "minecraft:netherite_sword", tag: {PublicBukkitValues: {"reforges:reforge": "sharp", "reforges:reforge_amount": 1}, Enchantments: [{id: "minecraft:bane_of_arthropods", lvl: 5s}, {id: "minecraft:fire_aspect", lvl: 2s}, {id: "minecraft:knockback", lvl: 2s}, {id: "minecraft:looting", lvl: 3s}, {id: "minecraft:sharpness", lvl: 5s}, {id: "minecraft:silk_touch", lvl: 1s}, {id: "minecraft:smite", lvl: 5s}, {id: "minecraft:sweeping", lvl: 3s}], Damage: 0, display: {Name: '{"italic":false,"extra":[{"italic":false,"extra":[{"translate":"item.minecraft.netherite_sword"}],"text":""}],"text":""}', Lore: []}}, Count: 1b}

Screenshot of log with annotation

Server Information (please complete the following information):

Additional context Reported on discord when first discovered and advised to open report here.