本文整理汇总了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);
}
}
示例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);
}
}
示例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;
}
}
示例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();
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例8: logoutEvent
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void logoutEvent(PlayerLoggedOutEvent event) {
NEIServerConfig.unloadPlayer(event.player);
}
示例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);
}
}
示例10: playerLogout
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void playerLogout(PlayerLoggedOutEvent event) {
PlayerChunkViewerManager.instance().logouts.add(event.player.getName());
}
示例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);
}
}
示例12: onPlayerLogout
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLogout(PlayerLoggedOutEvent par1Event)
{
setMaxHealth(par1Event.player, 20);
}