當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。