44import com .mojang .brigadier .arguments .StringArgumentType ;
55import com .mojang .brigadier .context .CommandContext ;
66import core .io .IO ;
7- import core .nbt .file .NBTFile ;
8- import core .nbt .tag .CompoundTag ;
9- import core .nbt .tag .DoubleTag ;
10- import core .nbt .tag .FloatTag ;
11- import core .nbt .tag .ListTag ;
12- import core .nbt .tag .Tag ;
137import io .papermc .paper .command .brigadier .CommandSourceStack ;
148import io .papermc .paper .command .brigadier .Commands ;
159import net .kyori .adventure .key .Key ;
1610import net .kyori .adventure .text .minimessage .tag .resolver .Placeholder ;
11+ import net .thenextlvl .nbt .file .NBTFile ;
12+ import net .thenextlvl .nbt .tag .CompoundTag ;
13+ import net .thenextlvl .nbt .tag .DoubleTag ;
14+ import net .thenextlvl .nbt .tag .FloatTag ;
15+ import net .thenextlvl .nbt .tag .ListTag ;
16+ import net .thenextlvl .nbt .tag .Tag ;
1717import net .thenextlvl .tweaks .TweaksPlugin ;
1818import net .thenextlvl .tweaks .command .suggestion .OfflinePlayerSuggestionProvider ;
1919import org .bukkit .Bukkit ;
@@ -148,16 +148,16 @@ private boolean setLocation(OfflinePlayer player, Location location) {
148148 }
149149
150150 private CompoundTag toTag (Location location ) {
151- var pos = new ListTag <> (DoubleTag .ID );
152- pos .add (new DoubleTag (location .getX ()));
153- pos .add (new DoubleTag (location .getY ()));
154- pos .add (new DoubleTag (location .getZ ()));
151+ var pos = ListTag . of (DoubleTag .ID );
152+ pos .add (DoubleTag . of (location .getX ()));
153+ pos .add (DoubleTag . of (location .getY ()));
154+ pos .add (DoubleTag . of (location .getZ ()));
155155
156- var rotation = new ListTag <> (FloatTag .ID );
157- rotation .add (new FloatTag (location .getYaw ()));
158- rotation .add (new FloatTag (location .getPitch ()));
156+ var rotation = ListTag . of (FloatTag .ID );
157+ rotation .add (FloatTag . of (location .getYaw ()));
158+ rotation .add (FloatTag . of (location .getPitch ()));
159159
160- var tag = new CompoundTag ();
160+ var tag = CompoundTag . empty ();
161161 tag .add ("WorldUUIDLeast" , location .getWorld ().getUID ().getLeastSignificantBits ());
162162 tag .add ("WorldUUIDMost" , location .getWorld ().getUID ().getMostSignificantBits ());
163163 tag .add ("Dimension" , location .getWorld ().key ().asString ());
@@ -179,8 +179,8 @@ private CompoundTag toTag(Location location) {
179179 var data = new File (overworld .getWorldFolder (), "playerdata" );
180180 var io = IO .of (data , player .getUniqueId () + ".dat" );
181181 var fallback = IO .of (data , player .getUniqueId () + ".dat_old" );
182- return io .exists () ? new NBTFile <>(io , new CompoundTag ())
183- : fallback .exists () ? new NBTFile <>(fallback , new CompoundTag ())
182+ return io .exists () ? new NBTFile <>(io , CompoundTag . empty ())
183+ : fallback .exists () ? new NBTFile <>(fallback , CompoundTag . empty ())
184184 : null ;
185185 }
186186}
0 commit comments