本文整理汇总了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);
}
示例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");
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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() );
}
示例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;
}
}
示例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());
}
示例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);
}
示例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);
}
}
示例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);
}
示例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;
}
}
示例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);
}