From 8b61fc8a2d4e0cd797c406f0c201c7540ac6e3bf Mon Sep 17 00:00:00 2001 From: TheMode Date: Sun, 24 Apr 2022 06:58:03 +0200 Subject: [PATCH] Fix GeneratorTest Signed-off-by: TheMode --- .../server/instance/GeneratorTest.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/test/java/net/minestom/server/instance/GeneratorTest.java b/src/test/java/net/minestom/server/instance/GeneratorTest.java index 4a53ede72..1835449e7 100644 --- a/src/test/java/net/minestom/server/instance/GeneratorTest.java +++ b/src/test/java/net/minestom/server/instance/GeneratorTest.java @@ -83,7 +83,7 @@ public class GeneratorTest { final int chunkZ = -2; final int sectionCount = maxSection - minSection; Section[] sections = new Section[sectionCount]; - Arrays.setAll(sections, i -> new Section()); + Arrays.setAll(sections, i -> Section.create()); GenerationUnit chunk = GeneratorImpl.chunk(minSection, maxSection, List.of(sections), chunkX, chunkZ); assertEquals(new Vec(16, sectionCount * 16, 16), chunk.size()); assertEquals(new Vec(chunkX * 16, minSection * 16, chunkZ * 16), chunk.absoluteStart()); @@ -98,7 +98,7 @@ public class GeneratorTest { final int chunkZ = -2; final int sectionCount = maxSection - minSection; Section[] sections = new Section[sectionCount]; - Arrays.setAll(sections, i -> new Section()); + Arrays.setAll(sections, i -> Section.create()); GenerationUnit chunk = GeneratorImpl.chunk(minSection, maxSection, List.of(sections), chunkX, chunkZ); assertEquals(new Vec(16, sectionCount * 16, 16), chunk.size()); assertEquals(new Vec(chunkX * 16, minSection * 16, chunkZ * 16), chunk.absoluteStart()); @@ -110,7 +110,7 @@ public class GeneratorTest { final int sectionX = 3; final int sectionY = -5; final int sectionZ = -2; - GenerationUnit section = GeneratorImpl.section(new Section(), sectionX, sectionY, sectionZ); + GenerationUnit section = GeneratorImpl.section(Section.create(), sectionX, sectionY, sectionZ); assertEquals(new Vec(16), section.size()); assertEquals(new Vec(sectionX * 16, sectionY * 16, sectionZ * 16), section.absoluteStart()); assertEquals(new Vec(sectionX * 16 + 16, sectionY * 16 + 16, sectionZ * 16 + 16), section.absoluteEnd()); @@ -124,7 +124,7 @@ public class GeneratorTest { final int chunkZ = -2; final int sectionCount = maxSection - minSection; Section[] sections = new Section[sectionCount]; - Arrays.setAll(sections, i -> new Section()); + Arrays.setAll(sections, i -> Section.create()); GenerationUnit chunk = GeneratorImpl.chunk(minSection, maxSection, List.of(sections), chunkX, chunkZ); var subUnits = chunk.subdivide(); assertEquals(sectionCount, subUnits.size()); @@ -144,7 +144,7 @@ public class GeneratorTest { final int chunkZ = -2; final int sectionCount = maxSection - minSection; Section[] sections = new Section[sectionCount]; - Arrays.setAll(sections, i -> new Section()); + Arrays.setAll(sections, i -> Section.create()); var chunkUnits = GeneratorImpl.chunk(minSection, maxSection, List.of(sections), chunkX, chunkZ); Generator generator = chunk -> { var modifier = chunk.modifier(); @@ -165,7 +165,7 @@ public class GeneratorTest { final int chunkZ = -2; final int sectionCount = maxSection - minSection; Section[] sections = new Section[sectionCount]; - Arrays.setAll(sections, i -> new Section()); + Arrays.setAll(sections, i -> Section.create()); var chunkUnits = GeneratorImpl.chunk(minSection, maxSection, List.of(sections), chunkX, chunkZ); Generator generator = chunk -> { var modifier = chunk.modifier(); @@ -193,7 +193,7 @@ public class GeneratorTest { final int chunkZ = -2; final int sectionCount = maxSection - minSection; Section[] sections = new Section[sectionCount]; - Arrays.setAll(sections, i -> new Section()); + Arrays.setAll(sections, i -> Section.create()); var chunkUnits = GeneratorImpl.chunk(minSection, maxSection, List.of(sections), chunkX, chunkZ); Generator generator = chunk -> { var modifier = chunk.modifier(); @@ -220,7 +220,7 @@ public class GeneratorTest { final int chunkZ = -2; final int sectionCount = maxSection - minSection; Section[] sections = new Section[sectionCount]; - Arrays.setAll(sections, i -> new Section()); + Arrays.setAll(sections, i -> Section.create()); var chunkUnits = GeneratorImpl.chunk(minSection, maxSection, List.of(sections), chunkX, chunkZ); Generator generator = chunk -> { var modifier = chunk.modifier(); @@ -249,7 +249,7 @@ public class GeneratorTest { final int chunkZ = -2; final int sectionCount = maxSection - minSection; Section[] sections = new Section[sectionCount]; - Arrays.setAll(sections, i -> new Section()); + Arrays.setAll(sections, i -> Section.create()); var chunkUnits = GeneratorImpl.chunk(minSection, maxSection, List.of(sections), chunkX, chunkZ); Generator generator = chunk -> { var modifier = chunk.modifier(); @@ -270,7 +270,7 @@ public class GeneratorTest { final int chunkZ = -2; final int sectionCount = maxSection - minSection; Section[] sections = new Section[sectionCount]; - Arrays.setAll(sections, i -> new Section()); + Arrays.setAll(sections, i -> Section.create()); var chunkUnits = GeneratorImpl.chunk(minSection, maxSection, List.of(sections), chunkX, chunkZ); Generator generator = chunk -> { var modifier = chunk.modifier(); @@ -289,7 +289,7 @@ public class GeneratorTest { final int maxSection = 5; final int sectionCount = maxSection - minSection; Section[] sections = new Section[sectionCount]; - Arrays.setAll(sections, i -> new Section()); + Arrays.setAll(sections, i -> Section.create()); var chunkUnits = GeneratorImpl.chunk(minSection, maxSection, List.of(sections), 3, -2); Generator generator = chunk -> chunk.modifier().fillHeight(0, 32, Block.STONE); generator.generate(chunkUnits); @@ -313,7 +313,7 @@ public class GeneratorTest { final int maxSection = 5; final int sectionCount = maxSection - minSection; Section[] sections = new Section[sectionCount]; - Arrays.setAll(sections, i -> new Section()); + Arrays.setAll(sections, i -> Section.create()); var chunkUnits = GeneratorImpl.chunk(minSection, maxSection, List.of(sections), 3, -2); Generator generator = chunk -> chunk.modifier().fillHeight(1, 33, Block.STONE); generator.generate(chunkUnits); @@ -347,7 +347,7 @@ public class GeneratorTest { @Test public void sectionFill() { - Section section = new Section(); + Section section = Section.create(); var chunkUnit = GeneratorImpl.section(section, -1, -1, 0); Generator generator = chunk -> chunk.modifier().fill(Block.STONE); generator.generate(chunkUnit);