Java 类net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper 实例源码

项目:needtobreath    文件:CommonProxy.java   
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();
    }
项目:MeeCreeps    文件:CommonProxy.java   
public void preInit(FMLPreInitializationEvent e) {
    MinecraftForge.EVENT_BUS.register(new ForgeEventHandlers());
    McJtyLib.preInit(e);
    CommandHandler.registerCommands();

    MeeCreeps.api.registerFactories();

    File directory = e.getModConfigurationDirectory();
    config = new Configuration(new File(directory.getPath(), "meecreeps.cfg"));
    Config.readConfig();

    SimpleNetworkWrapper network = mcjty.lib.network.PacketHandler.registerMessages(MeeCreeps.MODID, "meecreeps");
    MeeCreepsMessages.registerMessages(network);

    // Initialization of blocks and items typically goes here:
    ModEntities.init();
}
项目:AllPI    文件:PacketHelper.java   
public static <REQ extends IMessage, REPLY extends IMessage> void registerPacket(SimpleNetworkWrapper network, Class<REQ> requestMessageType, Class<? extends IMessageHandler<REQ, REPLY>> messageHandler, Side side) {
    String packetPackageName = requestMessageType.getPackage().getName();
    Iterator<String> iterator = packetByteDiscriminators.keySet().iterator();

    byte discriminator = -1;
    while(iterator.hasNext()) {
        String pack = iterator.next();

        if(pack.contains(packetPackageName)) {
            packetByteDiscriminators.get(packetPackageName);
        }
    }

    if(discriminator == -1) {
        packetByteDiscriminators.put(packetPackageName, (byte) 0);
    }

    network.registerMessage(messageHandler, requestMessageType, packetByteDiscriminators.get(packetPackageName), side);
}
项目:SecurityCraft    文件:RegistrationHandler.java   
public static void registerPackets(SimpleNetworkWrapper network)
{
    network.registerMessage(PacketSetBlock.Handler.class, PacketSetBlock.class, 1, Side.SERVER);
    network.registerMessage(PacketSetISType.Handler.class, PacketSetISType.class, 2, Side.SERVER);
    network.registerMessage(PacketSetKeycardLevel.Handler.class, PacketSetKeycardLevel.class, 3, Side.SERVER);
    network.registerMessage(PacketUpdateLogger.Handler.class, PacketUpdateLogger.class, 4, Side.CLIENT);
    network.registerMessage(PacketCUpdateNBTTag.Handler.class, PacketCUpdateNBTTag.class, 5, Side.CLIENT);
    network.registerMessage(PacketSUpdateNBTTag.Handler.class, PacketSUpdateNBTTag.class, 6, Side.SERVER);
    network.registerMessage(PacketCPlaySoundAtPos.Handler.class, PacketCPlaySoundAtPos.class, 7, Side.CLIENT);
    network.registerMessage(PacketSetExplosiveState.Handler.class, PacketSetExplosiveState.class, 8, Side.SERVER);
    network.registerMessage(PacketGivePotionEffect.Handler.class, PacketGivePotionEffect.class, 9, Side.SERVER);
    network.registerMessage(PacketSSetOwner.Handler.class, PacketSSetOwner.class, 10, Side.SERVER);
    network.registerMessage(PacketSAddModules.Handler.class, PacketSAddModules.class, 11, Side.SERVER);
    network.registerMessage(PacketSSetPassword.Handler.class, PacketSSetPassword.class, 12, Side.SERVER);
    network.registerMessage(PacketSCheckPassword.Handler.class, PacketSCheckPassword.class, 13, Side.SERVER);
    network.registerMessage(PacketSSyncTENBTTag.Handler.class, PacketSSyncTENBTTag.class, 14, Side.SERVER);
    network.registerMessage(PacketSMountCamera.Handler.class, PacketSMountCamera.class, 15, Side.SERVER);
    network.registerMessage(PacketSSetCameraRotation.Handler.class, PacketSSetCameraRotation.class, 16, Side.SERVER);
    network.registerMessage(PacketCSetPlayerPositionAndRotation.Handler.class, PacketCSetPlayerPositionAndRotation.class, 17, Side.CLIENT);
    network.registerMessage(PacketSOpenGui.Handler.class, PacketSOpenGui.class, 18, Side.SERVER);
    network.registerMessage(PacketSToggleOption.Handler.class, PacketSToggleOption.class, 19, Side.SERVER);
    network.registerMessage(PacketCRequestTEOwnableUpdate.Handler.class, PacketCRequestTEOwnableUpdate.class, 20, Side.SERVER);
    network.registerMessage(PacketSUpdateTEOwnable.Handler.class, PacketSUpdateTEOwnable.class, 21, Side.CLIENT);
    network.registerMessage(PacketSUpdateSliderValue.Handler.class, PacketSUpdateSliderValue.class, 22, Side.SERVER);
    network.registerMessage(PacketSRemoveCameraTag.Handler.class, PacketSRemoveCameraTag.class, 23, Side.SERVER);
}
项目:SecurityCraft    文件:RegistrationHandler.java   
public static void registerPackets(SimpleNetworkWrapper network)
{
    network.registerMessage(PacketSetBlock.Handler.class, PacketSetBlock.class, 1, Side.SERVER);
    network.registerMessage(PacketSetISType.Handler.class, PacketSetISType.class, 2, Side.SERVER);
    network.registerMessage(PacketSetKeycardLevel.Handler.class, PacketSetKeycardLevel.class, 3, Side.SERVER);
    network.registerMessage(PacketUpdateLogger.Handler.class, PacketUpdateLogger.class, 4, Side.CLIENT);
    network.registerMessage(PacketCUpdateNBTTag.Handler.class, PacketCUpdateNBTTag.class, 5, Side.CLIENT);
    network.registerMessage(PacketSUpdateNBTTag.Handler.class, PacketSUpdateNBTTag.class, 6, Side.SERVER);
    network.registerMessage(PacketCPlaySoundAtPos.Handler.class, PacketCPlaySoundAtPos.class, 7, Side.CLIENT);
    network.registerMessage(PacketSetExplosiveState.Handler.class, PacketSetExplosiveState.class, 8, Side.SERVER);
    network.registerMessage(PacketGivePotionEffect.Handler.class, PacketGivePotionEffect.class, 9, Side.SERVER);
    network.registerMessage(PacketSSetOwner.Handler.class, PacketSSetOwner.class, 10, Side.SERVER);
    network.registerMessage(PacketSAddModules.Handler.class, PacketSAddModules.class, 11, Side.SERVER);
    network.registerMessage(PacketSSetPassword.Handler.class, PacketSSetPassword.class, 12, Side.SERVER);
    network.registerMessage(PacketSCheckPassword.Handler.class, PacketSCheckPassword.class, 13, Side.SERVER);
    network.registerMessage(PacketSSyncTENBTTag.Handler.class, PacketSSyncTENBTTag.class, 14, Side.SERVER);
    network.registerMessage(PacketSMountCamera.Handler.class, PacketSMountCamera.class, 15, Side.SERVER);
    network.registerMessage(PacketSSetCameraRotation.Handler.class, PacketSSetCameraRotation.class, 16, Side.SERVER);
    network.registerMessage(PacketCSetPlayerPositionAndRotation.Handler.class, PacketCSetPlayerPositionAndRotation.class, 17, Side.CLIENT);
    network.registerMessage(PacketSOpenGui.Handler.class, PacketSOpenGui.class, 18, Side.SERVER);
    network.registerMessage(PacketSToggleOption.Handler.class, PacketSToggleOption.class, 19, Side.SERVER);
    network.registerMessage(PacketCRequestTEOwnableUpdate.Handler.class, PacketCRequestTEOwnableUpdate.class, 20, Side.SERVER);
    network.registerMessage(PacketSUpdateTEOwnable.Handler.class, PacketSUpdateTEOwnable.class, 21, Side.CLIENT);
    network.registerMessage(PacketSUpdateSliderValue.Handler.class, PacketSUpdateSliderValue.class, 22, Side.SERVER);
    network.registerMessage(PacketSRemoveCameraTag.Handler.class, PacketSRemoveCameraTag.class, 23, Side.SERVER);
}
项目:SecurityCraft    文件:RegistrationHandler.java   
public static void registerPackets(SimpleNetworkWrapper network)
{
    network.registerMessage(PacketSetBlock.Handler.class, PacketSetBlock.class, 1, Side.SERVER);
    network.registerMessage(PacketSetISType.Handler.class, PacketSetISType.class, 2, Side.SERVER);
    network.registerMessage(PacketSetKeycardLevel.Handler.class, PacketSetKeycardLevel.class, 3, Side.SERVER);
    network.registerMessage(PacketUpdateLogger.Handler.class, PacketUpdateLogger.class, 4, Side.CLIENT);
    network.registerMessage(PacketCUpdateNBTTag.Handler.class, PacketCUpdateNBTTag.class, 5, Side.CLIENT);
    network.registerMessage(PacketSUpdateNBTTag.Handler.class, PacketSUpdateNBTTag.class, 6, Side.SERVER);
    network.registerMessage(PacketCPlaySoundAtPos.Handler.class, PacketCPlaySoundAtPos.class, 7, Side.CLIENT);
    network.registerMessage(PacketSetExplosiveState.Handler.class, PacketSetExplosiveState.class, 8, Side.SERVER);
    network.registerMessage(PacketGivePotionEffect.Handler.class, PacketGivePotionEffect.class, 9, Side.SERVER);
    network.registerMessage(PacketSSetOwner.Handler.class, PacketSSetOwner.class, 10, Side.SERVER);
    network.registerMessage(PacketSAddModules.Handler.class, PacketSAddModules.class, 11, Side.SERVER);
    network.registerMessage(PacketSSetPassword.Handler.class, PacketSSetPassword.class, 12, Side.SERVER);
    network.registerMessage(PacketSCheckPassword.Handler.class, PacketSCheckPassword.class, 13, Side.SERVER);
    network.registerMessage(PacketSSyncTENBTTag.Handler.class, PacketSSyncTENBTTag.class, 14, Side.SERVER);
    network.registerMessage(PacketSMountCamera.Handler.class, PacketSMountCamera.class, 15, Side.SERVER);
    network.registerMessage(PacketSSetCameraRotation.Handler.class, PacketSSetCameraRotation.class, 16, Side.SERVER);
    network.registerMessage(PacketCSetPlayerPositionAndRotation.Handler.class, PacketCSetPlayerPositionAndRotation.class, 17, Side.CLIENT);
    network.registerMessage(PacketSOpenGui.Handler.class, PacketSOpenGui.class, 18, Side.SERVER);
    network.registerMessage(PacketSToggleOption.Handler.class, PacketSToggleOption.class, 19, Side.SERVER);
    network.registerMessage(PacketSUpdateSliderValue.Handler.class, PacketSUpdateSliderValue.class, 20, Side.SERVER);
    network.registerMessage(PacketSRemoveCameraTag.Handler.class, PacketSRemoveCameraTag.class, 21, Side.SERVER);
}
项目:SecurityCraft    文件:RegistrationHandler.java   
public static void registerPackets(SimpleNetworkWrapper network)
{
    network.registerMessage(PacketSetBlock.Handler.class, PacketSetBlock.class, 1, Side.SERVER);
    network.registerMessage(PacketSetISType.Handler.class, PacketSetISType.class, 2, Side.SERVER);
    network.registerMessage(PacketSetKeycardLevel.Handler.class, PacketSetKeycardLevel.class, 3, Side.SERVER);
    network.registerMessage(PacketUpdateLogger.Handler.class, PacketUpdateLogger.class, 4, Side.CLIENT);
    network.registerMessage(PacketCUpdateNBTTag.Handler.class, PacketCUpdateNBTTag.class, 5, Side.CLIENT);
    network.registerMessage(PacketSUpdateNBTTag.Handler.class, PacketSUpdateNBTTag.class, 6, Side.SERVER);
    network.registerMessage(PacketCPlaySoundAtPos.Handler.class, PacketCPlaySoundAtPos.class, 7, Side.CLIENT);
    network.registerMessage(PacketSetExplosiveState.Handler.class, PacketSetExplosiveState.class, 8, Side.SERVER);
    network.registerMessage(PacketGivePotionEffect.Handler.class, PacketGivePotionEffect.class, 9, Side.SERVER);
    network.registerMessage(PacketSSetOwner.Handler.class, PacketSSetOwner.class, 10, Side.SERVER);
    network.registerMessage(PacketSAddModules.Handler.class, PacketSAddModules.class, 11, Side.SERVER);
    network.registerMessage(PacketSSetPassword.Handler.class, PacketSSetPassword.class, 12, Side.SERVER);
    network.registerMessage(PacketSCheckPassword.Handler.class, PacketSCheckPassword.class, 13, Side.SERVER);
    network.registerMessage(PacketSSyncTENBTTag.Handler.class, PacketSSyncTENBTTag.class, 14, Side.SERVER);
    network.registerMessage(PacketSMountCamera.Handler.class, PacketSMountCamera.class, 15, Side.SERVER);
    network.registerMessage(PacketSSetCameraRotation.Handler.class, PacketSSetCameraRotation.class, 16, Side.SERVER);
    network.registerMessage(PacketCSetPlayerPositionAndRotation.Handler.class, PacketCSetPlayerPositionAndRotation.class, 17, Side.CLIENT);
    network.registerMessage(PacketSOpenGui.Handler.class, PacketSOpenGui.class, 18, Side.SERVER);
    network.registerMessage(PacketSToggleOption.Handler.class, PacketSToggleOption.class, 19, Side.SERVER);
    network.registerMessage(PacketSUpdateSliderValue.Handler.class, PacketSUpdateSliderValue.class, 20, Side.SERVER);
    network.registerMessage(PacketSRemoveCameraTag.Handler.class, PacketSRemoveCameraTag.class, 21, Side.SERVER);
}
项目:SecurityCraft    文件:RegistrationHandler.java   
public static void registerPackets(SimpleNetworkWrapper network)
{
    network.registerMessage(PacketSetBlock.Handler.class, PacketSetBlock.class, 1, Side.SERVER);
    network.registerMessage(PacketSetISType.Handler.class, PacketSetISType.class, 2, Side.SERVER);
    network.registerMessage(PacketSetKeycardLevel.Handler.class, PacketSetKeycardLevel.class, 3, Side.SERVER);
    network.registerMessage(PacketUpdateLogger.Handler.class, PacketUpdateLogger.class, 4, Side.CLIENT);
    network.registerMessage(PacketCUpdateNBTTag.Handler.class, PacketCUpdateNBTTag.class, 5, Side.CLIENT);
    network.registerMessage(PacketSUpdateNBTTag.Handler.class, PacketSUpdateNBTTag.class, 6, Side.SERVER);
    network.registerMessage(PacketCPlaySoundAtPos.Handler.class, PacketCPlaySoundAtPos.class, 7, Side.CLIENT);
    network.registerMessage(PacketSetExplosiveState.Handler.class, PacketSetExplosiveState.class, 8, Side.SERVER);
    network.registerMessage(PacketGivePotionEffect.Handler.class, PacketGivePotionEffect.class, 9, Side.SERVER);
    network.registerMessage(PacketSSetOwner.Handler.class, PacketSSetOwner.class, 10, Side.SERVER);
    network.registerMessage(PacketSAddModules.Handler.class, PacketSAddModules.class, 11, Side.SERVER);
    network.registerMessage(PacketSSetPassword.Handler.class, PacketSSetPassword.class, 12, Side.SERVER);
    network.registerMessage(PacketSCheckPassword.Handler.class, PacketSCheckPassword.class, 13, Side.SERVER);
    network.registerMessage(PacketSSyncTENBTTag.Handler.class, PacketSSyncTENBTTag.class, 14, Side.SERVER);
    network.registerMessage(PacketSMountCamera.Handler.class, PacketSMountCamera.class, 15, Side.SERVER);
    network.registerMessage(PacketSSetCameraRotation.Handler.class, PacketSSetCameraRotation.class, 16, Side.SERVER);
    network.registerMessage(PacketCSetPlayerPositionAndRotation.Handler.class, PacketCSetPlayerPositionAndRotation.class, 17, Side.CLIENT);
    network.registerMessage(PacketSOpenGui.Handler.class, PacketSOpenGui.class, 18, Side.SERVER);
    network.registerMessage(PacketSToggleOption.Handler.class, PacketSToggleOption.class, 19, Side.SERVER);
    network.registerMessage(PacketCRequestTEOwnableUpdate.Handler.class, PacketCRequestTEOwnableUpdate.class, 20, Side.SERVER);
    network.registerMessage(PacketSUpdateTEOwnable.Handler.class, PacketSUpdateTEOwnable.class, 21, Side.CLIENT);
    network.registerMessage(PacketSUpdateSliderValue.Handler.class, PacketSUpdateSliderValue.class, 22, Side.SERVER);
    network.registerMessage(PacketSRemoveCameraTag.Handler.class, PacketSRemoveCameraTag.class, 23, Side.SERVER);
}
项目:McMod-CubicVillager    文件:MyPlayerEvent.java   
@SubscribeEvent
public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event)
{
    if(event.player instanceof EntityPlayerMP)
    {
        ServerConfigMessage msg = new ServerConfigMessage();
        msg.recipeVillagerSlabsIsRecovery = CommonProxy.recipeVillagerSlabsIsRecovery;
        SimpleNetworkWrapper netwrapper = CubicVillager.getProxy().simpleNetWrapper;
        netwrapper.sendTo(msg, (EntityPlayerMP)event.player);

        StringBuilder spawnedMessage = new StringBuilder(64);
        spawnedMessage.append("プレイヤー ")
            .append(((EntityPlayerMP)event.player).getName())
            .append(" がワールドに参加しました。設定を送信しました。");
        CubicVillager.LOG.info(spawnedMessage);
    }
}
项目:needtobreath    文件:NTBMessages.java   
public static void registerNetworkMessages(SimpleNetworkWrapper net) {
    INSTANCE = net;

    // Server side

    // Client side
    net.registerMessage(PacketSendCleanAirToClient.Handler.class, PacketSendCleanAirToClient.class, PacketHandler.nextID(), Side.CLIENT);
    net.registerMessage(PacketIntegersFromServer.Handler.class, PacketIntegersFromServer.class, PacketHandler.nextID(), Side.CLIENT);
    net.registerMessage(PacketPoisonFromServer.Handler.class, PacketPoisonFromServer.class, PacketHandler.nextID(), Side.CLIENT);
}
项目:Possessed    文件:Possessed.java   
@Mod.EventHandler
public void onPreInit(FMLPreInitializationEvent event) {
    Possessed.proxy.onPreInit();

    Possessed.networkWrapper = new SimpleNetworkWrapper(Possessed.MODID);

    Possessed.networkWrapper.registerMessage(PossessMessage.Handler.class, PossessMessage.class, 0, Side.CLIENT);
    Possessed.networkWrapper.registerMessage(UpdatePossessedDataMessage.Handler.class, UpdatePossessedDataMessage.class, 1, Side.CLIENT);
    Possessed.networkWrapper.registerMessage(PossessClickEmptyMessage.Handler.class, PossessClickEmptyMessage.class, 2, Side.SERVER);
    Possessed.networkWrapper.registerMessage(PossessHurtMessage.Handler.class, PossessHurtMessage.class, 3, Side.CLIENT);
    Possessed.networkWrapper.registerMessage(SyncDataMessage.Handler.class, SyncDataMessage.class, 4, Side.CLIENT);
    Possessed.networkWrapper.registerMessage(StopPossessingMessage.Handler.class, StopPossessingMessage.class, 5, Side.SERVER);
}
项目:ARKCraft    文件:CommonProxy.java   
private final void setupNetwork(FMLPreInitializationEvent event)
{
    SimpleNetworkWrapper modChannel = NetworkRegistry.INSTANCE.newSimpleChannel(ARKCraft.MODID);
    ARKCraft.modChannel = modChannel;

    int id = 0;
    // The handler (usually in the packet class), the packet class, unique
    // identifier, side to be handled
    modChannel.registerMessage(OpenPlayerCrafting.Handler.class, OpenPlayerCrafting.class, id++, Side.SERVER);
    modChannel.registerMessage(PlayerPoop.Handler.class, PlayerPoop.class, id++, Side.SERVER);
    modChannel.registerMessage(OpenAttachmentInventory.Handler.class, OpenAttachmentInventory.class, id++,
            Side.SERVER);
    modChannel.registerMessage(ReloadStarted.Handler.class, ReloadStarted.class, id++, Side.SERVER);
    modChannel.registerMessage(ReloadFinished.Handler.class, ReloadFinished.class, id++, Side.CLIENT);
    modChannel.registerMessage(MessageHover.class, MessageHover.class, id++, Side.CLIENT);
    modChannel.registerMessage(MessageHoverReq.class, MessageHoverReq.class, id++, Side.SERVER);
    modChannel.registerMessage(BurnerToggle.Handler.class, BurnerToggle.class, id++, Side.SERVER);
    modChannel.registerMessage(UpdateEngrams.Handler.class, UpdateEngrams.class, id++, Side.CLIENT);
    modChannel.registerMessage(ARKPlayerUpdateRequest.Handler.class, ARKPlayerUpdateRequest.class, id++,
            Side.SERVER);
    modChannel.registerMessage(ARKPlayerUpdate.Handler.class, ARKPlayerUpdate.class, id++, Side.CLIENT);
    modChannel.registerMessage(PlayerEngramCrafterUpdate.Handler.class, PlayerEngramCrafterUpdate.class, id++,
            Side.CLIENT);
    modChannel.registerMessage(ScrollGui.Handler.class, ScrollGui.class, id++, Side.SERVER);
    modChannel.registerMessage(ARKModeToggle.Handler.class, ARKModeToggle.class, id++, Side.SERVER);
    modChannel.registerMessage(GunFired.Handler.class, GunFired.class, id++, Side.SERVER);
}
项目:EZStorage2    文件:EZNetwork.java   
public static SimpleNetworkWrapper registerNetwork() {
    id = 0;
    net = NetworkRegistry.INSTANCE.newSimpleChannel("ezChannel");
    net.registerMessage(MessageCustomClick.Handler.class, MessageCustomClick.class, id++, Side.SERVER);
    net.registerMessage(MessageRecipeSync.Handler.class, MessageRecipeSync.class, id++, Side.SERVER);
    net.registerMessage(MessageCraftingSync.Handler.class, MessageCraftingSync.class, id++, Side.CLIENT);
    net.registerMessage(MessageFilterUpdate.Handler.class, MessageFilterUpdate.class, id++, Side.CLIENT);
    net.registerMessage(MessageSecureSync.Handler.class, MessageSecureSync.class, id++, Side.CLIENT);
    net.registerMessage(MessageSecurePlayer.Handler.class, MessageSecurePlayer.class, id++, Side.SERVER);
    return net;
}
项目:IvToolkit    文件:IvNetworkHelperServer.java   
public static <UTileEntity extends TileEntity & PartialUpdateHandler> void sendTileEntityUpdatePacket(UTileEntity tileEntity, String context, SimpleNetworkWrapper network, EntityPlayer player, Object... params)
{
    if (!(player instanceof EntityPlayerMP))
        throw new UnsupportedOperationException();

    network.sendTo(PacketTileEntityData.packetEntityData(tileEntity, context, params), (EntityPlayerMP) player);
}
项目:IvToolkit    文件:IvNetworkHelperServer.java   
public static void sendToPlayersWatchingChunk(World world, int chunkX, int chunkZ, SimpleNetworkWrapper network, IMessage message)
{
    List<EntityPlayerMP> playersWatching = getPlayersWatchingChunk(world, chunkX, chunkZ);

    for (EntityPlayerMP playerMP : playersWatching)
    {
        network.sendTo(message, playerMP);
    }
}
项目:IvToolkit    文件:IvNetworkHelperServer.java   
public static void sendEEPUpdatePacketToPlayer(Entity entity, String capabilityKey, EnumFacing facing, String context, SimpleNetworkWrapper network, EntityPlayer player, Object... params)
{
    if (!(player instanceof EntityPlayerMP))
        throw new UnsupportedOperationException();

    network.sendTo(PacketEntityCapabilityData.packetEntityData(entity, capabilityKey, facing, context, params), (EntityPlayerMP) player);
}
项目:IvToolkit    文件:IvNetworkHelperServer.java   
public static void sendEEPUpdatePacket(Entity entity, String capabilityKey, EnumFacing facing, String context, SimpleNetworkWrapper network, Object... params)
{
    if (entity.world.isRemote)
        throw new UnsupportedOperationException();

    for (EntityPlayer player : ((WorldServer) entity.world).getEntityTracker().getTrackingPlayers(entity))
        sendEEPUpdatePacketToPlayer(entity, capabilityKey, facing, context, network, player, params);

    if (entity instanceof EntityPlayerMP) // Players don't 'track' themselves
        sendEEPUpdatePacketToPlayer(entity, capabilityKey, facing, context, network, (EntityPlayer) entity, params);
}
项目:IvToolkit    文件:IvNetworkHelperClient.java   
public static <ETileEntity extends TileEntity & ClientEventHandler> void sendTileEntityEventPacket(ETileEntity tileEntity, String context, SimpleNetworkWrapper network, Object... params)
{
    if (!(tileEntity.getWorld().isRemote))
        throw new UnsupportedOperationException();

    network.sendToServer(PacketTileEntityClientEvent.packetEntityData(tileEntity, context, params));
}
项目:MeeCreeps    文件:MeeCreepsMessages.java   
public static void registerMessages(SimpleNetworkWrapper net) {
    INSTANCE = net;
    registerMessages();
}
项目:DankNull    文件:ModNetworking.java   
public static SimpleNetworkWrapper getInstance() {
    if (INSTANCE == null) {
        INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(ModGlobals.MODID);
    }
    return INSTANCE;
}
项目:ToughExpansion    文件:ModNetworking.java   
public static SimpleNetworkWrapper getInstance() {
    if (INSTANCE == null) {
        INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(ModGlobals.MODID);
    }
    return INSTANCE;
}
项目:Lithium-Forge    文件:LithiumMod.java   
public static SimpleNetworkWrapper getSimpleNetworkWrapper() {
    return network;
}
项目:DebugServerInfo    文件:DebugServerInfo.java   
public static SimpleNetworkWrapper getSnw()
{
    return instance.snw;
}
项目:MiningWells    文件:ModPackets.java   
public static final SimpleNetworkWrapper getNetwork() {
    return network;
}
项目:Possessed    文件:Possessed.java   
public static SimpleNetworkWrapper getNetworkWrapper() {
    return Possessed.networkWrapper;
}
项目:mves    文件:ConfigHandler.java   
public ConfigHandler(String modid, Logger log, SimpleNetworkWrapper network) {
  this.modid = modid;
  this.log = log;
  this.network = network;
}
项目:Structure    文件:StructureNetwork.java   
public static void init(@Nonnull final SimpleNetworkWrapper network)
{
    network.registerMessage(StructurePacket.Handler.class, StructurePacket.class, 1, Side.CLIENT);

    StructureNetwork.network = network;
}
项目:CrystalMod    文件:NetworkWrapper.java   
public NetworkWrapper(String channelName) {
  network = new SimpleNetworkWrapper(channelName);
  handler = new AbstactPacketHandler();
}
项目:metamorph    文件:Dispatcher.java   
public static SimpleNetworkWrapper get()
{
    return DISPATCHER;
}
项目:TravelHut    文件:ConfigHandler.java   
public ConfigHandler(String modid, Logger log, SimpleNetworkWrapper network) {
  this.modid = modid;
  this.log = log;
  this.network = network;
}
项目:blockbuster    文件:Dispatcher.java   
public static SimpleNetworkWrapper get()
{
    return DISPATCHER;
}
项目:CommonUtils    文件:ProxyModBase.java   
public SimpleNetworkWrapper getNetChannel() {
    return netChannel;
}
项目:wolfarmor    文件:PacketHandler.java   
public static SimpleNetworkWrapper getChannel() {
    return CHANNEL;
}
项目:TeslaEssentials    文件:ChatSync.java   
public static void createChatSyncForMod(String modid, SimpleNetworkWrapper wrapper){
    if(INSTANCE.containsKey(modid)) return;
    wrapper.registerMessage(MessageHandler.class, ChatMessage.class, 1, Side.CLIENT);
    INSTANCE.put(modid, new ChatSync(wrapper));
}
项目:CivCraft    文件:MessageHandler.java   
@Override
public SimpleNetworkWrapper get() {
    return INSTANCE;
}
项目:Cyclic    文件:PacketRegistry.java   
public static void register(SimpleNetworkWrapper network) {
  int packetID = 0;
  network.registerMessage(PacketOpenExtendedInventory.class, PacketOpenExtendedInventory.class, packetID++, Side.SERVER);
  network.registerMessage(PacketOpenNormalInventory.class, PacketOpenNormalInventory.class, packetID++, Side.SERVER);
  network.registerMessage(PacketSyncExtendedInventory.class, PacketSyncExtendedInventory.class, packetID++, Side.CLIENT);
  network.registerMessage(PacketSpellShiftLeft.class, PacketSpellShiftLeft.class, packetID++, Side.SERVER);
  network.registerMessage(PacketSpellShiftRight.class, PacketSpellShiftRight.class, packetID++, Side.SERVER);
  network.registerMessage(PacketParticleAtPosition.class, PacketParticleAtPosition.class, packetID++, Side.CLIENT);
  network.registerMessage(PacketSpellFromServer.class, PacketSpellFromServer.class, packetID++, Side.SERVER);
  network.registerMessage(PacketWandGui.class, PacketWandGui.class, packetID++, Side.SERVER);
  network.registerMessage(PacketMovePlayerColumn.class, PacketMovePlayerColumn.class, packetID++, Side.SERVER);
  network.registerMessage(PacketMovePlayerHotbar.class, PacketMovePlayerHotbar.class, packetID++, Side.SERVER);
  network.registerMessage(PacketWarpButton.class, PacketWarpButton.class, packetID++, Side.SERVER);
  network.registerMessage(PacketNewButton.class, PacketNewButton.class, packetID++, Side.SERVER);
  network.registerMessage(PacketDeleteWaypoint.class, PacketDeleteWaypoint.class, packetID++, Side.SERVER);
  network.registerMessage(PacketDepositPlayerToNearby.class, PacketDepositPlayerToNearby.class, packetID++, Side.SERVER);
  network.registerMessage(PacketDepositContainerToPlayer.class, PacketDepositContainerToPlayer.class, packetID++, Side.SERVER);
  network.registerMessage(PacketQuickStack.class, PacketQuickStack.class, packetID++, Side.SERVER);
  network.registerMessage(PacketRestockContainerToPlayer.class, PacketRestockContainerToPlayer.class, packetID++, Side.SERVER);
  network.registerMessage(PacketOpenFakeWorkbench.class, PacketOpenFakeWorkbench.class, packetID++, Side.SERVER);
  network.registerMessage(PacketSpellBuildSize.class, PacketSpellBuildSize.class, packetID++, Side.SERVER);
  network.registerMessage(PacketSyncPlayerData.class, PacketSyncPlayerData.class, packetID++, Side.CLIENT);
  packetID++;//removed packets from a refactor . KEEP THESE lines so packet ids dont mismatch
  packetID++;
  network.registerMessage(PacketSyncPlayerHealth.class, PacketSyncPlayerHealth.class, packetID++, Side.CLIENT);
  network.registerMessage(PacketTilePassword.class, PacketTilePassword.class, packetID++, Side.SERVER);
  network.registerMessage(PacketMoveBlock.class, PacketMoveBlock.class, packetID++, Side.SERVER);
  packetID++;
  network.registerMessage(PacketSwapBlock.class, PacketSwapBlock.class, packetID++, Side.SERVER);
  network.registerMessage(PacketRandomize.class, PacketRandomize.class, packetID++, Side.SERVER);
  network.registerMessage(PacketChestSack.class, PacketChestSack.class, packetID++, Side.SERVER);
  network.registerMessage(PacketTileRedstoneToggle.class, PacketTileRedstoneToggle.class, packetID++, Side.SERVER);
  network.registerMessage(PacketTileSizeToggle.class, PacketTileSizeToggle.class, packetID++, Side.SERVER);
  network.registerMessage(PacketTileIncrementField.class, PacketTileIncrementField.class, packetID++, Side.SERVER);
  packetID++;
  network.registerMessage(PacketTilePatternSwap.class, PacketTilePatternSwap.class, packetID++, Side.SERVER);
  packetID++;
  network.registerMessage(PacketTileVector.class, PacketTileVector.class, packetID++, Side.SERVER);
  network.registerMessage(PacketPlayerFalldamage.class, PacketPlayerFalldamage.class, packetID++, Side.SERVER);
  network.registerMessage(PacketSyncPlayerFlying.class, PacketSyncPlayerFlying.class, packetID++, Side.CLIENT);
  network.registerMessage(PacketSyncVillagerToClient.class, PacketSyncVillagerToClient.class, packetID++, Side.CLIENT);
  network.registerMessage(PacketSyncVillagerToServer.class, PacketSyncVillagerToServer.class, packetID++, Side.SERVER);
  network.registerMessage(PacketVillagerTrade.class, PacketVillagerTrade.class, packetID++, Side.SERVER);
  network.registerMessage(PacketSleepClient.class, PacketSleepClient.class, packetID++, Side.CLIENT);
  packetID++;
  network.registerMessage(PacketItemToggle.class, PacketItemToggle.class, packetID++, Side.SERVER);
  network.registerMessage(PacketTilePylon.class, PacketTilePylon.class, packetID++, Side.SERVER);
  network.registerMessage(PacketSound.class, PacketSound.class, packetID++, Side.CLIENT);
  network.registerMessage(PacketFluidSync.class, PacketFluidSync.class, packetID++, Side.CLIENT);
  network.registerMessage(PacketSwapPlayerHotbar.class, PacketSwapPlayerHotbar.class, packetID++, Side.SERVER);
  network.registerMessage(PacketTileFacingToggle.class, PacketTileFacingToggle.class, packetID++, Side.SERVER);
  network.registerMessage(PacketTileSetField.class, PacketTileSetField.class, packetID++, Side.SERVER);
  network.registerMessage(PacketTileFuelDisplay.class, PacketTileFuelDisplay.class, packetID++, Side.SERVER);
  network.registerMessage(PacketGuiShortOverride.class, PacketGuiShortOverride.class, packetID++, Side.CLIENT);
  network.registerMessage(PacketTileTextbox.class, PacketTileTextbox.class, packetID++, Side.SERVER);
  network.registerMessage(PacketScythe.class, PacketScythe.class, packetID++, Side.SERVER);
}
项目:Production-Line    文件:PLNetwork.java   
public static SimpleNetworkWrapper getNetwork() {
    return network;
}
项目:minedriod    文件:Modification.java   
public SimpleNetworkWrapper getNet() {
    return NETWORK;
}
项目:Progression    文件:PenguinNetwork.java   
public PenguinNetwork(String name) {
    INSTANCE = new SimpleNetworkWrapper(name);
    handler = new PenguinPacketHandler();
}
项目:taam    文件:TaamCommonProxy.java   
public void registerPackets(SimpleNetworkWrapper network) {
    network.registerMessage(TPMachineConfiguration.Handler.class, TPMachineConfiguration.class, 1, Side.SERVER);
    network.registerMessage(TPAdvancedGuiAppData.Handler.class, TPAdvancedGuiAppData.class, 2, Side.SERVER);
}