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


Java PlayerLoggedOutEvent类代码示例

本文整理汇总了Java中net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent的典型用法代码示例。如果您正苦于以下问题:Java PlayerLoggedOutEvent类的具体用法?Java PlayerLoggedOutEvent怎么用?Java PlayerLoggedOutEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PlayerLoggedOutEvent类属于net.minecraftforge.fml.common.gameevent.PlayerEvent包,在下文中一共展示了PlayerLoggedOutEvent类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onEvent

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEvent(PlayerLoggedOutEvent evt) {
  EntityPlayerMP testPlayer = WolTestEnvironment.instance.getTestPlayer();
  if (testPlayer != null && testPlayer == evt.player) {
    WolTestEnvironment.instance.setTestPlayer(null);
  }
}
 
开发者ID:wizards-of-lua,项目名称:wizards-of-lua,代码行数:8,代码来源:ServerProxy.java

示例2: onPlayerLogOut

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
/**
 * Event listener when player logs out. This listener aborts the recording
 * for given player (well, if he records, but that {@link RecordManager}'s
 * job to find out).
 */
@SubscribeEvent
public void onPlayerLogOut(PlayerLoggedOutEvent event)
{
    EntityPlayer player = event.player;

    if (!player.worldObj.isRemote)
    {
        CommonProxy.manager.abortRecording(player);
    }
}
 
开发者ID:mchorse,项目名称:blockbuster,代码行数:16,代码来源:ActionHandler.java

示例3: onPlayerLoggedOutEvent

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
/**
 * This event is used to clear out the server configuration for clients that log off the server.
 * @param event The event object.
 */
@SubscribeEvent
public static void onPlayerLoggedOutEvent(PlayerLoggedOutEvent event)
{
	// When the player logs out, make sure to re-set the server configuration. 
	// This is so a new configuration can be successfully loaded when they switch servers or worlds (on single player.
	if (event.player.world.isRemote)
	{
		// Make sure to null out the server configuration from the client.
		((ClientProxy)Prefab.proxy).serverConfiguration = null;
	}
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:16,代码来源:ModEventHandler.java

示例4: playerLogout

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
/**
 * Invoked when a player logs out. Used to update and save the player's settings
 */
@SubscribeEvent
public void playerLogout(PlayerLoggedOutEvent event) {
	if (!(event.player instanceof EntityPlayerMP)) return;
	ServerPlayerSettings settings = event.player.getCapability(PlayerSettings.SETTINGS_CAP_SERVER, null);
	
	if (settings!= null) {
		settings.captureChannelsAndLeaveForLogout();
		settings.resetSettingsProperties(Maps.<SettingsProperty, String>newEnumMap(SettingsProperty.class));
		settings.getManager().saveSettings();
	}
}
 
开发者ID:MrNobody98,项目名称:morecommands,代码行数:15,代码来源:CommonHandler.java

示例5: onPlayerLoggedOut

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onPlayerLoggedOut(PlayerLoggedOutEvent event)
{
    if(event.player instanceof EntityPlayerMP)
    {
        ExcavationRenderTracker.INSTANCE.stopPlayerTracking((EntityPlayerMP) event.player);
    }
}
 
开发者ID:grondag,项目名称:Hard-Science,代码行数:9,代码来源:CommonEventHandler.java

示例6: playerLogout

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void playerLogout(PlayerLoggedOutEvent event) {
    RedstoneEther.server().removePlayer(event.player);
    RedstoneEtherAddons.server().onLogout(event.player);
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:6,代码来源:WREventHandler.java

示例7: cleanPlayer

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void cleanPlayer(PlayerLoggedOutEvent event) {
	ItemUsable.lastDamage.remove(event.player);
	if(TF2weapons.udpServer != null)
		TF2weapons.udpServer.playerList.remove(event.player.getCapability(TF2weapons.PLAYER_CAP, null).udpServerId);
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:7,代码来源:TF2EventsCommon.java

示例8: logoutEvent

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void logoutEvent(PlayerLoggedOutEvent event) {
    NEIServerConfig.unloadPlayer(event.player);
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:5,代码来源:ServerHandler.java

示例9: onPlayerLoggedOut

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLoggedOut(PlayerLoggedOutEvent event) {
	if (!event.player.world.isRemote) {
		PlayerHandler.playerLogOut(event.player);
	}
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:7,代码来源:EventHandler.java

示例10: playerLogout

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void playerLogout(PlayerLoggedOutEvent event) {
    PlayerChunkViewerManager.instance().logouts.add(event.player.getName());
}
 
开发者ID:TheCBProject,项目名称:ChickenChunks,代码行数:5,代码来源:ChunkLoaderEventHandler.java

示例11: playerLoggedOut

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void playerLoggedOut(PlayerLoggedOutEvent event) {
	if(event.player instanceof EntityPlayerMP) {
		ServerHandler.getServerMirror(null).playerList().playerLeave((EntityPlayerMP) event.player);
	}
}
 
开发者ID:tiffit,项目名称:TaleCraft,代码行数:7,代码来源:TaleCraftEventHandler.java

示例12: onPlayerLogout

import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLogout(PlayerLoggedOutEvent par1Event)
{
	setMaxHealth(par1Event.player, 20);
}
 
开发者ID:andykuo1,项目名称:mcplus_mods,代码行数:6,代码来源:EventHandlerBattleHearts.java


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