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


Java FMLNetworkEvent.ServerConnectionFromClientEvent方法代码示例

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


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

示例1: clientConnectedtoServer

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void clientConnectedtoServer(FMLNetworkEvent.ServerConnectionFromClientEvent event)
{
    if (!CreeperHost.instance.active)
        return;
    MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
    if (server == null || server.isSinglePlayer() || discoverMode != Discoverability.PUBLIC)
        return;

    INetHandlerPlayServer handler = event.getHandler();
    if (handler instanceof NetHandlerPlayServer)
    {
        EntityPlayerMP entity = ((NetHandlerPlayServer)handler).playerEntity;
        playersJoined.add(entity.getUniqueID());
    }
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:17,代码来源:CreeperHostServer.java

示例2: onConnectionCreated

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onConnectionCreated(FMLNetworkEvent.ServerConnectionFromClientEvent event)
{
    JustEnoughDimensions.logInfo("FMLNetworkEvent.ServerConnectionFromClientEvent: Syncing dimension data to client");
    DimensionSyncPacket packet = new DimensionSyncPacket();
    packet.addDimensionData(DimensionConfig.instance().getRegisteredDimensions());

    FMLEmbeddedChannel channel = JustEnoughDimensions.channels.get(Side.SERVER);
    channel.attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.DISPATCHER);
    channel.attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(event.getManager().channel().attr(NetworkDispatcher.FML_DISPATCHER).get());
    channel.writeOutbound(packet);
}
 
开发者ID:maruohon,项目名称:justenoughdimensions,代码行数:13,代码来源:JEDEventHandler.java

示例3: playerLoggedIn

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.LOWEST)
public void playerLoggedIn(FMLNetworkEvent.ServerConnectionFromClientEvent event) {
    PacketJunction.setup(event, Side.SERVER);
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:5,代码来源:HammerNet.java

示例4: serverConnectionFromClient

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void serverConnectionFromClient(FMLNetworkEvent.ServerConnectionFromClientEvent event) {
	event.manager.sendPacket(DemoBiomeIdPacket.createPacket(Config.biomeId));
}
 
开发者ID:worldwidewoogie,项目名称:demomod,代码行数:5,代码来源:DemoConnectionHandler.java

示例5: joinEvent

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void joinEvent(final FMLNetworkEvent.ServerConnectionFromClientEvent event)
{
    if (event.isLocal()) return;
    new Thread(new ForgeSubWhitelist.Checker(((NetHandlerPlayServer) event.getHandler()).player.getGameProfile())).start();
}
 
开发者ID:DoubleDoorDevelopment,项目名称:ForgeSubWhitelist,代码行数:7,代码来源:ForgeSubWhitelist.java

示例6: playerJoinServer

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
public void playerJoinServer(FMLNetworkEvent.ServerConnectionFromClientEvent e) {
    System.out.println("Sending message");
    Bagginses.INSTANCE.sendToAll(new BagDescMessage());
}
 
开发者ID:lorddusk,项目名称:Bagginses,代码行数:5,代码来源:PlayerServerEventHandler.java


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