diff --git a/src/main/java/tk/valoeghese/fc0/client/Client2fc.java b/src/main/java/tk/valoeghese/fc0/client/Client2fc.java index d470fac..198312c 100644 --- a/src/main/java/tk/valoeghese/fc0/client/Client2fc.java +++ b/src/main/java/tk/valoeghese/fc0/client/Client2fc.java @@ -78,9 +78,10 @@ public void saveWorld() { public void createWorld() { this.saveWorld(); + this.time = 0; this.save = new Save("save", new Random().nextLong()); this.world = new ClientChunkSelection(this.save, this.save.getSeed(), 9); - this.time = 0; + if (this.save.spawnLocPos != null) { this.spawnLoc = this.save.spawnLocPos; } else { @@ -145,7 +146,9 @@ private void tick() { if (!this.titleScreen && zone != this.player.cachedZone) { this.player.cachedZone = zone; - this.biomeWidget.changeText(this.language.translate(zone.toString())); + String newValue = this.language.translate(zone.toString()); + System.out.println(newValue); + this.biomeWidget.changeText(newValue); } ++this.time; @@ -166,7 +169,7 @@ private void init() { this.titleText = new Text("Click to start.", -0.85f, 0.5f, 2.2f); this.world.populateChunks(); this.player.getCamera().rotateYaw((float) Math.PI); - this.biomeWidget = new Text("ecozone.placeholder", -0.85f, 0.5f, 1.0f); + this.biomeWidget = new Text(this.language.translate("ecozone.temperate_grassland"), -0.85f, 0.8f, 1.0f); } private void handleKeybinds() { diff --git a/src/main/java/tk/valoeghese/fc0/client/gui/GUI.java b/src/main/java/tk/valoeghese/fc0/client/gui/GUI.java index 3ec2861..1681f47 100644 --- a/src/main/java/tk/valoeghese/fc0/client/gui/GUI.java +++ b/src/main/java/tk/valoeghese/fc0/client/gui/GUI.java @@ -26,7 +26,7 @@ protected GUI(int texture) { private FloatList vTemp = new FloatArrayList(); private int vTempIndex = 0; private IntList iTemp = new IntArrayList(); - private List vertexArrays = new ArrayList<>(); + protected List vertexArrays = new ArrayList<>(); private final int mode; private final Shader shader; private final int texture; @@ -50,7 +50,8 @@ public void destroy() { glDeleteVertexArrays(array.vao); } - this.vertexArrays = new ArrayList<>(); + this.vertexArrays.clear(); + this.vTempIndex = 0; } protected void generateBuffers() { @@ -88,8 +89,8 @@ public final void render() { glDrawElements(GL_TRIANGLES, array.elementCount, GL_UNSIGNED_INT, NULL); } - glBindTexture(GL_TEXTURE_2D, 0); unbind(); + glBindTexture(GL_TEXTURE_2D, 0); } public Shader getShader() { @@ -100,7 +101,7 @@ public static final void unbind() { glBindVertexArray(0); } - private static class VertexArray { + protected static class VertexArray { private VertexArray(int vao, int elementCount) { this.vao = vao; this.elementCount = elementCount; @@ -108,5 +109,10 @@ private VertexArray(int vao, int elementCount) { private final int vao; private final int elementCount; + + @Override + public String toString() { + return "{vao: " + this.vao + ", elementCount: " + this.elementCount + "}"; + } } } diff --git a/src/main/java/tk/valoeghese/fc0/world/ChunkSelection.java b/src/main/java/tk/valoeghese/fc0/world/ChunkSelection.java index d8efcb9..fa3c81d 100644 --- a/src/main/java/tk/valoeghese/fc0/world/ChunkSelection.java +++ b/src/main/java/tk/valoeghese/fc0/world/ChunkSelection.java @@ -14,6 +14,7 @@ public abstract class ChunkSelection implements World, ChunkAccess { public ChunkSelection(@Nullable Save save, long seed, int size, WorldGen.ChunkConstructor constructor, IntFunction arraySupplier) { + WorldGen.updateSeed(seed); this.seed = seed; this.offset = size - 1; this.diameter = 1 + this.offset * 2; diff --git a/src/main/java/tk/valoeghese/fc0/world/gen/WorldGen.java b/src/main/java/tk/valoeghese/fc0/world/gen/WorldGen.java index e53cb3a..d07cab6 100644 --- a/src/main/java/tk/valoeghese/fc0/world/gen/WorldGen.java +++ b/src/main/java/tk/valoeghese/fc0/world/gen/WorldGen.java @@ -13,14 +13,16 @@ import java.util.Random; public final class WorldGen { - public static T generateChunk(ChunkConstructor constructor, ChunkAccess parent, int chunkX, int chunkZ, long seed, Random rand) { + public static void updateSeed(long seed) { if (noise == null || seed != cachedSeed) { noise = new Noise(new Random(seed)); ridges = new RidgedNoise(new Random(seed + 12)); sand = new Noise(new Random(seed - 29)); ecoZone = new Noise(new Random(seed + 31)); } + } + public static T generateChunk(ChunkConstructor constructor, ChunkAccess parent, int chunkX, int chunkZ, long seed, Random rand) { byte[] tiles = new byte[16 * 16 * World.WORLD_HEIGHT]; byte[] meta = new byte[tiles.length]; diff --git a/src/main/resources/assets/texture/font_atlas.png b/src/main/resources/assets/texture/font_atlas.png index e441288..a52bdef 100644 Binary files a/src/main/resources/assets/texture/font_atlas.png and b/src/main/resources/assets/texture/font_atlas.png differ