Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public EntitySnapshot toSnapshot(final ServerLocation location) {
final CompoundTag newCompound = this.compound.copy();
final Vector3d pos = location.position();
newCompound.put(Constants.Entity.ENTITY_POSITION, Constants.NBT.newDoubleNBTList(pos.x(), pos.y(), pos.z()));
newCompound.putString(Constants.Sponge.World.WORLD_KEY, location.worldKey().formatted());
newCompound.putString(Constants.Sponge.World.DIMENSION, location.worldKey().formatted());
builder.compound = newCompound;
builder.worldKey = location.world().properties().key();
builder.position = pos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ public void readCompound(final CompoundTag compound) {
this.reset();
this.compound = compound;

if (!compound.contains(Constants.Sponge.World.WORLD_KEY)) {
this.worldKey = ResourceKey.resolve(compound.getString(Constants.Sponge.World.WORLD_KEY));
if (!compound.contains(Constants.Sponge.World.DIMENSION)) {
this.worldKey = ResourceKey.resolve(compound.getString(Constants.Sponge.World.DIMENSION));
}
final ListTag position = compound.getList(Constants.Entity.ENTITY_POSITION, Constants.NBT.TAG_DOUBLE);
final ListTag rotation = compound.getList(Constants.Entity.ENTITY_ROTATION, Constants.NBT.TAG_FLOAT);
Expand All @@ -238,7 +238,7 @@ public void readCompound(final CompoundTag compound) {

public void writeCompound(final CompoundTag compound) {

compound.putString(Constants.Sponge.World.WORLD_KEY, this.worldKey.formatted());
compound.putString(Constants.Sponge.World.DIMENSION, this.worldKey.formatted());

this.loadInventory();
this.loadEnderInventory();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/spongepowered/common/util/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public static final class World {
public static final String LEVEL_SPONGE_DAT_NEW = org.spongepowered.common.util.Constants.Sponge.World.LEVEL_SPONGE_DAT + "_new";
public static final String UNIQUE_ID = "UUID";
public static final String DIMENSIONS_DIRECTORY = "dimensions";
public static final String WORLD_KEY = "WorldKey";
public static final String DIMENSION = "Dimension";
}

public static final class Schematic {
Expand Down