當前位置: 首頁>>代碼示例>>Java>>正文


Java FMLPreInitializationEvent類代碼示例

本文整理匯總了Java中net.minecraftforge.fml.common.event.FMLPreInitializationEvent的典型用法代碼示例。如果您正苦於以下問題:Java FMLPreInitializationEvent類的具體用法?Java FMLPreInitializationEvent怎麽用?Java FMLPreInitializationEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FMLPreInitializationEvent類屬於net.minecraftforge.fml.common.event包,在下文中一共展示了FMLPreInitializationEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    logger = event.getModLog();

    config = new Configuration(event.getSuggestedConfigurationFile());
    doConfig();

    int id = 1; // Don't use 0, more easy debug.
    snw = NetworkRegistry.INSTANCE.newSimpleChannel(MOD_ID);

    snw.registerMessage(Request.Handler.class, Request.class, id++, Side.SERVER);
    snw.registerMessage(Data.Handler.class, Data.class, id++, Side.CLIENT);

    proxy.preInit();
}
 
開發者ID:dries007,項目名稱:DebugServerInfo,代碼行數:17,代碼來源:DebugServerInfo.java

示例2: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event){
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();

    canBeDeactivated = config.getBoolean("canBeDeactivated", Configuration.CATEGORY_GENERAL, true, "If the wopper can be deactivated using redstone");
    wopperSpeed = config.getInt("speed", Configuration.CATEGORY_GENERAL, 10, 1, 1000, "The amount of ticks that have to pass before the wopper does a movement action again");

    if(config.hasChanged()){
        config.save();
    }

    blockWopper = new BlockWopper("wopper");
    GameRegistry.registerTileEntity(TileEntityWopper.class, MOD_ID+":wopper");

    proxy.preInit();
}
 
開發者ID:Ellpeck,項目名稱:Wopper,代碼行數:18,代碼來源:Wopper.java

示例3: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
@Override
	public void preInit(FMLPreInitializationEvent event) {
		super.preInit(event);
/*
		for (final String name : Fluids.getFluidBlockRegistry().keySet()) {
			final Block block = Fluids.getFluidBlockByName(name);
			final Item item = Item.getItemFromBlock(block);
			if (!item.getRegistryName().getResourceDomain().equals(BaseFoods.MODID))
				continue;
			final ModelResourceLocation fluidModelLocation = new ModelResourceLocation(item.getRegistryName().getResourceDomain() + ":" + name, "fluid");
			ModelBakery.registerItemVariants(item);
			ModelLoader.setCustomMeshDefinition(item, stack -> fluidModelLocation);
			ModelLoader.setCustomStateMapper(block, new StateMapperBase() {
				@Override
				protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
					return fluidModelLocation;
				}
			});
		}
*/
	}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:BaseFoods,代碼行數:22,代碼來源:ClientProxy.java

示例4: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
public void preInit(FMLPreInitializationEvent e) {
        MinecraftForge.EVENT_BUS.register(new ForgeEventHandlers());
        McJtyLib.preInit(e);
        CommandHandler.registerCommands();

        GeneralConfig.preInit(e);

        File directory = e.getModConfigurationDirectory();
        mainConfig = new Configuration(new File(directory.getPath(), "needtobreathe.cfg"));
        Config.readConfig(mainConfig);

//        PacketHandler.registerMessages("meecreeps");
        SimpleNetworkWrapper network = PacketHandler.registerMessages(NeedToBreathe.MODID, "needtobreathe");
        NTBMessages.registerNetworkMessages(network);

        // Initialization of blocks and items typically goes here:
//        ModEntities.init();
        ModItems.init();
        ModBlocks.init();
    }
 
開發者ID:McJty,項目名稱:needtobreath,代碼行數:21,代碼來源:CommonProxy.java

示例5: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
public void preInit(FMLPreInitializationEvent event)
{
	// Load configuration from file
	File configDir = event.getModConfigurationDirectory();
	config = new Configuration(new File(configDir.getPath(), "btweagles.cfg"));
	Config.readConfig();

	registerFluids();

	ModEntities.init();

	if (Loader.isModLoaded("thermalexpansion"))
	{
		IntegrationThermal.preInit();
	}
}
 
開發者ID:DarkMorford,項目名稱:BetterThanWeagles,代碼行數:17,代碼來源:CommonProxy.java

示例6: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
@Override
public void preInit(FMLPreInitializationEvent event)
{
	MinecraftForge.EVENT_BUS.register(new ModItemModels());
	MinecraftForge.EVENT_BUS.register(new GuiMana());
	MinecraftForge.EVENT_BUS.register(new GuiHealth());
	MinecraftForge.EVENT_BUS.register(new EventRenderOverlayText());
}
 
開發者ID:TheXFactor117,項目名稱:Loot-Slash-Conquer,代碼行數:9,代碼來源:ClientProxy.java

示例7: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
@Override
public void preInit(FMLPreInitializationEvent event){
	super.preInit(event);
	//ShaderUtil.init();
	//ModelManager.init();
	RegistryManager.registerRendering();
	RenderingRegistry.registerEntityRenderingHandler(EntityGhostHorse.class, RenderGhostHorse::new);

}
 
開發者ID:TeamMelodium,項目名稱:Melodium,代碼行數:10,代碼來源:ClientProxy.java

示例8: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
/**
 * Run before anything else. Read your config, create blocks, items, etc, and
 * register them with the GameRegistry.
 */
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e) {
    logger = e.getModLog();
    creativeTab = new CompatCreativeTabs("lector") {
        @Override
        protected Item getItem() {
            return ModItems.manual;
        }
    };
    this.proxy.preInit(e);
}
 
開發者ID:McJty,項目名稱:Lector,代碼行數:16,代碼來源:Lector.java

示例9: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
	switch (event.getSide()) {
		case CLIENT: {
			//---- initialize mods ----//
			getModManager().loadClasses();
		}
		default:
			break;
	}
}
 
開發者ID:fr1kin,項目名稱:ForgeHax,代碼行數:12,代碼來源:ForgeHax.java

示例10: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
public void preInit(FMLPreInitializationEvent e) {
	ModConfig.init();
	ModBlocks.init();
	ModItems.init();
	ModRecipes.init();
	ModIntegration.preInit();
	ModNetworking.init();
}
 
開發者ID:p455w0rd,項目名稱:DankNull,代碼行數:9,代碼來源:CommonProxy.java

示例11: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
	
	config = new UCConfig();
	config.loadConfig(event);
	
	proxy.preInit(event);
	proxy.initAllModels();
	proxy.checkResource();
	NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:12,代碼來源:UniqueCrops.java

示例12: ItemLoader

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
public ItemLoader(FMLPreInitializationEvent event) {
	register(itemCamera, "camera");
	register(itemTripod, "tripod");
	register(itemBattery, "battery");
	register(itemFilm, "film");
	register(itemPhotoPaper, "photo_paper");
	register(itemPictureBook, "picture_book");
	register(itemCntsTempLiquid, "cnts_temp_liquid");
	register(itemDevelopingAgent, "developing_agent");
	register(itemPicture, "picture");
	register(itemGlassesHelmet, "glasses_helmet");
}
 
開發者ID:PorPit,項目名稱:MineCamera,代碼行數:13,代碼來源:ItemLoader.java

示例13: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
@EventHandler
  public void preInit(FMLPreInitializationEvent event)
  {
  
NetworkRegistry.INSTANCE.registerGuiHandler(Elicitation.instance, new GuiHandler());
Items.setup();
  }
 
開發者ID:Kalman98,項目名稱:Elicitation,代碼行數:8,代碼來源:Elicitation.java

示例14: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
@Override
public void preInit(FMLPreInitializationEvent evt)
{
	super.preInit(evt);
	ExPPlayerCapability.register();
	ExPWorldCapability.register();
	ExPCropCapability.register();
	ExPFarmlandCapability.register();
	ExPSeedsCapability.register();
       ExPAnimalCapability.register();
}
 
開發者ID:V0idWa1k3r,項目名稱:ExPetrum,代碼行數:12,代碼來源:ExPCapabilityRegistry.java

示例15: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入依賴的package包/類
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e) {
    LOG = e.getModLog();

    Map<Object, ModContainer> forgeListenerOwners = getForgeListenerOwners();
    // Remove CreeperHost ads.
    forgeListenerOwners.entrySet().stream()
            .filter(objectModContainerEntry -> objectModContainerEntry.getValue().getModId().equals("creeperhost"))
            .forEach(objectModContainerEntry -> {
                        LOG.info("CreeperKiller Removed {} handler from forge, CreeperHost ads will no longer be displayed", objectModContainerEntry.getKey().toString());
                        MinecraftForge.EVENT_BUS.unregister(objectModContainerEntry.getKey());
                    }
            );
}
 
開發者ID:darkevilmac,項目名稱:CreeperKiller,代碼行數:15,代碼來源:CreeperKiller.java


注:本文中的net.minecraftforge.fml.common.event.FMLPreInitializationEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。