use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testOnRemove.
@Test
public void testOnRemove() {
FakeWorld world = FakeWorld.newWorld("TestOnRemove");
world.setBlock(0, 0, 0, block);
Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
tile.onRemove(block, 0);
}
use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testGetOwnerProfile.
@Test
public void testGetOwnerProfile() {
FakeWorld world = FakeWorld.newWorld("TestGetOwnerprofile");
world.setBlock(0, 0, 0, block);
Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
tile.getOwnerProfile();
}
use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testDetermineOrientation.
@Test
public void testDetermineOrientation() {
FakeWorld world = FakeWorld.newWorld("TestDetermineOrientation");
world.setBlock(0, 0, 0, block);
Tile tile = ((Tile) world.getTileEntity(0, 0, 0));
tile.determineOrientation(player);
//TODO maybe check to ensure direction is valid
}
use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.
the class AbstractTileTest method testOnPlayerActivated.
@Test
public void testOnPlayerActivated() {
world.setBlock(0, 0, 0, block);
Tile tile = (Tile) world.getTileEntity(0, 0, 0);
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
//We divide the face of the tile into 16 sub sections
for (int i = 0; i <= 256; i++) {
tile.onPlayerActivated(player, dir.ordinal(), getNextClick(dir, i));
}
}
}
use of com.builtbroken.mc.prefab.tile.Tile in project Engine by VoltzEngine-Project.
the class ModManager method newBlock.
/**
* Creates a new block based on the Tile class provided
* Handles most common registration and data input tasks for the creation of the block.
* This includes registering the block, tile, built in item & tile renders. It also inits
* the instance used for the block itself.
*
* @param spatialClass - class that will provide all the data to be used when creating the block.
* @param args - arguments needed to create a new instance of the spatial class
*/
public BlockTile newBlock(String name, Class<? extends Tile> spatialClass, Object... args) {
try {
Tile spatial;
if (args != null && args.length > 0) {
List<Class> paramTypes = new ArrayList();
for (Object arg : args) {
paramTypes.add(arg.getClass());
}
spatial = spatialClass.getConstructor(paramTypes.toArray(new Class[paramTypes.size()])).newInstance();
} else {
spatial = spatialClass.newInstance();
}
return newBlock(name, spatial);
} catch (Exception e) {
throw new RuntimeException(name() + " Tile [" + spatialClass.getSimpleName() + "] failed to be created:", e);
}
}
Aggregations