本文整理汇总了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;
}