aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/AlvearyHandler.java
blob: ab093645b6b1def841ca8fb2ac886c3bc46e1b64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package gtPlusPlus.xmod.forestry.bees.alveary;

import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.registry.GameRegistry;
import forestry.core.items.ItemBlockForestry;
import forestry.core.utils.StringUtil;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;

public class AlvearyHandler {

	@Optional.Method(modid = "Forestry")
	public static void run(){
		if (!LoadedMods.ExtraBees){
			if (CORE.configSwitches.enableCustomAlvearyBlocks){//Alveary Stuff
				FR_BlockAlveary alveary;
				alveary = registerBlock(new FR_BlockAlveary(), ItemBlockForestry.class, "alveary");
				GameRegistry.registerTileEntity(TileAlvearyFrameHousing.class, "FrameHousing");
			}
		}
	}

	protected static <T extends Block> T registerBlock(final T block, final Class<? extends ItemBlock> itemClass, final String name, final Object... itemCtorArgs) {
		block.setBlockName("for." + name);
		GameRegistry.registerBlock(block, itemClass, StringUtil.cleanBlockName(block), itemCtorArgs);
		return block;
	}

}