mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-12-03 03:31:32 +00:00
Remove Mantle.isCarved, carved().get(x, y, z) != null asks the same
The mantle had two ways to ask whether a position holds a carved void. The layer is the one way now.
This commit is contained in:
1 parent
307b89c5fe
commit
0691753d21
8 files changed
+7
-24
No files matched your search
@@ -60,11 +60,6 @@ final class ChunkMantle implements Mantle {
|
||||
return carved;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCarved(int x, int y, int z) {
|
||||
return mantle.isCarved(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlatformBiome(int x, int y, int z, ResourceId biome) {
|
||||
requireOwnChunk(x, y, z);
|
||||
|
||||
@@ -140,12 +140,6 @@ final class PlacementViews {
|
||||
return carved;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCarved(int x, int y, int z) {
|
||||
checkPosition(bounds(), x, y, z);
|
||||
return parent.isCarved(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlatformBiome(int x, int y, int z, ResourceId biome) {
|
||||
checkPosition(bounds(), x, y, z);
|
||||
|
||||
@@ -198,8 +198,6 @@ class ChunkPipelineTest {
|
||||
public ModuleInfo info() { return ModuleInfo.of("test:caves", "Caves", "1"); }
|
||||
public void setup(ModuleSetup setup) {
|
||||
setup.stages().define(probe).run(context -> {
|
||||
carved.add(String.valueOf(context.mantle().isCarved(6, 9, 2)));
|
||||
carved.add(String.valueOf(context.mantle().isCarved(6, 10, 2)));
|
||||
carved.add(String.valueOf(context.mantle().carved().get(6, 9, 2)));
|
||||
carved.add(String.valueOf(context.mantle().carved().get(6, 10, 2)));
|
||||
carved.add(assertThrows(UnsupportedOperationException.class,
|
||||
@@ -216,7 +214,7 @@ class ChunkPipelineTest {
|
||||
StageTimings.NONE);
|
||||
|
||||
var cannotCarve = "Carved voids are planned by mantle stages (Stage.mantle), not by chunk stages";
|
||||
assertEquals(List.of("true", "false", CarvedVoid.OPEN.toString(), "null", cannotCarve, cannotCarve), carved);
|
||||
assertEquals(List.of(CarvedVoid.OPEN.toString(), "null", cannotCarve, cannotCarve), carved);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -38,7 +38,6 @@ public final class MemoryMantle {
|
||||
public <T> MantleLayer<T> layer(MantleKey<T> key) { return new Layer<>(key, bounds, true); }
|
||||
public MantleLayer<BlockState> blocks() { return new Layer<>(PLANNED_BLOCKS, bounds, false); }
|
||||
public MantleLayer<CarvedVoid> carved() { return new Layer<>(CAVERNS, bounds, true); }
|
||||
public boolean isCarved(int x, int y, int z) { return new Layer<>(CAVERNS, bounds, false).get(x, y, z) != null; }
|
||||
public void setPlatformBiome(int x, int y, int z, ResourceId biome) {
|
||||
if (!bounds.contains(x, y, z)) throw new IndexOutOfBoundsException("Outside the mantle view: " + x + "," + y + "," + z);
|
||||
values(PLATFORM_BIOMES).put(new BlockPosition(x, y, z), biome);
|
||||
|
||||
Reference in new issue
Block a user