本文整理汇总了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());
}
}
示例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);
}
示例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);
}
示例4: serverConnectionFromClient
import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void serverConnectionFromClient(FMLNetworkEvent.ServerConnectionFromClientEvent event) {
event.manager.sendPacket(DemoBiomeIdPacket.createPacket(Config.biomeId));
}
示例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();
}
示例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());
}