Search in sources :

Example 11 with Box

use of buildcraft.lib.misc.data.Box in project BuildCraft by BuildCraft.

the class BoxTester method testCenter.

@Test
public void testCenter() {
    Box box = new Box(MIN, MAX);
    Assert.assertEquals(CENTER, box.center());
}
Also used : Box(buildcraft.lib.misc.data.Box) Test(org.junit.Test)

Example 12 with Box

use of buildcraft.lib.misc.data.Box in project BuildCraft by BuildCraft.

the class BoxTester method testIntersection2.

@Test
public void testIntersection2() {
    Box box1 = new Box(new BlockPos(0, 0, 0), new BlockPos(2, 2, 2));
    Box box2 = new Box(new BlockPos(0, 0, 0), new BlockPos(3, 3, 3));
    Box inter = new Box(new BlockPos(0, 0, 0), new BlockPos(2, 2, 2));
    Assert.assertEquals(inter, box1.getIntersect(box2));
    Assert.assertEquals(inter, box2.getIntersect(box1));
}
Also used : Box(buildcraft.lib.misc.data.Box) BlockPos(net.minecraft.util.math.BlockPos) Test(org.junit.Test)

Example 13 with Box

use of buildcraft.lib.misc.data.Box in project BuildCraft by BuildCraft.

the class BoxTester method testMin.

@Test
public void testMin() {
    Box box = new Box(MIN, MAX);
    Assert.assertEquals(MIN, box.min());
}
Also used : Box(buildcraft.lib.misc.data.Box) Test(org.junit.Test)

Example 14 with Box

use of buildcraft.lib.misc.data.Box in project BuildCraft by BuildCraft.

the class BoxTester method testIntersection3.

@Test
public void testIntersection3() {
    Box box1 = new Box(new BlockPos(1, 1, 1), new BlockPos(2, 2, 2));
    Box box2 = new Box(new BlockPos(0, 0, 0), new BlockPos(1, 1, 1));
    Box inter = new Box(new BlockPos(1, 1, 1), new BlockPos(1, 1, 1));
    Assert.assertEquals(inter, box1.getIntersect(box2));
    Assert.assertEquals(inter, box2.getIntersect(box1));
}
Also used : Box(buildcraft.lib.misc.data.Box) BlockPos(net.minecraft.util.math.BlockPos) Test(org.junit.Test)

Example 15 with Box

use of buildcraft.lib.misc.data.Box in project BuildCraft by BuildCraft.

the class BoxTester method testSize.

@Test
public void testSize() {
    Box box = new Box(MIN, MAX);
    Assert.assertEquals(SIZE, box.size());
}
Also used : Box(buildcraft.lib.misc.data.Box) Test(org.junit.Test)

Aggregations

Box (buildcraft.lib.misc.data.Box)19 BlockPos (net.minecraft.util.math.BlockPos)10 Test (org.junit.Test)9 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)4 IBox (buildcraft.api.core.IBox)2 VolumeConnection (buildcraft.core.marker.VolumeConnection)2 NBTUtilBC (buildcraft.lib.misc.NBTUtilBC)2 PacketBufferBC (buildcraft.lib.net.PacketBufferBC)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 NBTUtil (net.minecraft.nbt.NBTUtil)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 Vec3d (net.minecraft.util.math.Vec3d)2 World (net.minecraft.world.World)2 EnumPipePart (buildcraft.api.core.EnumPipePart)1 IAreaProvider (buildcraft.api.core.IAreaProvider)1 IPathProvider (buildcraft.api.core.IPathProvider)1 EnumOptionalSnapshotType (buildcraft.api.enums.EnumOptionalSnapshotType)1 EnumSnapshotType (buildcraft.api.enums.EnumSnapshotType)1