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


Java NetworkRegistry类代码示例

本文整理汇总了Java中cpw.mods.fml.common.network.NetworkRegistry的典型用法代码示例。如果您正苦于以下问题:Java NetworkRegistry类的具体用法?Java NetworkRegistry怎么用?Java NetworkRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NetworkRegistry类属于cpw.mods.fml.common.network包,在下文中一共展示了NetworkRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent evt) {
	INSTANCE.registerMessage(LobbyPlayerOpenedGuiPacketHandler.class, LobbyPlayerOpenedGuiPacket.class, 0,
			Side.SERVER);

	INSTANCE.registerMessage(LobbyBeginGamePacketHandler.class, LobbyBeginGamePacket.class, 1, Side.SERVER);
	INSTANCE.registerMessage(PacketSyncPlayerPropertiesClientHandler.class, PacketSyncPlayerPropertiesClient.class,
			2, Side.CLIENT);
	INSTANCE.registerMessage(PacketSyncPlayerPropertiesServerHandler.class, PacketSyncPlayerPropertiesServer.class,
			3, Side.SERVER);

	INSTANCE.registerMessage(PacketSyncTileEntityServerHandler.class, PacketSyncTileEntityServer.class, 4,
			Side.SERVER);
	INSTANCE.registerMessage(PacketSyncTileEntityClientHandler.class, PacketSyncTileEntityClient.class, 5,
			Side.CLIENT);

	NetworkRegistry.INSTANCE.registerGuiHandler(PAYDAY.instance, new MGuiHandler());
	GameRegistry.registerBlock(lobbyBlock, "Lobby");
	GameRegistry.registerTileEntity(LobbyTileEntity.class, "lobby_tile_entity");

	FMLCommonHandler.instance().bus().register(eventHandler);
	MinecraftForge.EVENT_BUS.register(eventHandler);
}
 
开发者ID:TominoCZ,项目名称:PAYDAY,代码行数:24,代码来源:PAYDAY.java

示例2: init

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event) {
	NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);

	ModRecipes.init();

	proxy.registerEvents();
	proxy.registerEntities();
	proxy.registerRenderers();

	if (ModEntityList.hasEntitiesWithEggs()) {
		ModEntityList.entity_egg = new ItemEntityEgg();
		GameRegistry.registerItem(ModEntityList.entity_egg, "entity_egg");
		OreDictionary.registerOre("mobEgg", ModEntityList.entity_egg);
	}

	isTinkersConstructLoaded = Loader.isModLoaded("TConstruct");
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:19,代码来源:EtFuturum.java

示例3: init

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
public void init(final FMLInitializationEvent event) {
    NetworkRegistry.INSTANCE.registerGuiHandler((Object)ExtraUtilsMod.instance, (IGuiHandler)new GuiHandler());
    if (Loader.isModLoaded("ForgeMultipart")) {
        this.FMPRegisterPassThroughInterfaces();
    }
    ExtraUtilsMod.proxy.registerEventHandler();
    ExtraUtilsMod.proxy.registerRenderInformation();
    if (Loader.isModLoaded("ThermalExpansion")) {
        TE4IMC.addIntegration();
    }
    if (Loader.isModLoaded("MineFactoryReloaded")) {
        MFRIntegration.registerMFRIntegration();
    }
    for (final ILoading loader : this.loaders) {
        loader.init();
    }
    EE3Integration.finalRegister();
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:19,代码来源:ExtraUtils.java

示例4: init

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event)
{
	proxy.init(event);
	// register CommonProxy as our GuiHandler
	NetworkRegistry.INSTANCE.registerGuiHandler(MODID, new CommonProxy());
	
	ItemLoader.LoadItems();
	BlockLoader.loadBlocks();
	Recipes.registerRecpies();
	EntityLoader.LoadEntitys();
	OreDict.addores();
	//Achievements.loadAchievements();
	//Stats.RegisterStats();

	GameRegistry.registerWorldGenerator(new ModWorldGen(), 0);
	
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:19,代码来源:epicproportionsmod_halloween.java

示例5: preInit

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	ConfigurationHandler.INSTANCE.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator + Reference.MOD_ID + ".cfg"));

	GameRegistry.registerWorldGenerator(new EtFuturumWorldGenerator(), 0);
	GameRegistry.registerWorldGenerator(new EtFuturumNetherGenerator(), 1);

	ModBlocks.init();
	ModItems.init();
	ModEnchantments.init();

	OceanMonument.makeMap();

	NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
	networkWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.MOD_ID);
	networkWrapper.registerMessage(ArmourStandInteractHandler.class, ArmourStandInteractMessage.class, 0, Side.SERVER);
	networkWrapper.registerMessage(BlackHeartParticlesHandler.class, BlackHeartParticlesMessage.class, 1, Side.CLIENT);
	networkWrapper.registerMessage(SetPlayerModelHandler.class, SetPlayerModelMessage.class, 2, Side.CLIENT);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:20,代码来源:EtFuturum.java

示例6: init

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
	proxy.registerNetworkStuff();
	NetworkRegistry.INSTANCE.registerGuiHandler(this, new TechnicalGuiHandler());
	TechnicalItem.removeVanillaRecipes();
	Recipes.init();
	FMLCommonHandler.instance().bus().register(new EventListener());
	radioactivityPotion = (new PotionTechnical(radioactivityPotionId, true, 0)).setIconIndex(0, 0).setPotionName("potion.radioactivityPotion");
	TechnicalAchievement.init();
	AchievementPage.registerAchievementPage(technicalAchievementPage);
}
 
开发者ID:viddeno,项目名称:Technical,代码行数:12,代码来源:Technical.java

示例7: init

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event) {
	long time = System.nanoTime();
	ContentRegistry.init();
	FMLCommonHandler.instance().bus().register(this);
	NetworkRegistry.INSTANCE.registerGuiHandler(OpenSensors.instance, new GUIHandler());
	logger.info("Finished init in %d ms", (System.nanoTime() - time) / 1000000);
}
 
开发者ID:PC-Logix,项目名称:OpenSensors,代码行数:9,代码来源:OpenSensors.java

示例8: init

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
@EventHandler
public void init( FMLInitializationEvent event )
{
	FMLCommonHandler.instance().bus().register( AdminLogonErrors );
	FMLCommonHandler.instance().bus().register( LootGroupHandler );
	MinecraftForge.EVENT_BUS.register( LootGroupHandler );
	NetworkRegistry.INSTANCE.registerGuiHandler( this, new GuiHandler() );
}
 
开发者ID:GTNewHorizons,项目名称:EnhancedLootBags,代码行数:9,代码来源:EnhancedLootBags.java

示例9: channelRead0

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
@Override
protected void channelRead0(ChannelHandlerContext ctx, IPacket msg) throws Exception
{
    INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get();
    EntityPlayer player = GalacticraftCore.proxy.getPlayerFromNetHandler(netHandler);

    switch (FMLCommonHandler.instance().getEffectiveSide())
    {
    case CLIENT:
        msg.handleClientSide(player);
        break;
    case SERVER:
        msg.handleServerSide(player);
        break;
    default:
        break;
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:GalacticraftPacketHandler.java

示例10: onInit

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
@Mod.EventHandler
public void onInit(FMLInitializationEvent e){
    /*
    REGISTERS ALL COMMON THINGS SO FOR BOTH SERVER AND CLIENT...
     */
    LOTRAddonsItems.registerRings();
    LOTRAddonsBlocks.registerBlocks();
    LOTRAddonsEntities.registerEntities();
    NetworkRegistry.INSTANCE.registerGuiHandler(LOTRAddons.lotrAddons, new GuiHandler());


}
 
开发者ID:TimVerhaegen,项目名称:LotrAddonsRings,代码行数:13,代码来源:ProxyCommon.java

示例11: initialize

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
public static void initialize()
{
   	network = NetworkRegistry.INSTANCE.newSimpleChannel("MagicCrusade");
   	
   	network.registerMessage(PacketLogIn.Handler.class, PacketLogIn.class, 0, Side.CLIENT);
   	network.registerMessage(PacketDisplayGui.Handler.class, PacketDisplayGui.class, 1, Side.CLIENT);
   	network.registerMessage(PacketParticleEffectToClient.Handler.class, PacketParticleEffectToClient.class, 2, Side.CLIENT);
   	network.registerMessage(PacketParticleEffectToServer.Handler.class, PacketParticleEffectToServer.class, 3, Side.SERVER);
   	network.registerMessage(PacketSpellToServer.Handler.class, PacketSpellToServer.class, 4, Side.SERVER);
   	network.registerMessage(PacketSetClasse.Handler.class, PacketSetClasse.class, 5, Side.SERVER);
   	network.registerMessage(PacketExpToClient.Handler.class, PacketExpToClient.class, 6, Side.CLIENT);
   	network.registerMessage(PacketTeamToClient.Handler.class, PacketTeamToClient.class, 7, Side.CLIENT);
   	network.registerMessage(PacketTeamToServer.Handler.class, PacketTeamToServer.class, 8, Side.SERVER);
   	network.registerMessage(PacketLevel.Handler.class, PacketLevel.class, 9, Side.CLIENT);
   	network.registerMessage(PacketGameStart.Handler.class, PacketGameStart.class, 10, Side.CLIENT);
   	network.registerMessage(PacketGameStop.Handler.class, PacketGameStop.class, 11, Side.CLIENT);
   	network.registerMessage(PacketTogglePvp.Handler.class, PacketTogglePvp.class, 12, Side.CLIENT);
   	network.registerMessage(PacketBorders.Handler.class, PacketBorders.class, 13, Side.CLIENT);
   	network.registerMessage(PacketSetRace.Handler.class, PacketSetRace.class, 14, Side.SERVER);
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:21,代码来源:Packets.java

示例12: checkModList

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
public static String checkModList(Map<String,String> listData, Side side)
{
    List<ModContainer> rejects = Lists.newArrayList();
    for (Entry<ModContainer, NetworkModHolder> networkMod : NetworkRegistry.INSTANCE.registry().entrySet())
    {
        boolean result = networkMod.getValue().check(listData, side);
        if (!result)
        {
            rejects.add(networkMod.getKey());
        }
    }
    if (rejects.isEmpty())
    {
        return null;
    }
    else
    {
        FMLLog.info("Rejecting connection %s: %s", side, rejects);
        return String.format("Mod rejections %s",rejects);
    }
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:22,代码来源:FMLNetworkHandler.java

示例13: init

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
public void init(FMLInitializationEvent e) {
    wrapper = NetworkRegistry.INSTANCE.newSimpleChannel("OpenTeleporter");
    GameRegistry.registerBlock(new BlockTeleporter(), "Teleporter");
    GameRegistry.registerTileEntity(TileEntityTeleporter.class, "TileEntityTeleporter");

    wrapper.registerMessage(PacketPlayerPosition.Handler.class, PacketPlayerPosition.class, 0, Side.CLIENT);
    wrapper.registerMessage(PacketTeleporter.Handler.class, PacketTeleporter.class, 1, Side.CLIENT);
}
 
开发者ID:java8compiler,项目名称:OpenTeleporter,代码行数:9,代码来源:CommonProxy.java

示例14: channelRead0

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
@Override
protected void channelRead0(ChannelHandlerContext ctx, IPacket msg) throws Exception {
	INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get();
	EntityPlayer player = VivecraftForge.proxy.getPlayerFromNetHandler(netHandler);

	switch (FMLCommonHandler.instance().getEffectiveSide()) {
		case CLIENT:
			msg.handleClient(player);
			break;
		case SERVER:
			msg.handleServer(player);
			break;
		default:
			VivecraftForgeLog.severe("Impossible scenario encountered! Effective side is neither server nor client!");
			break;
	}
}
 
开发者ID:Techjar,项目名称:VivecraftForgeExtensions,代码行数:18,代码来源:VivecraftForgePacketHandler.java

示例15: preInit

import cpw.mods.fml.common.network.NetworkRegistry; //导入依赖的package包/类
public void preInit()
{
	GameRegistry.registerBlock(BlockCompressedChest.instance, ItemBlockAvaritiaddonsChest.class, "CompressedChest");
	GameRegistry.registerBlock(BlockInfinityChest.instance, ItemBlockAvaritiaddonsChest.class, "InfinityChest");
	GameRegistry.registerBlock(BlockExtremeAutoCrafter.instance, "ExtremeAutoCrafter");
	GameRegistry.registerTileEntity(TileEntityCompressedChest.class, "Avaritiaddons:CompressedChest");
	GameRegistry.registerTileEntity(TileEntityInfinityChest.class, "Avaritiaddons:InfinityChest");
	GameRegistry.registerTileEntity(TileEntityExtremeAutoCrafter.class, "Avaritiaddons:ExtremeAutoCrafter");
	NetworkRegistry.INSTANCE.registerGuiHandler(Avaritiaddons.instance, GuiHandler.instance);
	networkWrapper.registerMessage(InfinityChestSlotSync.Handler.class, InfinityChestSlotSync.class, 0, Side.SERVER);
	networkWrapper.registerMessage(InfinityChestSlotSync.Handler.class, InfinityChestSlotSync.class, 1, Side.CLIENT);
	networkWrapper.registerMessage(InfinityChestClick.Handler.class, InfinityChestClick.class, 2, Side.SERVER);
	networkWrapper.registerMessage(InfinityChestClick.Handler.class, InfinityChestClick.class, 3, Side.CLIENT);
	networkWrapper.registerMessage(InfinityChestConfirmation.Handler.class, InfinityChestConfirmation.class, 4, Side.SERVER);
	networkWrapper.registerMessage(InfinityChestConfirmation.Handler.class, InfinityChestConfirmation.class, 5, Side.CLIENT);
	networkWrapper.registerMessage(InfinityChestSyncAllSlots.Handler.class, InfinityChestSyncAllSlots.class, 6, Side.SERVER);
	networkWrapper.registerMessage(InfinityChestSyncAllSlots.Handler.class, InfinityChestSyncAllSlots.class, 7, Side.CLIENT);
}
 
开发者ID:WanionCane,项目名称:Avaritiaddons,代码行数:19,代码来源:CommonProxy.java


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