use of com.skelril.nitro.registry.block.ICustomBlock in project Skree by Skelril.
the class CustomBlockSystem method register.
// Invoked via reflection
@SuppressWarnings("unused")
private void register(Object block) {
if (block instanceof Block && block instanceof ICustomBlock) {
((Block) block).setUnlocalizedName("skree_" + ((ICustomBlock) block).__getID());
((Block) block).setRegistryName("skree:" + ((ICustomBlock) block).__getID());
GameRegistry.register((Block) block);
ItemBlock itemBlock = new ItemBlock((Block) block);
itemBlock.setUnlocalizedName("skree_" + ((ICustomBlock) block).__getID());
itemBlock.setRegistryName("skree:" + ((ICustomBlock) block).__getID());
GameRegistry.register(itemBlock);
// Add selective hooks
if (block instanceof EventAwareContent) {
Sponge.getEventManager().registerListeners(SkreePlugin.inst(), block);
}
if (block instanceof GraveStone) {
GameRegistry.registerTileEntity(GraveStoneTileEntity.class, "skree:grave_stone_ent");
}
} else {
throw new IllegalArgumentException("Invalid custom item!");
}
}
use of com.skelril.nitro.registry.block.ICustomBlock in project Skree by Skelril.
the class CustomBlockSystem method render.
// Invoked via reflection
@SuppressWarnings("unused")
private void render(Object block) {
if (block instanceof Block && block instanceof ICustomBlock) {
if (Sponge.getPlatform().getExecutionType().isClient()) {
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
renderItem.getItemModelMesher().register(Item.getItemFromBlock((Block) block), 0, new ModelResourceLocation("skree:" + ((ICustomBlock) block).__getID(), "inventory"));
}
} else {
throw new IllegalArgumentException("Invalid custom item!");
}
}
Aggregations