use of crazypants.enderio.base.init.IModObject in project EnderIO by SleepyTrousers.
the class GuiHelper method init.
public static void init(@Nonnull FMLInitializationEvent event) {
NNList<Registerable> objects = ModObjectRegistry.getObjects();
for (int i = 0; i < objects.size(); i++) {
IModObject mo = objects.get(i);
if (mo.getBlock() instanceof IEioGuiHandler.WithServerComponent || mo.getItem() instanceof IEioGuiHandler.WithServerComponent) {
Log.info("Registered permission ", PermissionAPI.registerNode(getPermission(mo), DefaultPermissionLevel.ALL, "Permission to open the GUI(s) of Ender IO's " + mo.getUnlocalisedName()));
}
}
NetworkRegistry.INSTANCE.registerGuiHandler(EnderIO.getInstance(), new GuiHandler());
}
use of crazypants.enderio.base.init.IModObject in project EnderIO by SleepyTrousers.
the class BlockPaintedSlabManager method create_double.
private static Block create_double(@Nonnull IModObject modObject, @Nonnull Material material, @Nonnull SoundType sound) {
if (modObject instanceof ModObject) {
final ModObject halfSlabObject = ModObject.values()[((ModObject) modObject).ordinal() - 1];
BlockPaintedSlab.BlockPaintedHalfSlab halfSlabBlock = (BlockPaintedSlab.BlockPaintedHalfSlab) halfSlabObject.getBlockNN();
BlockPaintedSlab.BlockPaintedDoubleSlab doubleSlab = new BlockPaintedSlab.BlockPaintedDoubleSlab(modObject, material, halfSlabBlock, sound);
doubleSlab.setHardness(2.0F).setResistance(5.0F);
doubleSlab.init(modObject);
return doubleSlab;
} else {
throw new RuntimeException("Bad block initialization, " + modObject + " is not a ModObject!");
}
}
Aggregations