当前位置: 首页>>代码示例>>Java>>正文


Java FMLPreInitializationEvent.getSide方法代码示例

本文整理汇总了Java中net.minecraftforge.fml.common.event.FMLPreInitializationEvent.getSide方法的典型用法代码示例。如果您正苦于以下问题:Java FMLPreInitializationEvent.getSide方法的具体用法?Java FMLPreInitializationEvent.getSide怎么用?Java FMLPreInitializationEvent.getSide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.fml.common.event.FMLPreInitializationEvent的用法示例。


在下文中一共展示了FMLPreInitializationEvent.getSide方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event){
    if (event.getSide() == Side.SERVER) {
        logger.info("Client side only mod - not doing anything on the server!");
        return;
    }
}
 
开发者ID:Cloudhunter,项目名称:LetsEncryptRoot,代码行数:8,代码来源:LetsEncryptRoot.java

示例2: register

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public static void register(FMLPreInitializationEvent e, List<?> list) {
	Iterator<?> iterator = list.iterator();
	while (iterator.hasNext()) {
		Object k = iterator.next();
		if (k instanceof Block) {
			Block block = (Block) k;
			ForgeRegistries.BLOCKS.register(block);
			BlockRegistry.registry.put(block.getRegistryName().getResourcePath(), block);
			if (!(k instanceof BlockSpecialFire) && !(k instanceof BlockWoodDoor)) {
				((Block) k).setCreativeTab(GotWood.TREE_TAB);
			}
			block.setUnlocalizedName(GotWood.ID + "." + block.getRegistryName().getResourcePath());
			if (!(k instanceof BlockDoubleSlab) && !ForgeRegistries.ITEMS.containsKey(block.getRegistryName())) {
				ForgeRegistries.ITEMS.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
			}
		} else if (k instanceof Item) {
			Item item = (Item) k;
			ForgeRegistries.ITEMS.register((Item) k);
			ItemRegistry.registry.put(item.getRegistryName().getResourcePath(), item);
			((Item) k).setCreativeTab(GotWood.TREE_TAB);
			((Item) k).setUnlocalizedName(GotWood.ID + "." + ((Item) k).getRegistryName().getResourcePath());
		}
	}
	if (e.getSide() == Side.CLIENT) {
		registerModels(list);
	}
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:Got-Wood,代码行数:28,代码来源:MasterRegistrar.java

示例3: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	// initialize the configuration
	ModConfiguration.initializeConfiguration();

	// register the key bindings
	if (event.getSide() == Side.CLIENT) ModKeyBindings.registerKeyBindings();

	// register the network messages
	NETWORK.registerMessage(VillagerCareerMessage.MessageHandler.class, VillagerCareerMessage.class, 0, Side.CLIENT);
	NETWORK.registerMessage(ConfigSyncMessage.MessageHandler.class, ConfigSyncMessage.class, 1, Side.CLIENT);
	NETWORK.registerMessage(ConfigSyncMessage.MessageHandler.class, ConfigSyncMessage.class, 2, Side.SERVER);
	NETWORK.registerMessage(EntityFlagMessage.MessageHandler.class, EntityFlagMessage.class, 3, Side.SERVER);
}
 
开发者ID:crazysnailboy,项目名称:VillagerInventory,代码行数:16,代码来源:VillagerInventoryMod.java

示例4: 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


注:本文中的net.minecraftforge.fml.common.event.FMLPreInitializationEvent.getSide方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。