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


Java FMLNetworkEvent.ClientConnectedToServerEvent方法代码示例

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


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

示例1: onPlayerJoinServer

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerJoinServer(FMLNetworkEvent.ClientConnectedToServerEvent e)
{
    if (e.isLocal())
    {
        singlePlayerGames++;
        ConcurrentUtil.executor.execute(() ->
                DiscordCE.client.getAccountManager().setGame("Minecraft [SP]"));
    }
    else
    {
        multiplayerGames++;
        ConcurrentUtil.executor.execute(() ->
                DiscordCE.client.getAccountManager().setGame("Minecraft [MP]"));
    }
}
 
开发者ID:duke605,项目名称:DiscordCE,代码行数:17,代码来源:MinecraftEventHandler.java

示例2: onClientConnect

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onClientConnect(FMLNetworkEvent.ClientConnectedToServerEvent event)
{
    ProjectHelper.projectParts.clear();
    ProjectHelper.projectTextureParts.clear();

    for(ProjectInfo proj : ProjectHelper.projects.values())
    {
        proj.destroy();
    }

    for(Integer id : ProjectHelper.projectTextureIDs.values())
    {
        TextureUtil.deleteTexture(id);
    }

    ProjectHelper.projects.clear();
    ProjectHelper.projectTextures.clear();
    ProjectHelper.projectTextureIDs.clear();
}
 
开发者ID:iChun,项目名称:Tabula,代码行数:22,代码来源:EventHandler.java

示例3: onClientConnection

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onClientConnection(FMLNetworkEvent.ClientConnectedToServerEvent event)
{
    exploTime.clear();
    dismemberTimeout.clear();
    explosionSources.clear();
}
 
开发者ID:iChun,项目名称:Mob-Dismemberment,代码行数:8,代码来源:EventHandlerClient.java

示例4: clientConnectedToServer

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
/**
 * Prints server connection info when the client connects to a server.
 * <p>
 * Test for this thread:
 * http://www.minecraftforge.net/forum/index.php/topic,34546.0.html
 *
 * @param event The event
 */
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void clientConnectedToServer(FMLNetworkEvent.ClientConnectedToServerEvent event) {
    final IThreadListener mainThread = Minecraft.getMinecraft();
    mainThread.addScheduledTask(() -> {
        final ServerData serverData = Minecraft.getMinecraft().getCurrentServerData();
        Logger.info("Server Connected! Local? %s - Address: %s", event.isLocal(), serverData != null ? serverData.serverIP : "<No ServerData>");
    });
}
 
开发者ID:droidicus,项目名称:AquaRegia,代码行数:18,代码来源:NetworkEventHandler.java

示例5: onJoinServer

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onJoinServer(FMLNetworkEvent.ClientConnectedToServerEvent e) {
    for (String ip : ConfigHandler.spongeServers) {
        if (Minecraft.getMinecraft().getCurrentServerData().serverIP.contains(ip)) {
            JEIButtons.isSpongePresent = true;
            JEIButtons.logInfo("Sponge support is enabled for this server!");
            break;
        }
    }
}
 
开发者ID:univrsal,项目名称:JustEnoughButtons,代码行数:11,代码来源:EventHandlers.java

示例6: onClientConnect

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onClientConnect(FMLNetworkEvent.ClientConnectedToServerEvent event)
{
    Blocksteps.eventHandler.targetAngleX = Blocksteps.eventHandler.prevAngleX = Blocksteps.eventHandler.angleX = Blocksteps.config.camStartVertical;
    Blocksteps.eventHandler.targetAngleY = Blocksteps.eventHandler.prevAngleY = Blocksteps.eventHandler.angleY = Blocksteps.eventHandler.oriAngleY = Blocksteps.config.camStartHorizontal;
    Blocksteps.eventHandler.targetScale = Blocksteps.config.camStartScale;
    Blocksteps.eventHandler.prevScale = Blocksteps.eventHandler.scale = 0;
    saveTimeout = Blocksteps.config.saveInterval;

    String connectionName = event.getManager().getRemoteAddress().toString();
    if(connectionName.contains("/") && !connectionName.startsWith("/192.168.")) //probably a public server
    {
        saveLocation = new File(new File(ResourceHelper.getModsFolder(), "/blocksteps/"), connectionName.substring(0, connectionName.indexOf("/")) + "_" + connectionName.substring(connectionName.indexOf(":") + 1, connectionName.length()) + ".bsv");
        if(saveLocation.exists())
        {
            try
            {
                byte[] data = new byte[(int)saveLocation.length()];
                FileInputStream stream = new FileInputStream(saveLocation);
                stream.read(data);
                stream.close();
                MapSaveFile save = (new Gson()).fromJson(IOUtil.decompress(data), MapSaveFile.class);
                save.load();
            }
            catch(Exception e)
            {
                Blocksteps.LOGGER.warn("Error loading save file: " + saveLocation);
            };
        }
    }
    else if(connectionName.startsWith("local") || connectionName.startsWith("/192.168."))
    {
        attemptLocalLoad = true;
    }
}
 
开发者ID:iChun,项目名称:Blocksteps,代码行数:36,代码来源:EventHandlerClient.java

示例7: onClientConnectToServer

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onClientConnectToServer(FMLNetworkEvent.ClientConnectedToServerEvent event)
{
    if (SprinklesForVanilla.isOnServer)
    {
        //SprinklesForVanilla.network.sendToServer(new ConfigPacket("",""));
        LogHelper.info("Client has Joined Server with sprinkles_for_vanilla");
    }
}
 
开发者ID:VikeStep,项目名称:sprinkles_for_vanilla,代码行数:10,代码来源:NetworkHandler.java

示例8: onClientConnect

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public static void onClientConnect(FMLNetworkEvent.ClientConnectedToServerEvent event) {
    if (!event.isLocal()) {
        // Disable server specific options, which will be re-enabled if the server replies
        LogHandler.info("CLIENT: Connected to server. Disabling server-side click actions until server replies");
        ActionSessionData.activateClientValues();
    } else {
        ActionSessionData.activateAll();
    }
}
 
开发者ID:dmillerw,项目名称:MineMenu,代码行数:11,代码来源:NetworkEventHandler.java

示例9: onClientConnect

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onClientConnect(FMLNetworkEvent.ClientConnectedToServerEvent event)
{
    Hats.eventHandlerClient.isActive = true;

    SessionState.serverHasMod = 0;
    SessionState.currentKing = "";
    SessionState.showJoinMessage = 0;
    SessionState.hasVisited = 1;

    HatHandler.repopulateHatsList();
}
 
开发者ID:iChun,项目名称:Hats,代码行数:13,代码来源:EventHandlerClient.java

示例10: onClientConnection

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onClientConnection(FMLNetworkEvent.ClientConnectedToServerEvent event)
{
    connectingToServer = true;

    if(iChunUtil.userIsPatron)
    {
        patronUpdateServerAsPatron = true;
    }

    for(ConfigBase conf : ConfigHandler.configs)
    {
        conf.storeSession();
    }
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:16,代码来源:EventHandlerClient.java

示例11: serverLoginEvent

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void serverLoginEvent(FMLNetworkEvent.ClientConnectedToServerEvent event)
{
    hasJoinedWorld = false;
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:6,代码来源:EventHandler.java

示例12: onConnect

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onConnect(FMLNetworkEvent.ClientConnectedToServerEvent event) {
    getOrSetPublicLog(); // set public log file
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:5,代码来源:ChatLogger.java

示例13: onLogin

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public static void onLogin(FMLNetworkEvent.ClientConnectedToServerEvent event)
{
    executorService.scheduleAtFixedRate(new TCCheck(CHANNEL), 5, DELAY, TimeUnit.SECONDS);
    System.out.println("The thread is now running");
}
 
开发者ID:OCDiary,项目名称:Twitchy,代码行数:7,代码来源:TCEvents.java

示例14: clientConnectedToServer

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void clientConnectedToServer(FMLNetworkEvent.ClientConnectedToServerEvent event) {
	Minecraft.getMinecraft().addScheduledTask(() -> MinecraftForge.EVENT_BUS.register(EntityEventHandler.INSTANCE));
}
 
开发者ID:NickAcPT,项目名称:Lithium-Forge,代码行数:6,代码来源:NetworkEventHandler.java

示例15: onClientConnect

import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onClientConnect(FMLNetworkEvent.ClientConnectedToServerEvent event)
{
    onClientConnection();
}
 
开发者ID:iChun,项目名称:BackTools,代码行数:6,代码来源:EventHandlerClient.java


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