本文整理匯總了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());
}
示例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);
}
}
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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.");
}
}
示例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);
}
}
}
示例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,
""
);
}
示例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());
}
示例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);
}
示例13: logout
import net.minecraftforge.fml.common.gameevent.PlayerEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void logout(PlayerEvent.PlayerLoggedOutEvent event) {
clearCache(event);
}
示例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);
}
示例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;
}