当前位置: 首页>>代码示例>>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;未经允许,请勿转载。