Skip to content

Commit

Permalink
Fixup data consistency check
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Jan 24, 2025
1 parent d4f5825 commit 1235f70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions server/src/test/java/com/soulfiremc/test/DataTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public class DataTest {
public void checkBlockStateTypeCorrect() {
var airBlockState = BlockState.forDefaultBlockType(BlockType.AIR);

assertEquals(airBlockState.blockType(), BlockType.AIR);
assertNotEquals(airBlockState.blockType(), BlockType.DIRT);
assertEquals(BlockType.AIR, airBlockState.blockType());
assertNotEquals(BlockType.DIRT, airBlockState.blockType());

assertSame(airBlockState.blockType(), BlockType.AIR);
assertNotSame(airBlockState.blockType(), BlockType.DIRT);
assertSame(BlockType.AIR, airBlockState.blockType());
assertNotSame(BlockType.DIRT, airBlockState.blockType());
}

@Test
Expand All @@ -43,7 +43,7 @@ public void checkBlockShapesCorrect() {
assertNotEquals(airBlockState.collisionShape(), dirtBlockState.collisionShape());
assertNotSame(airBlockState.collisionShape(), dirtBlockState.collisionShape());

assertEquals(airBlockState.collisionShape().blockShapes().size(), 0);
assertEquals(dirtBlockState.collisionShape().blockShapes().size(), 1);
assertEquals(0, airBlockState.collisionShape().blockShapes().size());
assertEquals(1, dirtBlockState.collisionShape().blockShapes().size());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public void setBlockAt(int x, int y, int z, BlockType block) {
var targetState = BlockState.forDefaultBlockType(block);
if (targetState == defaultBlock) {
blocks.remove(SFVec3i.from(x, y, z));
return;
} else {
blocks.put(SFVec3i.from(x, y, z), targetState);
}

blocks.put(SFVec3i.from(x, y, z), targetState);
minX = Math.min(minX, x);
minY = Math.min(minY, y);
minZ = Math.min(minZ, z);
Expand Down

0 comments on commit 1235f70

Please sign in to comment.