Java Code Examples for net.minecraft.world.DimensionType#register()

The following examples show how to use net.minecraft.world.DimensionType#register() . 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: 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 2
Source File: StorageDimReg.java    From CommunityMod with GNU Lesser General Public License v2.1 4 votes vote down vote up
private static void registerDimensionTypes() {
	storageDimensionType = DimensionType.register(CommunityGlobals.MOD_ID, "_storage", 984637,
			StorageWorldProvider.class, true);
}
 
Example 3
Source File: CommonProxy.java    From Wizardry with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void preInit(FMLPreInitializationEvent event) {
		directory = new File(event.getModConfigurationDirectory(), Wizardry.MODID);
		if (!directory.exists()) if (!directory.mkdirs())
			Wizardry.LOGGER.fatal("    > SOMETHING WENT WRONG! Could not create config folder!!");

		new SpellData.DefaultKeys();

		ManifestUpgrader maniUpgrader = ManifestHandler.INSTANCE.startUpgrade(directory);
		maniUpgrader.changeCategoryName("modules", "wizmodules");
		maniUpgrader.finalizeUpgrade();

		ManifestHandler.INSTANCE.loadNewInternalManifest("wizmodules", "fluid_recipes", "fire_recipes");
		ManifestHandler.INSTANCE.loadExternalManifest(directory);
		ManifestHandler.INSTANCE.processComparisons(directory, "wizmodules", "fluid_recipes", "fire_recipes");

		new ModTab();
		ModBlocks.init();
		ModItems.init();
		ModSounds.init();
		ModPotions.init();
		ModEntities.init();
		ModCapabilities.preInit();

		NetworkRegistry.INSTANCE.registerGuiHandler(Wizardry.instance, new GuiHandler());

		Wizardry.underWorld = DimensionType.register("underworld", "_dim", ConfigValues.underworldID, WorldProviderUnderWorld.class, false);
//		Wizardry.torikki = DimensionType.register("torikki", "_dim", ConfigValues.torikkiID, WorldProviderTorikki.class, false);
		DimensionManager.registerDimension(ConfigValues.underworldID, Wizardry.underWorld);
//		DimensionManager.registerDimension(ConfigValues.torikkiID, Wizardry.torikki);

		MinecraftForge.EVENT_BUS.register(ArenaManager.INSTANCE);
		MinecraftForge.EVENT_BUS.register(new WorldProviderUnderWorld());
		MinecraftForge.EVENT_BUS.register(new EventHandler());
		MinecraftForge.EVENT_BUS.register(new AchievementEvents());
		MinecraftForge.EVENT_BUS.register(new ModuleEffectTimeSlow());
		MinecraftForge.EVENT_BUS.register(new ModuleEffectLeap());
		MinecraftForge.EVENT_BUS.register(ModBiomes.BIOME_UNDERWORLD);
//		MinecraftForge.EVENT_BUS.register(ModBiomes.BIOME_TORIKKI);
//		MinecraftForge.EVENT_BUS.register(ModBiomes.BIOME_TORIKKISEA);
		MinecraftForge.EVENT_BUS.register(this);

		WizardryWorldCapability.init();
		WizardryChunkCapability.init();

		PacketHandler.register(PacketSendSpellToBook.class, Side.SERVER);
		PacketHandler.register(PacketRenderSpell.class, Side.CLIENT);
		PacketHandler.register(PacketExplode.class, Side.CLIENT);
		PacketHandler.register(PacketFreezePlayer.class, Side.CLIENT);
		PacketHandler.register(PacketRenderLightningBolt.class, Side.CLIENT);
		PacketHandler.register(PacketSyncCooldown.class, Side.CLIENT);
		PacketHandler.register(PacketDevilDustFizzle.class, Side.CLIENT);


		PageTypes.INSTANCE.registerPageProvider("wizardry_structure", PageWizardryStructure::new);
		ItemBook.BOOK = new Book("book");

		Wizardry.LOGGER.info("Initializing fairy task plugins...");
		for (final WizardryPlugin plugin : ServiceLoader.load(WizardryPlugin.class)) {
			Wizardry.LOGGER.info("Initializing plugin {}", plugin.getClass().getName());
			plugin.onInit(context);
		}
		Wizardry.LOGGER.info("Initialization complete!");
	}