4
4
import com .mojang .brigadier .arguments .StringArgumentType ;
5
5
import com .mojang .brigadier .context .CommandContext ;
6
6
import 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 ;
13
7
import io .papermc .paper .command .brigadier .CommandSourceStack ;
14
8
import io .papermc .paper .command .brigadier .Commands ;
15
9
import net .kyori .adventure .key .Key ;
16
10
import 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 ;
17
17
import net .thenextlvl .tweaks .TweaksPlugin ;
18
18
import net .thenextlvl .tweaks .command .suggestion .OfflinePlayerSuggestionProvider ;
19
19
import org .bukkit .Bukkit ;
@@ -148,16 +148,16 @@ private boolean setLocation(OfflinePlayer player, Location location) {
148
148
}
149
149
150
150
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 ()));
155
155
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 ()));
159
159
160
- var tag = new CompoundTag ();
160
+ var tag = CompoundTag . empty ();
161
161
tag .add ("WorldUUIDLeast" , location .getWorld ().getUID ().getLeastSignificantBits ());
162
162
tag .add ("WorldUUIDMost" , location .getWorld ().getUID ().getMostSignificantBits ());
163
163
tag .add ("Dimension" , location .getWorld ().key ().asString ());
@@ -179,8 +179,8 @@ private CompoundTag toTag(Location location) {
179
179
var data = new File (overworld .getWorldFolder (), "playerdata" );
180
180
var io = IO .of (data , player .getUniqueId () + ".dat" );
181
181
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 ())
184
184
: null ;
185
185
}
186
186
}
0 commit comments