本文整理汇总了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]"));
}
}
示例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();
}
示例3: onClientConnection
import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onClientConnection(FMLNetworkEvent.ClientConnectedToServerEvent event)
{
exploTime.clear();
dismemberTimeout.clear();
explosionSources.clear();
}
示例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>");
});
}
示例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;
}
}
}
示例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;
}
}
示例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");
}
}
示例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();
}
}
示例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();
}
示例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();
}
}
示例11: serverLoginEvent
import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void serverLoginEvent(FMLNetworkEvent.ClientConnectedToServerEvent event)
{
hasJoinedWorld = false;
}
示例12: onConnect
import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onConnect(FMLNetworkEvent.ClientConnectedToServerEvent event) {
getOrSetPublicLog(); // set public log file
}
示例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");
}
示例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));
}
示例15: onClientConnect
import net.minecraftforge.fml.common.network.FMLNetworkEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onClientConnect(FMLNetworkEvent.ClientConnectedToServerEvent event)
{
onClientConnection();
}