本文整理汇总了Java中cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent类的典型用法代码示例。如果您正苦于以下问题:Java PlayerLoggedOutEvent类的具体用法?Java PlayerLoggedOutEvent怎么用?Java PlayerLoggedOutEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlayerLoggedOutEvent类属于cpw.mods.fml.common.gameevent.PlayerEvent包,在下文中一共展示了PlayerLoggedOutEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPlayerLogout
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLogout(PlayerLoggedOutEvent event)
{
ArrayList<RecipeChain> playerChains = chains.getValues(event.player);
if(playerChains != null)
{
for (int i = 0; i < playerChains.size(); i++) {
for (int j = 0; j < playerChains.get(i).result.stacks.size(); j++) {
if(!InventoryUtils.addItemStackToInventory(event.player.inventory, playerChains.get(i).result.stacks.get(j)))
WorldUtils.dropItem(event.player, playerChains.get(i).result.stacks.get(j));
}
}
chains.removeKey(event.player);
}
}
示例2: onPlayerLogout
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLogout(PlayerLoggedOutEvent event)
{
if (event.player instanceof EntityPlayerMP)
{
this.onPlayerLogout((EntityPlayerMP) event.player);
}
}
示例3: onPlayerLoggedOut
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLoggedOut(PlayerLoggedOutEvent event) {
if (!addPlayerLoggedOut.isEmpty()) {
hPlayerLoggedOut.addAll(addPlayerLoggedOut);
addPlayerLoggedOut.clear();
}
for (Iterator<LIHandler> it = hPlayerLoggedOut.iterator(); it.hasNext(); ) {
LIHandler handler = it.next();
if (handler.isDead())
it.remove();
else
handler.trigger(event);
}
}
示例4: onPlayerLogoutEvent
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLogoutEvent(PlayerLoggedOutEvent event)
{
Mekanism.jetpackOn.remove(event.player.getCommandSenderName());
Mekanism.gasmaskOn.remove(event.player.getCommandSenderName());
Mekanism.flamethrowerActive.remove(event.player.getCommandSenderName());
}
示例5: onPlayerLoggedOutEvent
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLoggedOutEvent(PlayerLoggedOutEvent event) {
Side side = FMLCommonHandler.instance().getEffectiveSide();
if (side == Side.SERVER) {
List<MocapAction> aList = Mocap.instance
.getActionListForPlayer(event.player);
if (aList != null) {
MocapAction ma = new MocapAction(MocapActionTypes.LOGOUT);
aList.add(ma);
}
}
}
示例6: logout
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void logout(PlayerLoggedOutEvent e)
{
if (e.player.worldObj.isRemote)
{
// client
INSTANCE.stains.clear();
}
else
{
// server
PacketManager.sendToPlayer(new PacketStainRemover(e.player.dimension), e.player);
}
}
示例7: onPlayerLoggedOut
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent //TODO I used the Unload event before.
public void onPlayerLoggedOut(PlayerLoggedOutEvent event){
if(mod_SecurityCraft.configHandler.disconnectOnWorldClose && mod_SecurityCraft.instance.getIrcBot() != null){
mod_SecurityCraft.instance.getIrcBot().disconnect();
mod_SecurityCraft.instance.setIrcBot(null);
}
}
示例8: onPlayerLeave
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLeave(PlayerLoggedOutEvent event) {
synchronized (playerListeners) {
for (IPlayerEventHook listener : playerListeners) {
listener.onPlayerLeave(event.player.getDisplayName());
}
}
}
示例9: onPlayerLogout
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLogout(PlayerLoggedOutEvent event) {
Integer experience = entityIdToExperience.remove(event.player.getEntityId());
if (experience != null) {
ProjectZuluLog.info("Removing Experience (%s) and adding (%s)", event.player.experienceTotal, experience);
event.player.experienceLevel = 0;
event.player.experienceTotal = 0;
event.player.experience = 0;
event.player.addExperience(experience);
}
}
示例10: onPlayerLogout
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLogout(PlayerLoggedOutEvent event)
{
ChunkLoadingCallback.onPlayerLogout(event.player);
}
示例11: logoutEvent
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void logoutEvent(PlayerLoggedOutEvent event) {
NEIServerConfig.unloadPlayer(event.player);
}
示例12: onPlayerLeave
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
public void onPlayerLeave(PlayerLoggedOutEvent event) {
FWPlayerStats stats = FWPlayerStats.get(event.player);
stats.isLoggedIn = false;
}
示例13: onPlayerLogoutEvent
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLogoutEvent(PlayerLoggedOutEvent event) {
prevAtmosphere.remove(event.player);
}
示例14: onPlayerLogout
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLogout(PlayerLoggedOutEvent e) {
}
示例15: onPlayerLoggedOut
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerLoggedOut(PlayerLoggedOutEvent evt) {
removeFromAll(evt.player);
}