當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。