Java Code Examples for cpw.mods.fml.common.registry.GameRegistry#registerWorldGenerator()

The following examples show how to use cpw.mods.fml.common.registry.GameRegistry#registerWorldGenerator() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EtFuturum.java    From Et-Futurum with The Unlicense 6 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	ConfigurationHandler.INSTANCE.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator + Reference.MOD_ID + ".cfg"));

	GameRegistry.registerWorldGenerator(new EtFuturumWorldGenerator(), 0);

	ModBlocks.init();
	ModItems.init();
	ModEnchantments.init();

	OceanMonument.makeMap();

	NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
	networkWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.MOD_ID);
	networkWrapper.registerMessage(ArmourStandInteractHandler.class, ArmourStandInteractMessage.class, 0, Side.SERVER);
	networkWrapper.registerMessage(BlackHeartParticlesHandler.class, BlackHeartParticlesMessage.class, 1, Side.CLIENT);
	networkWrapper.registerMessage(SetPlayerModelHandler.class, SetPlayerModelMessage.class, 2, Side.CLIENT);
}
 
Example 2
Source File: AdvancedMod.java    From AdvancedMod with GNU General Public License v3.0 6 votes vote down vote up
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event){
    ModBlocks.init();
    ModTileEntities.init();
    proxy.preInit();
    GameRegistry.registerWorldGenerator(new WorldGeneratorFlag(), 0);
    NetworkHandler.init();
    DescriptionHandler.init();
    NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
    MinecraftForge.EVENT_BUS.register(new AdvancedModEventHandler());//For registering events from the net.miencraftforge.event package.
    FMLCommonHandler.instance().bus().register(new AdvancedModEventHandler());//For registering events from the cpw.mods.fml.gameevent package.
    FMLInterModComms.sendMessage(Reference.MOD_ID, "camoMineBlacklist", new ItemStack(Blocks.stone));
    FMLInterModComms.sendMessage("Waila", "register", "com.minemaarten.advancedmod.thirdparty.waila.Waila.onWailaCall");
    Log.info("Pre Initialization Complete!");

    if(Loader.isModLoaded("Thaumcraft")) {
        loadThaumcraft();
    }
}
 
Example 3
Source File: Chisel.java    From Chisel-2 with GNU General Public License v2.0 6 votes vote down vote up
@EventHandler
public void init(FMLInitializationEvent event) {
	Features.init();

	NetworkRegistry.INSTANCE.registerGuiHandler(this, new ChiselGuiHandler());

	addWorldgen(Features.MARBLE, ChiselBlocks.marble, Configurations.marbleAmount);
	addWorldgen(Features.LIMESTONE, ChiselBlocks.limestone, Configurations.limestoneAmount);
	addWorldgen(Features.ANDESITE, ChiselBlocks.andesite, Configurations.andesiteAmount, 40, 100, 0.5);
	addWorldgen(Features.GRANITE, ChiselBlocks.granite, Configurations.graniteAmount, 40, 100, 0.5);
	addWorldgen(Features.DIORITE, ChiselBlocks.diorite, Configurations.dioriteAmount, 40, 100, 0.5);
	GameRegistry.registerWorldGenerator(GeneratorChisel.INSTANCE, 1000);

       EntityRegistry.registerModEntity(EntityChiselSnowman.class, "snowman", 0, this, 80, 1, true);

	proxy.init();
	MinecraftForge.EVENT_BUS.register(this);
	FMLCommonHandler.instance().bus().register(instance);

	FMLInterModComms.sendMessage("Waila", "register", "com.cricketcraft.chisel.compat.WailaCompat.register");
}
 
Example 4
Source File: HexxitGear.java    From HexxitGear with GNU General Public License v3.0 6 votes vote down vote up
@Init
public void init(FMLInitializationEvent evt) {
    hexbiscus = new BlockHexbiscus(HexxitGearConfig.hexbiscus.getInt());

    tribalHelmet = new ItemTribalArmor(HexxitGearConfig.tribalHelmetId.getInt(), proxy.addArmor("tribal"), 0).setUnlocalizedName("hexxitgear.tribal.helmet");
    tribalChest = new ItemTribalArmor(HexxitGearConfig.tribalChestId.getInt(), proxy.addArmor("tribal"), 1).setUnlocalizedName("hexxitgear.tribal.chest");
    tribalLeggings = new ItemTribalArmor(HexxitGearConfig.tribalLeggingsId.getInt(), proxy.addArmor("tribal"), 2).setUnlocalizedName("hexxitgear.tribal.leggings");
    tribalShoes = new ItemTribalArmor(HexxitGearConfig.tribalShoesId.getInt(), proxy.addArmor("tribal"), 3).setUnlocalizedName("hexxitgear.tribal.boots");
    scaleHelmet = new ItemScaleArmor(HexxitGearConfig.scaleHelmetId.getInt(), proxy.addArmor("scale"), 0).setUnlocalizedName("hexxitgear.scale.helmet");
    scaleChest = new ItemScaleArmor(HexxitGearConfig.scaleChestId.getInt(), proxy.addArmor("scale"), 1).setUnlocalizedName("hexxitgear.scale.chest");
    scaleLeggings = new ItemScaleArmor(HexxitGearConfig.scaleLeggingsId.getInt(), proxy.addArmor("scale"), 2).setUnlocalizedName("hexxitgear.scale.leggings");
    scaleBoots = new ItemScaleArmor(HexxitGearConfig.scaleBootsId.getInt(), proxy.addArmor("scale"), 3).setUnlocalizedName("hexxitgear.scale.boots");
    thiefHelmet = new ItemThiefArmor(HexxitGearConfig.thiefHelmetId.getInt(), proxy.addArmor("thief"), 0).setUnlocalizedName("hexxitgear.thief.helmet");
    thiefChest = new ItemThiefArmor(HexxitGearConfig.thiefChestId.getInt(), proxy.addArmor("thief"), 1).setUnlocalizedName("hexxitgear.thief.chest");
    thiefLeggings = new ItemThiefArmor(HexxitGearConfig.thiefLeggingsId.getInt(), proxy.addArmor("thief"), 2).setUnlocalizedName("hexxitgear.thief.leggings");
    thiefBoots = new ItemThiefArmor(HexxitGearConfig.thiefBootsId.getInt(), proxy.addArmor("thief"), 3).setUnlocalizedName("hexxitgear.thief.boots");

    hexicalEssence = new ItemHexicalEssence(HexxitGearConfig.hexicalEssence.getInt());
    hexicalDiamond = new ItemHexicalDiamond(HexxitGearConfig.hexicalDiamond.getInt());

    GameRegistry.registerBlock(hexbiscus, hexbiscus.getUnlocalizedName());

    GameRegistry.registerWorldGenerator(new HGWorldGen());

    proxy.init();
}
 
Example 5
Source File: QCraftProxyCommon.java    From qcraft-mod with Apache License 2.0 5 votes vote down vote up
private void registerForgeHandlers()
{
    ForgeHandlers handlers = new ForgeHandlers();
    MinecraftForge.EVENT_BUS.register( handlers );
    FMLCommonHandler.instance().bus().register( handlers );
    if( QCraft.enableWorldGen )
    {
        GameRegistry.registerWorldGenerator( new QuantumOreGenerator(), 1 );
    }
    NetworkRegistry.INSTANCE.registerGuiHandler( QCraft.instance, handlers );

    ConnectionHandler connectionHandler = new ConnectionHandler();
    MinecraftForge.EVENT_BUS.register( connectionHandler );
    FMLCommonHandler.instance().bus().register( connectionHandler );
}
 
Example 6
Source File: BurlapCraft.java    From burlapcraft with GNU Lesser General Public License v3.0 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	

	burlapStone = new BlockBurlapStone();
	redRock = new BlockRedRock();
	blueRock = new BlockBlueRock();
	orangeRock = new BlockOrangeRock();
	greenRock = new BlockGreenRock();
	mineableRedRock = new BlockMineableRedRock();
	mineableOrangeRock = new BlockMineableOrangeRock();
	mineableGreenRock = new BlockMineableGreenRock();
	mineableBlueRock = new BlockMineableBlueRock();
	
	// make sure minecraft knows
	GameRegistry.registerBlock(burlapStone, "burlapstone");
	GameRegistry.registerBlock(redRock, "redrock");
	GameRegistry.registerBlock(blueRock, "bluerock");
	GameRegistry.registerBlock(greenRock, "greenrock");
	GameRegistry.registerBlock(orangeRock, "orangerock");
	GameRegistry.registerBlock(mineableRedRock, "mineableRedRock");
	GameRegistry.registerBlock(mineableGreenRock, "mineableGreenRock");
	GameRegistry.registerBlock(mineableBlueRock, "mineableBlueRock");
	GameRegistry.registerBlock(mineableOrangeRock, "mineableOrangeRock");
	GameRegistry.registerWorldGenerator(genHandler, 0);
	
	MinecraftForge.EVENT_BUS.register(eventHandler);
	// FMLCommonHandler.instance().bus().register(fmlHandler);
	
}
 
Example 7
Source File: GardenTrees.java    From GardenCollection with MIT License 5 votes vote down vote up
@Mod.EventHandler
public void init (FMLInitializationEvent event) {
    proxy.registerRenderers();
    integration.init();

    MinecraftForge.EVENT_BUS.register(new ForgeEventHandler());
    FMLCommonHandler.instance().bus().register(new ForgeEventHandler());

    GameRegistry.registerFuelHandler(new FuelHandler());

    if (config.generateCandelilla)
        GameRegistry.registerWorldGenerator(new WorldGenCandelilla(ModBlocks.candelilla), 10);
}
 
Example 8
Source File: PneumaticCraft.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void PreInit(FMLPreInitializationEvent event){
    event.getModMetadata().version = Versions.fullVersionString();
    isNEIInstalled = Loader.isModLoaded(ModIds.NEI);

    PneumaticRegistry.init(PneumaticCraftAPIHandler.getInstance());
    UpgradeRenderHandlerList.init();
    SensorHandler.init();
    Config.init(event.getSuggestedConfigurationFile());
    ThirdPartyManager.instance().index();

    NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
    tabPneumaticCraft = new CreativeTabPneumaticCraft("tabPneumaticCraft");
    Fluids.initFluids();
    Blockss.init();
    Itemss.init();
    HackableHandler.addDefaultEntries();
    ModuleRegistrator.init();
    WidgetRegistrator.init();
    ThirdPartyManager.instance().preInit();
    TileEntityRegistrator.init();
    EntityRegistrator.init();
    SemiBlockInitializer.init();
    CraftingRegistrator.init();
    VillagerHandler.instance().init();
    GameRegistry.registerWorldGenerator(new WorldGeneratorPneumaticCraft(), 0);
    AchievementHandler.init();
    HeatBehaviourManager.getInstance().init();

    proxy.registerRenders();
    proxy.registerHandlers();
    tickHandler = new TickHandlerPneumaticCraft();
    FMLCommonHandler.instance().bus().register(tickHandler);
    MinecraftForge.EVENT_BUS.register(new EventHandlerPneumaticCraft());
    MinecraftForge.EVENT_BUS.register(new EventHandlerUniversalSensor());
    MinecraftForge.EVENT_BUS.register(new DroneSpecialVariableHandler());

    FMLCommonHandler.instance().bus().register(new CraftingHandler());
    FMLCommonHandler.instance().bus().register(new Config());
}