Archived
0

изменен механизм установки спавна

This commit is contained in:
2018-08-26 00:34:02 +03:00
parent dff4367c3e
commit 15ba4aeda9
2 changed files with 6 additions and 4 deletions

View File

@@ -11,7 +11,10 @@ public interface World {
WorldType getWorldType(); WorldType getWorldType();
EntityLocation getSpawn(); EntityLocation getSpawn();
void setSpawn(EntityLocation location); void setSpawn(double x, double y, double z, float yaw, float pitch);
default void setSpawn(double x, double y, double z) {
setSpawn(x, y, z, 0f, 0f);
}
Chunk getChunk(int x, int z); Chunk getChunk(int x, int z);
void setChunk(int x, int z, Chunk chunkSection); void setChunk(int x, int z, Chunk chunkSection);

View File

@@ -34,9 +34,8 @@ public class SimpleWorld implements World {
} }
@Override @Override
public void setSpawn(EntityLocation location) { public void setSpawn(double x, double y, double z, float yaw, float pitch) {
this.spawn = location; this.spawn = new EntityLocation(x, y, z, yaw, pitch, this);
this.spawn.setWorld(this);
} }
@Override @Override