333435363738394041
assertEquals(true, new Vector3(0f, 0f, 0f).equals(block.a)); } @Test public void getBlockNegative() { Block block = world.chunks.getBlock(new Vector3(-0.5f, 0.5f, -0.5f)); assertEquals(true, new Vector3(-1f, 0f, -1f).equals(block.a)); }
404142434445464748
assertEquals(true, new Vector3(-1f, 0f, -1f).equals(block.a)); } @Test public void getBlockOrigin() { Block block = world.chunks.getBlock(new Vector3(0f, 0f, 0f)); assertEquals(true, new Vector3(0f, 0f, 0f).equals(block.a)); }
57585960616263
world.chunks.getBlock(new Vector3(0f, -1000000f, 0f)); } @Test(expected=IllegalArgumentException.class) public void setBlockHigh() { world.chunks.setBlock(new Block(new Vector3(0f, 100000f, 0f), 1f, null)); }
62636465666768
world.chunks.setBlock(new Block(new Vector3(0f, 100000f, 0f), 1f, null)); } @Test(expected=IllegalArgumentException.class) public void setBlockLow() { world.chunks.setBlock(new Block(new Vector3(0f, -1000000f, 0f), 1f, null)); }
67686970717273
world.chunks.setBlock(new Block(new Vector3(0f, -1000000f, 0f), 1f, null)); } @Test(expected=IllegalArgumentException.class) public void setBlockFloat() { world.chunks.setBlock(new Block(new Vector3(0f, 0.1f, 0f), 1f, null)); }
112113114115116117118119120121122
if (Mouse.isButtonDown(0)) { model.chunks.setBlock(new Air(model.chunks.selected, 1.0f)); } if (Mouse.isButtonDown(1)) { Block newBlock = new Solid(model.chunks.getBlock(model.chunks.selected).a.add(new Vector3(0f, 1f, 0f)), 1.0f, new Greyscale(16.0f, 0.0f)); model.chunks.setBlock(newBlock); } break; }
262728293031323334
world = new Model(new Camera(new Vector3(0f, 0f, 0f), 0f, 0f, 0f, false)); } @Test public void getBlock() { Block block = world.chunks.getBlock(new Vector3(0.5f, 0.5f, 0.5f)); assertEquals(true, new Vector3(0f, 0f, 0f).equals(block.a)); }