use of com.skelril.nitro.selector.EventAwareContent 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!");
}
}
Aggregations