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


Java PlayerEvent.PlayerLoggedOutEvent方法代码示例

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


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

示例1: PlayerLoggedOut

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
 public void PlayerLoggedOut(PlayerEvent.PlayerLoggedOutEvent evt) {

if(Main.debug==1)System.out.println(evt.player.getName() + " called PlayentLoggedOut");
MinecraftServer minecraftServer = FMLServerHandler.instance().getServer();
String brut = minecraftServer.getPlayerList().getPlayerByUsername(evt.player.getName()).connection.getNetworkManager().getRemoteAddress().toString().replaceAll("/", "");
int lenght = brut.length();
brut = brut.substring(0, lenght-6);


if(Integer.parseInt((String) Main.config.get("iplogin")) > 0 && !Main.ips.containsKey(brut) && Main.logged.contains(evt.player.getName())){
	Main.ips.put(brut, 0);
	}


Main.logged.remove(evt.player.getName());
Main.posX.remove(evt.player.getName());
Main.posY.remove(evt.player.getName());
Main.posZ.remove(evt.player.getName());
Main.time.remove(evt.player.getName());
}
 
开发者ID:Fungie2134,项目名称:AuthMod,代码行数:22,代码来源:PlayerLoggedOut.java

示例2: onPlayerLogout

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerLogout(PlayerEvent.PlayerLoggedOutEvent event) {
	NBTTagCompound data = event.player.getEntityData().getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG);
	IHardcoreRevival revival = event.player.getCapability(CapabilityHardcoreRevival.REVIVAL_CAPABILITY, null);
	if(revival != null) {
		NBTBase tag = CapabilityHardcoreRevival.REVIVAL_CAPABILITY.writeNBT(revival, null);
		if (tag != null) {
			data.setTag("HardcoreRevival", tag);
			event.player.getEntityData().setTag(EntityPlayer.PERSISTED_NBT_TAG, data);
		}
	}
}
 
开发者ID:blay09,项目名称:HardcoreRevival,代码行数:13,代码来源:PlayerHandler.java

示例3: onPlayerLoggedOut

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
@SuppressWarnings("unused")
public void onPlayerLoggedOut(PlayerEvent.PlayerLoggedOutEvent event) {
    if(event.player == null) {
        return;
    }
    unEquipGear(event.player);
}
 
开发者ID:InfinityRaider,项目名称:3DManeuverGear,代码行数:9,代码来源:DartHandler.java

示例4: onPlayerLoggedOutEvent

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerLoggedOutEvent(PlayerEvent.PlayerLoggedOutEvent e)
{
    if(!e.player.world.isRemote)
    {
        SavedData data = SavedData.get(e.player.world);
        if(data != null)
        {
            ChunkLoaders cl = data.getChunkLoaders();
            cl.updateLoginTimestamp(e.player.getUniqueID().toString(), System.currentTimeMillis());
            data.setChunkLoaders(cl);
        }
    }
}
 
开发者ID:CorwinJV,项目名称:AChunkLoader,代码行数:15,代码来源:PlayerActivity.java

示例5: onPlayerDisconnect

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
@SuppressWarnings("unused")
public void onPlayerDisconnect(PlayerEvent.PlayerLoggedOutEvent event) {
    if(!event.player.getEntityWorld().isRemote) {
        removeLinkingProgress(event.player);
    }
}
 
开发者ID:InfinityRaider,项目名称:Boatifull,代码行数:8,代码来源:BoatLinker.java

示例6: onPlayerQuit

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onPlayerQuit(PlayerEvent.PlayerLoggedOutEvent event) {
    if (event.player.worldObj.isRemote) {
        return;
    }
    handleQuit((EntityPlayerMP) event.player);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:8,代码来源:ForgeMain.java

示例7: onPlayerQuit

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onPlayerQuit(PlayerEvent.PlayerLoggedOutEvent event) {
    if (event.player.world.isRemote) {
        return;
    }
    handleQuit((EntityPlayerMP) event.player);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:8,代码来源:ForgeMain.java

示例8: playerLoggedOutEvent

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void playerLoggedOutEvent(PlayerEvent.PlayerLoggedOutEvent event)
{
    if (Slack.instance.senderConnected)
    {
        Slack.instance.getSlackSender().sendToSlack(SlackCommandSender.getInstance(), event.player.getGameProfile().getName() + " left the game.");
    }
}
 
开发者ID:compwiz1548,项目名称:SlackMC,代码行数:9,代码来源:ServerActivityListener.java

示例9: onPlayerLogout

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerLogout(PlayerEvent.PlayerLoggedOutEvent event) {
    for (int i = 0; i < PlayerManager.getInstance().Players.size(); i++) {
        if (PlayerManager.getInstance().Players.get(i).getName().equals(event.player.getDisplayNameString())) {
            PlayerManager.getInstance().Players.remove(i);
        }
    }
}
 
开发者ID:m1k3s,项目名称:parachute,代码行数:9,代码来源:PlayerLoginHandler.java

示例10: onEntityDisconnect

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onEntityDisconnect(PlayerEvent.PlayerLoggedOutEvent event){
	if (event.player instanceof EntityPlayerMP)
		GriefGuardian._dal.logAction(
				(EntityPlayerMP)event.player, 
				Actions.DISCONNECT, 
				(int)Math.floor(event.player.posX), 
				(int)Math.floor(event.player.posY), 
				(int)Math.floor(event.player.posZ), 
				null, 
				""
				);
}
 
开发者ID:Mithion,项目名称:GriefGuardian,代码行数:14,代码来源:ActionLogEventHandler.java

示例11: onPlayerLogout

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerLogout(PlayerEvent.PlayerLoggedOutEvent event)
{
    if(Hats.config.playerHatsMode == 5 && SessionState.currentKingServer.equalsIgnoreCase(event.player.getName()))
    {
        //King logged out
        List<EntityPlayerMP> players = FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayers();
        List<EntityPlayerMP> list = new ArrayList(players);
        list.remove(event.player);
        if(!list.isEmpty())
        {
            EntityPlayer newKing = list.get(event.player.world.rand.nextInt(list.size()));
            Hats.eventHandlerServer.updateNewKing(newKing.getName(), null, true);
            Hats.eventHandlerServer.updateNewKing(newKing.getName(), newKing, true);
            FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().sendMessage(new TextComponentTranslation("hats.kingOfTheHat.update.playerLeft", event.player.getName(), newKing.getName()));
        }
    }

    TimeActiveInfo info = Hats.eventHandlerServer.playerActivity.get(event.player.getName());

    if(info != null)
    {
        NBTTagCompound persistentTag = event.player.getEntityData().getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG);
        persistentTag.setInteger("Hats_activityLevels", info.levels);
        persistentTag.setInteger("Hats_activityTimeleft", info.timeLeft);
        event.player.getEntityData().setTag(EntityPlayer.PERSISTED_NBT_TAG, persistentTag);

        info.active = false;
    }

    Hats.proxy.playerWornHats.remove(event.player.getName());
}
 
开发者ID:iChun,项目名称:Hats,代码行数:33,代码来源:EventHandlerServer.java

示例12: onLogout

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority =  EventPriority.LOW)
public static void onLogout(PlayerEvent.PlayerLoggedOutEvent event) {
    hitList.remove(event.player);
}
 
开发者ID:ichttt,项目名称:FirstAid,代码行数:5,代码来源:EventHandler.java

示例13: logout

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void logout(PlayerEvent.PlayerLoggedOutEvent event) {
    clearCache(event);
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:5,代码来源:GrassColours.java

示例14: toLua

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@Override
public Proxy<PlayerEvent.PlayerLoggedOutEvent> toLua(PlayerEvent.PlayerLoggedOutEvent javaObj) {
  return new Proxy<>(getConverters(), getMetatable(), javaObj);
}
 
开发者ID:wizards-of-lua,项目名称:wizards-of-lua,代码行数:5,代码来源:PlayerLoggedOutEventClass.java

示例15: onPlayerLogout

import net.minecraftforge.fml.common.gameevent.PlayerEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerLogout(PlayerEvent.PlayerLoggedOutEvent event) {
	this.tick = 0; //Always reset timer
	this.isAvailable = false;
}
 
开发者ID:3TUSK,项目名称:BiliLiveMonitor,代码行数:6,代码来源:PlayerMonitor.java


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