ShaneBeee / SkBee

SkBee is a Skript addon that aims to add more useful elements to Skript.
GNU General Public License v3.0
57 stars 20 forks source link

[BUG] NBT copy of player doesn't include their custom tag #548

Closed cheeezburga closed 8 months ago

cheeezburga commented 8 months ago

What happened?

I was using an inventory serializer type thing to backup a group of items to a player's nbt compound, and when trying to retrieve and modify it, the nbt on the player was being modified (which, to my knowledge, is intentional). I wanted the nbt on the player to remain the same (i.e. I was wanting to use and modify a copy of the nbt), so I did the following:

set {_i::*} to (compound list tag "custom;ctf" of nbt copy of {_p})

# also tried the following, to the same end
set {_nbt} to nbt copy of {_p}
set {_i::*} to (compound list tag "custom;ctf" of {_nbt})

With the above attempts, I also tried getting a copy of the full nbt of the player (I just replaced nbt copy with full nbt copy).

Anyway, I noticed that the custom; tag of the player's nbt wasnt included in the nbt copy. I'm not sure if this is intentional behaviour or not. Broadcasting both tags would only broadcast anything when referencing the actual player's nbt, not the copy.

Steps to reproduce

  1. Add anything (I originally encountered this with a compound list tag, and recreated it with a string list tag later) to your player's custom nbt tag
  2. Broadcast the custom tag, to make sure it was added correctly and stuff
  3. Broadcast the custom tag of a copy of the nbt (shouldn't broadcast anything, or an empty nbt compound)

Expected behavior

Expected to see the same custom tag that the player had.

SkBee Version

3.0.0

Server Version

Paper 1.20.2

SkBee Info

[01:34:57 INFO]: --- [SkBee Loading Info] ---
[01:34:57 INFO]: - [NBTAPI] Found Spigot: v1_20_R2! Trying to find NMS support
[01:34:57 INFO]: - [NBTAPI] NMS support 'MC1_20_R2' loaded!
[01:34:57 INFO]: - NBT Elements successfully loaded
[01:34:57 INFO]: - Text Component Elements successfully loaded
[01:34:57 INFO]: - Advancement Elements successfully loaded
[01:34:57 INFO]: - BossBar Elements successfully loaded
[01:34:57 INFO]: - Bound Elements successfully loaded
[01:34:57 INFO]: - Display Entity elements successfully loaded
[01:34:57 INFO]: - Fishing elements successfully loaded
[01:34:57 INFO]: - Game Event Elements successfully loaded
[01:34:57 INFO]: - Particle Elements successfully loaded
[01:34:57 INFO]: - RayTrace elements successfully loaded
[01:34:57 INFO]: - Recipe Elements successfully loaded
[01:34:57 INFO]: - Scoreboard Elements successfully loaded
[01:34:57 INFO]: - Scoreboard Objective Elements successfully loaded
[01:34:57 INFO]: - Statistic Elements successfully loaded
[01:34:57 INFO]: - Structure Elements successfully loaded
[01:34:57 INFO]: - Minecraft Tag elements successfully loaded
[01:34:57 INFO]: - Team Elements successfully loaded
[01:34:57 INFO]: - Villager Elements successfully loaded
[01:34:57 INFO]: - Virtual Furnace Elements disabled via config
[01:34:57 INFO]: - World Border Elements successfully loaded
[01:34:57 INFO]: - World Creator Elements successfully loaded
[01:34:57 INFO]: - Plugin is not up to date!
[01:34:57 INFO]: -  - Current version: v3.0.0
[01:34:57 INFO]: -  - Available update: v3.0.2
[01:34:57 INFO]: -  - Download available at: https://github.com/ShaneBeee/SkBee/releases
[01:34:57 INFO]: --- [Server Info] ---
[01:34:57 INFO]: Server Version: git-Paper-217 (MC: 1.20.2)
[01:34:57 INFO]: Skript Version: 2.7.3
[01:34:57 INFO]: Skript Addons:
[01:34:57 INFO]: - skript-gui v1.3
[01:34:57 INFO]: - skript-reflect v2.4-beta1
[01:34:57 INFO]: - Hippo v1.1.1-PRERELEASE
[01:34:57 INFO]: SkBee Version: 3.0.0
[01:34:57 INFO]: SkBee Website: https://github.com/ShaneBeee/SkBee

Additional Information

No response

cheeezburga commented 8 months ago

This isnt a big issue or anything, as doing set (tag "custom" of {copy}) to (tag "custom" of {original}) is a valid workaround.

ShaneBeee commented 8 months ago

another workaround is: set {_copy} to nbt from "%nbt of player%" Im working on a fix though, so the next update will have it.

ShaneBeee commented 8 months ago

re-opening. I close when I actually release a build