From 331f9b2a7873139a60b4980ccccccfdbe890e205 Mon Sep 17 00:00:00 2001 From: IntegratedQuantum Date: Tue, 26 Mar 2019 18:48:33 +0100 Subject: [PATCH] Remove markEdit and fix spawn chunk not loaded bug --- .../src/io/cubyz/world/RemoteWorld.java | 15 --------------- cubyz-common/src/io/cubyz/world/Chunk.java | 4 ---- .../src/io/cubyz/world/LocalWorld.java | 18 +----------------- cubyz-common/src/io/cubyz/world/World.java | 18 ------------------ 4 files changed, 1 insertion(+), 54 deletions(-) diff --git a/cubyz-client/src/io/cubyz/world/RemoteWorld.java b/cubyz-client/src/io/cubyz/world/RemoteWorld.java index 2b0a31330..340c04712 100644 --- a/cubyz-client/src/io/cubyz/world/RemoteWorld.java +++ b/cubyz-client/src/io/cubyz/world/RemoteWorld.java @@ -11,21 +11,6 @@ import io.cubyz.entity.Player; // TODO public class RemoteWorld extends World { - - @Override - public boolean isEdited() { - return false; - } - - @Override - public void unmarkEdit() { - - } - - @Override - public void markEdit() { - - } @Override public Player getLocalPlayer() { diff --git a/cubyz-common/src/io/cubyz/world/Chunk.java b/cubyz-common/src/io/cubyz/world/Chunk.java index a0d9d20f8..9413b1dc8 100644 --- a/cubyz-common/src/io/cubyz/world/Chunk.java +++ b/cubyz-common/src/io/cubyz/world/Chunk.java @@ -119,7 +119,6 @@ public class Chunk { inst = new BlockInstance[16][World.WORLD_HEIGHT][16]; } inst[rx][y][rz] = inst0; - world.markEdit(); if(generated) { BlockInstance[] neighbors = inst0.getNeighbors(); for (int i = 0; i < neighbors.length; i++) { @@ -203,7 +202,6 @@ public class Chunk { updatables.add(bi); }*/ } - world.markEdit(); } } @@ -272,7 +270,6 @@ public class Chunk { } } } - world.markEdit(); } } @@ -352,7 +349,6 @@ public class Chunk { } } } - world.markEdit(); inst[x][y][z] = null; } } diff --git a/cubyz-common/src/io/cubyz/world/LocalWorld.java b/cubyz-common/src/io/cubyz/world/LocalWorld.java index ff4b7a809..1f559e376 100644 --- a/cubyz-common/src/io/cubyz/world/LocalWorld.java +++ b/cubyz-common/src/io/cubyz/world/LocalWorld.java @@ -25,7 +25,6 @@ public class LocalWorld extends World { //private List spatials = new ArrayList<>(); private Block [] blocks; - private boolean edited; private Player player; private WorldIO wio; @@ -87,21 +86,6 @@ public class LocalWorld extends World { } } - @Override - public boolean isEdited() { - return edited; - } - - @Override - public void unmarkEdit() { - edited = false; - } - - @Override - public void markEdit() { - edited = true; - } - public LocalWorld() { name = "World"; chunks = new ArrayList<>(); @@ -158,7 +142,7 @@ public class LocalWorld extends World { Chunk ch = getChunk(x / 16, z / 16); if (!ch.isGenerated()) { synchronousGenerate(ch); - ch.setLoaded(true); + ch.load(); } } diff --git a/cubyz-common/src/io/cubyz/world/World.java b/cubyz-common/src/io/cubyz/world/World.java index fc09005fc..e8ce07ee7 100644 --- a/cubyz-common/src/io/cubyz/world/World.java +++ b/cubyz-common/src/io/cubyz/world/World.java @@ -43,24 +43,6 @@ public abstract class World { } } - /** - * Used internally, allow the client to know whether or not it should update the visible blocks list. - * Mostly unused since recently. - */ - public abstract boolean isEdited(); - - /** - * Used internally, allow the client to know whether or not it should update the visible blocks list. - * Mostly unused since recently. - */ - public abstract void unmarkEdit(); - - /** - * Used internally, allow the client to know whether or not it should update the visible blocks list. - * Mostly unused since recently. - */ - public abstract void markEdit(); - public abstract Player getLocalPlayer(); public int getHeight() {