Java Code Examples for net.minecraftforge.fml.common.registry.GameRegistry#registerWorldGenerator()

The following examples show how to use net.minecraftforge.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: CommonProxy.java    From EmergingTechnology with MIT License 6 votes vote down vote up
public void preInit(FMLPreInitializationEvent e) {
    RegistrationHandler.registerFluids();

    EmergingTechnologyConfig.preInit();
    ModLoader.preInit();

    GameRegistry.registerWorldGenerator(OreGenerator.instance, 10);
    MinecraftForge.EVENT_BUS.register(OreGenerator.instance);

    ModBulbProvider.preInit(e);
    ModMediumProvider.preInit(e);
    ModFluidProvider.preInit(e);
    ModTissueProvider.preInit(e);

    CraftTweakerHelper.preInit();

    PacketHandler.registerMessages(EmergingTechnology.MODID);
}
 
Example 2
Source File: WorldGenRegistry.java    From GregTech with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void initializeRegistry() {
    GTLog.logger.info("Initializing ore generation registry...");
    registerShapeGenerator("ellipsoid", EllipsoidGenerator::new);
    registerShapeGenerator("sphere", SphereGenerator::new);
    registerShapeGenerator("plate", PlateGenerator::new);
    registerShapeGenerator("single", SingleBlockGenerator::new);
    registerBlockFiller("simple", SimpleBlockFiller::new);
    registerBlockFiller("ignore_bedrock", () -> new BlacklistedBlockFiller(Lists.newArrayList(Blocks.BEDROCK.getDefaultState())));
    registerVeinPopulator("surface_rock", SurfaceRockPopulator::new);
    registerVeinPopulator("fluid_spring", FluidSpringPopulator::new);
    registerVeinPopulator("surface_block", SurfaceBlockPopulator::new);

    WorldGeneratorImpl worldGenerator = new WorldGeneratorImpl();
    GameRegistry.registerWorldGenerator(worldGenerator, 1);
    MinecraftForge.ORE_GEN_BUS.register(worldGenerator);
    try {
        reinitializeRegisteredVeins();
    } catch (IOException | RuntimeException exception) {
        GTLog.logger.fatal("Failed to initialize worldgen registry.", exception);
    }
}
 
Example 3
Source File: TofuMain.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    proxy.preInit(event);

    logger = event.getModLog();

    TofuEntityRegister.entitySpawn();

    TofuCompat.preInit();

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

    MapGenStructureIO.registerStructure(MapGenTofuVillage.Start.class,"TofuVillage");
    StructureTofuVillagePieces.registerVillagePieces();
    MapGenStructureIO.registerStructure(StructureTofuMineshaftStart.class,"TofuMineshaft");
    StructureTofuMineshaftPieces.registerStructurePieces();
    MapGenStructureIO.registerStructure(MapGenTofuCastle.Start.class, "TofuCastle");
    TofuCastlePiece.registerTofuCastlePiece();

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


    zunda = new DamageSource("zunda") {
        @Override
        public ITextComponent getDeathMessage(EntityLivingBase entityLivingBaseIn) {
            String s = "death.attack.zunda";
            String s1 = s + ".player";

            return new TextComponentString(entityLivingBaseIn.getDisplayName().getFormattedText() + " ").appendSibling(new TextComponentTranslation(s1, new Object[]{entityLivingBaseIn.getDisplayName()}));
        }
    }.setDamageIsAbsolute();

    TOFU_DIMENSION = DimensionType.register("Tofu World", "_tofu", TofuConfig.dimensionID, WorldProviderTofu.class, false);
    DimensionManager.registerDimension(TofuConfig.dimensionID, TOFU_DIMENSION);

    TofuVillages.register();
}
 
Example 4
Source File: GregTechMod.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Mod.EventHandler
public void onInit(FMLInitializationEvent event) {
    proxy.onLoad();
    if (RecipeMap.isFoundInvalidRecipe()) {
        GTLog.logger.fatal("Seems like invalid recipe was found.");
        //crash if config setting is set to false, or we are in deobfuscated environment
        if (!ConfigHolder.ignoreErrorOrInvalidRecipes || !FMLForgePlugin.RUNTIME_DEOBF) {
            GTLog.logger.fatal("Loading cannot continue. Either fix or report invalid recipes, or enable ignoreErrorOrInvalidRecipes in the config as a temporary solution");
            throw new LoaderException("Found at least one invalid recipe. Please read the log above for more details.");
        } else {
            GTLog.logger.fatal("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
            GTLog.logger.fatal("Ignoring invalid recipes and continuing loading");
            GTLog.logger.fatal("Some things may lack recipes or have invalid ones, proceed at your own risk");
            GTLog.logger.fatal("Report to GTCE github to get more help and fix the problem");
            GTLog.logger.fatal("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
        }
    }

    if (GTValues.isModLoaded(GTValues.MODID_FMP)) {
        GTLog.logger.info("ForgeMultiPart found. Legacy block conversion enabled.");
        registerForgeMultipartCompat();
    }

    if (GTValues.isModLoaded(GTValues.MODID_TOP)) {
        GTLog.logger.info("TheOneProbe found. Enabling integration...");
        TheOneProbeCompatibility.registerCompatibility();
    }
    WorldGenRegistry.INSTANCE.initializeRegistry();
    if (!ConfigHolder.disableRubberTreeGeneration) {
        GameRegistry.registerWorldGenerator(new WorldGenRubberTree(), 10000);
        GameRegistry.registerWorldGenerator(new WorldGenAbandonedBase(), 20000);
    }
    LootTableHelper.initialize();
    FilterTypeRegistry.init();
    CoverBehaviors.init();
    DungeonLootLoader.init();
}
 
Example 5
Source File: GTMod.java    From GT-Classic with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Mod.EventHandler
public void init(FMLInitializationEvent e) {
	GTMaterialElement.init();
	GTRecipeIterators.init();
	GTTileCentrifuge.init();
	GTTileUUMAssembler.init();
	GTTileMagicEnergyConverter.init();
	GTRecipe.initShapeless();
	GTRecipe.initItems();
	GTRecipe.initBlocks();
	GTRecipe.initIC2();
	GTRecipe.initIC2Circuits();
	GTRecipe.initIC2Jetpacks();
	GTRecipe.initIC2Overrides();
	GTRecipe.initProcessing();
	GTBedrockOreHandler.bedrockOresInit();
	GameRegistry.registerWorldGenerator(new GTWorldGen(), 0);
	MinecraftForge.EVENT_BUS.register(new GTEventOnLivingFall());
	MinecraftForge.EVENT_BUS.register(new GTEventLootTableLoad());
	MinecraftForge.EVENT_BUS.register(new GTEventCheckSpawn());
	MinecraftForge.EVENT_BUS.register(new GTEventEntityViewRenderEvent());
	MinecraftForge.EVENT_BUS.register(new GTEventPopulateChunk());
	MinecraftForge.EVENT_BUS.register(new GTEventItemTooltip());
	if (!Loader.isModLoaded(GTValues.MOD_ID_FASTLEAF)) {
		MinecraftForge.EVENT_BUS.register(new GTEventNeighborNotifyEvent());
	}
	MinecraftForge.TERRAIN_GEN_BUS.register(new GTEventDecorateBiome());
	IC2.saveManager.registerGlobal("IDSU_Storage", GTIDSUStorageManager.class, false);
	proxy.init(e);
}
 
Example 6
Source File: WorldGenOre.java    From customstuff4 with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void doInit(InitPhase phase, ContentHelper helper)
{
    if (target != null)
        targetBlock = Block.REGISTRY.getObject(target);

    createGenerator();

    GameRegistry.registerWorldGenerator(this, weight);
}
 
Example 7
Source File: ValkyrienSkiesWorld.java    From Valkyrien-Skies with Apache License 2.0 5 votes vote down vote up
@EventHandler
protected void init(FMLInitializationEvent event) {
    EntityRegistry.registerModEntity(
        new ResourceLocation(ValkyrienSkiesWorld.MOD_ID, "fall_up_block_entity"),
        EntityFallingUpBlock.class,
        "fall_up_block_entity",
        75, ValkyrienSkiesWorld.INSTANCE, 80, 1, true);

    MinecraftForge.EVENT_BUS.register(worldEventsCommon);
    GameRegistry.registerWorldGenerator(new ValkyrienSkiesWorldGen(), 1);
    proxy.init(event);
}
 
Example 8
Source File: LogisticsPipes2.java    From Logistics-Pipes-2 with MIT License 5 votes vote down vote up
@Mod.EventHandler
public void init(FMLInitializationEvent event){
	proxy.init(event);
	LPWorldGen worldGen = new LPWorldGen();
	GameRegistry.registerWorldGenerator(worldGen, 0);
	MinecraftForge.EVENT_BUS.register(worldGen);
}
 
Example 9
Source File: PLWorldGen.java    From Production-Line with MIT License 5 votes vote down vote up
public PLWorldGen(IBlockState blockState, int ticket, int maxHeight, int genSize) {
    this.GEN_BLOCK = blockState;
    this.TICKET = ticket;
    this.MAX_HEIGHT = maxHeight;
    this.GEN_SIZE = genSize;
    GameRegistry.registerWorldGenerator(this, index);
    ++index;
}
 
Example 10
Source File: TestGenerator.java    From simpleretrogen with GNU General Public License v3.0 5 votes vote down vote up
@Mod.EventHandler
public void preinit(FMLPreInitializationEvent init)
{
    final Logger modLog = init.getModLog();
    IWorldGenerator gen = new IWorldGenerator() {
        @Override
        public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
        {
            modLog.log(Level.INFO, "Calling!");
        }
    };
    GameRegistry.registerWorldGenerator(gen, 10);
}
 
Example 11
Source File: TFCCompat.java    From TofuCraftReload with MIT License 4 votes vote down vote up
public static void preInit() {
    GameRegistry.registerWorldGenerator(new SoyGenerator(), 0);
}
 
Example 12
Source File: WorldGenLoader.java    From Sakura_mod with MIT License 4 votes vote down vote up
public WorldGenLoader() {
	GameRegistry.registerWorldGenerator(new WorldGenBambooShot(), 1);
	GameRegistry.registerWorldGenerator(new WorldGenPepper(), 1);
	GameRegistry.registerWorldGenerator(new WorldGenVanilla(), 1);
	GameRegistry.registerWorldGenerator(new WorldGenIronSand(SakuraConfig.iron_sand_amount), 1);
}
 
Example 13
Source File: SubmodIntradimensionalPortals.java    From CommunityMod with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public void onPreInit(FMLPreInitializationEvent event)
{
	GameRegistry.registerTileEntity(TileEntityPortalBase.class, new ResourceLocation(CommunityGlobals.MOD_ID, "te_intradimensional_portal_base"));
	GameRegistry.registerWorldGenerator(worldgen, 0);
}
 
Example 14
Source File: WorldGenPlacer.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
public static void init() {
	GameRegistry.registerWorldGenerator(new WorldGenPlacer(), 2);
}
 
Example 15
Source File: CommonProxy.java    From TFC2 with GNU General Public License v3.0 4 votes vote down vote up
protected void registerWorldGen()
{
	//GameRegistry.registerWorldGenerator(new WorldGenCliffNoise(), 1);
	//GameRegistry.registerWorldGenerator(new WorldGenCliffRocks(), 1);
	//GameRegistry.registerWorldGenerator(new WorldGenPortals(), 2);
	GameRegistry.registerWorldGenerator(new WorldGenStalag(), 4);

	HexGenRegistry.registerWorldGenerator(new WorldGenCliffRocksHex(), 1);
	HexGenRegistry.registerWorldGenerator(new WorldGenPortalsHex(), 2);
	HexGenRegistry.registerWorldGenerator(new WorldGenClayHex(), 5);
	HexGenRegistry.registerWorldGenerator(new WorldGenLooseRockHex(), 5);
	HexGenRegistry.registerWorldGenerator(new WorldGenTreesHex(), 10);
	HexGenRegistry.registerWorldGenerator(new WorldGenSwampTreesHex(), 10);
	HexGenRegistry.registerWorldGenerator(new WorldGenCatTailsHex(), 100);
	HexGenRegistry.registerWorldGenerator(new WorldGenGrassHex(), 100);
	HexGenRegistry.registerWorldGenerator(new WorldGenGrassDryHex(), 100);
	HexGenRegistry.registerWorldGenerator(new WorldGenPamsGardensHex(), 25);

	Biome.registerBiome(200, "BIOME_BARE", Global.BIOME_BARE);
	Biome.registerBiome(201, "BIOME_BEACH", Global.BIOME_BEACH);
	Biome.registerBiome(202, "BIOME_DECIDUOUS_FOREST", Global.BIOME_DECIDUOUS_FOREST);
	Biome.registerBiome(203, "BIOME_DEEP_OCEAN", Global.BIOME_DEEP_OCEAN);
	Biome.registerBiome(204, "BIOME_DRY_FOREST", Global.BIOME_DRY_FOREST);
	Biome.registerBiome(205, "BIOME_GRASSLAND", Global.BIOME_GRASSLAND);
	Biome.registerBiome(206, "BIOME_LAKE", Global.BIOME_LAKE);
	Biome.registerBiome(207, "BIOME_MARSH", Global.BIOME_MARSH);
	Biome.registerBiome(208, "BIOME_OCEAN", Global.BIOME_OCEAN);
	Biome.registerBiome(209, "BIOME_POLAR_DESERT", Global.BIOME_POLAR_DESERT);
	Biome.registerBiome(210, "BIOME_POND", Global.BIOME_POND);
	Biome.registerBiome(211, "BIOME_RAIN_FOREST", Global.BIOME_RAIN_FOREST);
	Biome.registerBiome(212, "BIOME_RIVER", Global.BIOME_RIVER);
	Biome.registerBiome(213, "BIOME_SCORCHED", Global.BIOME_SCORCHED);
	Biome.registerBiome(214, "BIOME_SHRUBLAND", Global.BIOME_SHRUBLAND);
	Biome.registerBiome(215, "BIOME_SUBTROPICAL_DESERT", Global.BIOME_SUBTROPICAL_DESERT);
	Biome.registerBiome(216, "BIOME_TAIGA", Global.BIOME_TAIGA);
	Biome.registerBiome(217, "BIOME_TEMPERATE_DESERT", Global.BIOME_TEMPERATE_DESERT);
	Biome.registerBiome(218, "BIOME_TROPICAL_DESERT", Global.BIOME_TROPICAL_DESERT);
	Biome.registerBiome(219, "BIOME_TUNDRA", Global.BIOME_TUNDRA);
	Biome.registerBiome(220, "BIOME_SWAMP", Global.BIOME_SWAMP);

	BiomeDictionary.addTypes(Global.BIOME_BARE, Type.SPARSE, Type.DEAD, Type.WASTELAND);
	BiomeDictionary.addTypes(Global.BIOME_BEACH, Type.BEACH);
	BiomeDictionary.addTypes(Global.BIOME_DECIDUOUS_FOREST, Type.FOREST);
	BiomeDictionary.addTypes(Global.BIOME_DEEP_OCEAN, Type.OCEAN);
	BiomeDictionary.addTypes(Global.BIOME_DRY_FOREST, Type.DRY, Type.FOREST);
	BiomeDictionary.addTypes(Global.BIOME_GRASSLAND, Type.PLAINS);
	BiomeDictionary.addTypes(Global.BIOME_LAKE, Type.WATER);
	BiomeDictionary.addTypes(Global.BIOME_MARSH, Type.WET, Type.LUSH, Type.SWAMP);
	BiomeDictionary.addTypes(Global.BIOME_OCEAN, Type.OCEAN);
	BiomeDictionary.addTypes(Global.BIOME_POLAR_DESERT, Type.COLD, Type.SPARSE, Type.DRY, Type.SANDY, Type.SNOWY);
	BiomeDictionary.addTypes(Global.BIOME_POND, Type.WATER);
	BiomeDictionary.addTypes(Global.BIOME_RAIN_FOREST, Type.HOT, Type.DENSE, Type.WET, Type.JUNGLE, Type.LUSH, Type.FOREST);
	BiomeDictionary.addTypes(Global.BIOME_RIVER, Type.RIVER);
	BiomeDictionary.addTypes(Global.BIOME_SCORCHED, Type.HOT, Type.SPARSE, Type.DRY, Type.DEAD, Type.WASTELAND);
	BiomeDictionary.addTypes(Global.BIOME_SHRUBLAND, Type.DRY, Type.PLAINS);
	BiomeDictionary.addTypes(Global.BIOME_SUBTROPICAL_DESERT, Type.HOT, Type.SPARSE, Type.DRY, Type.SANDY);
	BiomeDictionary.addTypes(Global.BIOME_TAIGA, Type.COLD, Type.CONIFEROUS, Type.FOREST, Type.SNOWY);
	BiomeDictionary.addTypes(Global.BIOME_TEMPERATE_DESERT, Type.SPARSE, Type.DRY, Type.SANDY);
	BiomeDictionary.addTypes(Global.BIOME_TROPICAL_DESERT, Type.HOT, Type.SPARSE, Type.DRY, Type.SANDY);
	BiomeDictionary.addTypes(Global.BIOME_TUNDRA, Type.COLD, Type.SPARSE, Type.SNOWY);
	BiomeDictionary.addTypes(Global.BIOME_SWAMP, Type.WET, Type.SPOOKY, Type.LUSH, Type.SWAMP);
}
 
Example 16
Source File: Roguelike.java    From minecraft-roguelike with GNU General Public License v3.0 4 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	GameRegistry.registerWorldGenerator(worldGen, 0);
}