Java 类cpw.mods.fml.common.gameevent.PlayerEvent 实例源码

项目:MidgarCrusade    文件:JoueurEvent.java   
@SubscribeEvent
  public void onPlayerChangedDimension(PlayerEvent.PlayerChangedDimensionEvent event)
  {
ServerPlayerBaseMagic player;
PacketLogIn packet;

player = Main.getPlayerServer((EntityPlayerMP) event.player);
   player.getPlayer().getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0d + (player.getLevel() - 1) * 0.5d);
packet = new PacketLogIn(player);
Packets.network.sendTo(packet, player.getPlayer());

if (Main.get_dungeon(event.toDim) != null)
    Main.get_dungeon(event.toDim).onPlayerJoin(player);

if (event.toDim == Main.DIM_ID)
    event.player.triggerAchievement(AchievementList.NEW_DIMENSION);
  }
项目:MidgarCrusade    文件:ServerEvent.java   
@SubscribeEvent
  public void onPlayerLogout(PlayerEvent.PlayerLoggedOutEvent event)
  {
System.out.println("Logged out: " + event.player);

for (Dungeon d : Main.DUNGEONS)
{
    if (event.player.dimension == d.DIM_ID)
    {
        Main.getPlayerServer(event.player).travelToDimension(d.DIM_RETOUR, event.player.dimension);
        Main.log(event.player.getCommandSenderName() + " has disconnected into a dungeon");
        return ;
    }
}

  }
项目:PopularMMOS-EpicProportions-Mod    文件:OnJoinEvent.java   
@SubscribeEvent
public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) {

    event.player.addChatComponentMessage(new ChatComponentText("�b�lHello" + " " + "�e�l" + event.player.getDisplayName() + "�b�l!"));
    event.player.addChatComponentMessage(new ChatComponentText(/*/event.player.getDisplayName() + /*/"�a�l" + EpicProportionsMod.MODNAME + " " + "�2�lMade By:jtrent238"));
    event.player.addChatComponentMessage(new ChatComponentText(/*/event.player.getDisplayName() + /*/"�6�lYou are running" + "�b�l" + " " + EpicProportionsMod.MODVERSION + " " + "�6�lof" + "�6�l" + " " + EpicProportionsMod.MODNAME + "!"));
    //event.player.addChatComponentMessage(new ChatComponentText("�e�lLearn more at: �b�lhttp://bit.ly/FoodModWiki"));
    event.player.triggerAchievement(Achievements.achievementinstall);
    //event.player.addEntityCrashInfo(EpicProportionsMod.CRASHINFO);
    //event.player.clonePlayer(playerclone, true);
    event.player.extinguish();
    event.player.getDisplayName();
    //event.player.writeToNBT(EpicProportionsMod.NBTJOIN);
    event.player.getBedLocation();
    event.player.shouldHeal();
    event.getListenerList();
    event.hashCode();
    Minecraft.getSystemTime();
    Minecraft.isAmbientOcclusionEnabled();
    Minecraft.isGuiEnabled();
    Minecraft.getMinecraft();
    Minecraft.getGLMaximumTextureSize();
    Minecraft.isFancyGraphicsEnabled();
    //Log.getLog(arg0, arg1, arg2);
    //event.notifyAll();


}
项目:DartCraft2    文件:TransmutationHandler.java   
@SubscribeEvent
public void onCraft(PlayerEvent.ItemCraftedEvent event) {
    if (event.crafting != null) {
        ItemStack rod = null;
        ItemStack toTransmute = null;
        ItemStack transmuted = event.crafting;
        for (int i = 0; i < event.craftMatrix.getSizeInventory(); i++)
            if (event.craftMatrix.getStackInSlot(i) != null)
                if (event.craftMatrix.getStackInSlot(i).getItem() instanceof ITransmutationItem) {
                    rod = event.craftMatrix.getStackInSlot(i).copy();
                } else {
                    if (toTransmute != null)
                        return;
                    toTransmute = event.craftMatrix.getStackInSlot(i);
                }
        if (rod != null && toTransmute != null && transmuted != null) {
            ((ITransmutationItem)rod.getItem()).transmute(rod, toTransmute.getItem(), toTransmute.getItemDamage(), 
                    transmuted.getItem(), transmuted.getItemDamage());
            event.player.inventory.addItemStackToInventory(rod);
            if (!event.player.getEntityWorld().isRemote)
                DartCraft2.NETWORK.sendToAll(new DartCraftEffectPacket(event.player.getEntityWorld(), (int) event.player.posX, (int) event.player.posY, (int) event.player.posZ));
        }
    }
}
项目:PlayerInterfaceMod    文件:PlimEventHandler.java   
@SubscribeEvent
public void playerLoginEvent(PlayerEvent.PlayerLoggedInEvent event) {
    //event.player.addChatComponentMessage(new ChatComponentText("Hallo " + event.player.getDisplayName()));
    if (event.player == null) {
        return;
    }

    // DEBUG
    //event.player.addChatComponentMessage(new ChatComponentText("Your Player-Interfaces are: "));

    for (InterfaceRegistry.InterfaceDataContainer dataContainer : InterfaceRegistry.getInterfacesOfPlayer(event.player.getUniqueID())) {
        // DEBUG
        //event.player.addChatComponentMessage(new ChatComponentText(String.format("x: %d, y: %d, z: %d", dataContainer.x, dataContainer.y, dataContainer.z)));
        TileEntityPlayerInterface te = ((TileEntityPlayerInterface) DimensionManager.getWorld(dataContainer.dimensionID).getTileEntity(dataContainer.x, dataContainer.y, dataContainer.z));

        if (te != null) {
            te.bindPlayer(event.player.getUniqueID());
        }
    }
}
项目:PlayerInterfaceMod    文件:PlimEventHandler.java   
@SubscribeEvent
public void playerLogoutEvent(PlayerEvent.PlayerLoggedOutEvent event) {
    if (event.player == null) {
        return;
    }

    for (InterfaceRegistry.InterfaceDataContainer dataContainer : InterfaceRegistry.getInterfacesOfPlayer(event.player.getUniqueID())) {
        // DEBUG
        //event.player.addChatComponentMessage(new ChatComponentText(String.format(">>>>>> x: %d, y: %d, z: %d", dataContainer.x, dataContainer.y, dataContainer.z)));
        //LogHelper.info(String.format(">>>>>> DIM: %d, x: %d, y: %d, z: %d", dataContainer.dimensionID, dataContainer.x, dataContainer.y, dataContainer.z));
        TileEntityPlayerInterface te = ((TileEntityPlayerInterface) DimensionManager.getWorld(dataContainer.dimensionID).getTileEntity(dataContainer.x, dataContainer.y, dataContainer.z));

        if (te != null) {
            te.setPlayerOffline();
        }
    }
}
项目:AdvancedRocketry    文件:PlanetEventHandler.java   
@SubscribeEvent
public void onCrafting(PlayerEvent.ItemCraftedEvent event) {
    if(event.crafting != null) {
        Item item = event.crafting.getItem();
        if(item == LibVulpesItems.itemHoloProjector) 
            event.player.triggerAchievement(ARAchivements.holographic);
        else if(item == Item.getItemFromBlock(AdvancedRocketryBlocks.blockRollingMachine))
            event.player.triggerAchievement(ARAchivements.rollin);
        else if(item == Item.getItemFromBlock(AdvancedRocketryBlocks.blockCrystallizer))
            event.player.triggerAchievement(ARAchivements.crystalline);
        else if(item == Item.getItemFromBlock(AdvancedRocketryBlocks.blockLathe))
            event.player.triggerAchievement(ARAchivements.spinDoctor);
        else if(item ==Item.getItemFromBlock(AdvancedRocketryBlocks.blockElectrolyser))
            event.player.triggerAchievement(ARAchivements.electrifying);
        else if(item == Item.getItemFromBlock(AdvancedRocketryBlocks.blockArcFurnace))
            event.player.triggerAchievement(ARAchivements.feelTheHeat);
        else if(item == Item.getItemFromBlock(AdvancedRocketryBlocks.blockWarpCore))
            event.player.triggerAchievement(ARAchivements.warp);
        else if(item == Item.getItemFromBlock(AdvancedRocketryBlocks.blockPlatePress))
            event.player.triggerAchievement(ARAchivements.blockPresser);
    }
}
项目:YetAnotherLoginMessageMod    文件:PlayerLoginHandler.java   
@SubscribeEvent
public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event)
{
    File file = new File(ConfigHandler.messageFile);

    if (file.lastModified() > lastModifiedTimestamp)
    {
        loginMessage = FileHelper.readFile(ConfigHandler.messageFile);
        lastModifiedTimestamp = file.lastModified();
    }

    if (loginMessage == null)
    {
        return;
    }

    new Timer().schedule(new MessageTask(loginMessage, event.player), ConfigHandler.messageDelay);
}
项目:MyMod    文件:CraftingHandler.java   
@SubscribeEvent
public void onPlayerItemCrafted(PlayerEvent.ItemCraftedEvent event) {

    if (event.crafting.isItemEqual(new ItemStack(ModItems.ammo))) {
        for (int i = 0; i < event.craftMatrix.getSizeInventory(); i++) {
            ItemStack stack = event.craftMatrix.getStackInSlot(i);
            if (stack != null && stack.isItemStackDamageable()) {

                if (stack.getItemDamage() <= stack.getMaxDamage() - 1) {
                    stack.setItemDamage(stack.getItemDamage() + 1);
                    stack.stackSize++;
                } else {
                    event.craftMatrix.setInventorySlotContents(i, null);
                    MinecraftForge.EVENT_BUS
                            .post(new PlayerDestroyItemEvent(event.player,
                                    stack));
                }
            }
        }
    }
}
项目:HardChoices    文件:FMLEventHandler.java   
@SubscribeEvent
public void itemCraftedEvent(PlayerEvent.ItemCraftedEvent event) { //fired after pulling the item away
    GameRegistry.UniqueIdentifier identifier =  GameRegistry.findUniqueIdentifierFor(event.crafting.getItem());
    ExtendedPlayer playerData = ExtendedPlayer.get(event.player);
    for (String modId : playerData.disabledMods.keySet()){
        if (modId.toLowerCase().trim().equals(identifier.modId.toLowerCase().trim())){ //trims unnecessary?
            if (!playerData.disabledMods.get(modId)){
                if (!PlayerData.getBlacklistGroupDisabled(modId, event.player)){   //if mod group isn't disabled
                    PlayerData.disableGroupMods(modId, event.player);              //disable them
                    CommonProxy.saveProxyData(event.player);                       //save changes
                    NetworkingHandler.network.sendToServer(new UpdateCraftingMessage("updtCrftng")); //send message from client to server to update
                }
            }
        }
    }

}
项目:Corruption    文件:FMLEventHandler.java   
@SubscribeEvent
public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent e) {
    if (Corruption.corrSpeed == 20) e.player.addChatComponentMessage(new ChatComponentText("[Corruption] Please note that this server is running at ModJam speed (10x faster then normal!) so you can see the full effects of the mod. You can change this in your config"));

    //Introduction
    if (CorruptionDataHelper.needIntroduction(e.player)) {
        if (this.playerIntroduction.count(e.player.getCommandSenderName()) > 0) {
            e.player.addChatComponentMessage(new ChatComponentTranslation("chat.corruption.logout").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_RED).setItalic(true)));
            CorruptionDataHelper.increaseCorruptionForPlayer(e.player, 50);
        }
        else {
            this.playerIntroduction.add(e.player.getCommandSenderName());
        }
    }

    Corruption.eventChannel.sendTo(PacketEventHandler.getDiaryDataPacket(e.player), (EntityPlayerMP) e.player);
    List<String> corrEffects = CorruptionDataHelper.getCorruptionEffectsForPlayer(e.player);
    if (!corrEffects.isEmpty()) {
        for (String corr : corrEffects) {
            Corruption.eventChannel.sendTo(PacketEventHandler.getCorruptionEffectPacket(e.player.getCommandSenderName(), corr, true, false), (EntityPlayerMP) e.player);
        }
    }
}
项目:ServerTools-PERMISSION    文件:EventHandler.java   
@SubscribeEvent
public void nameFormat(net.minecraftforge.event.entity.player.PlayerEvent.NameFormat event) {
    if (!PermissionConfig.prefixChatGroupName) return;

    Collection<Group> groups = PermissionManager.getGroups(event.entityPlayer.getPersistentID());
    if (groups.isEmpty()) return;

    StringBuilder sb = new StringBuilder();

    for (Group group : groups) {
        if (group.groupName.equalsIgnoreCase(PermissionConfig.defaultGroup) && !PermissionConfig.prefixChatDefaultGroup)
            continue;

        EnumChatFormatting color = EnumChatFormatting.getValueByName(group.getChatColor());
        if (color == null) color = WHITE;

        sb.append(color + "[" + group.groupName + "]" + RESET);
    }
    if (sb.toString().isEmpty())
        return;

    sb.append(" ");

    event.displayname = sb.toString() + event.displayname;
}
项目:Marble    文件:CraftingHandler.java   
@SubscribeEvent
public void onCraft(PlayerEvent.ItemCraftedEvent event){
    ItemStack pickaxe = null;

    if(OreHelper.isItemThisOre(event.crafting, "dustTinyGem")){
        for(int slot = 0; slot < event.craftMatrix.getSizeInventory(); slot++){
            if(event.craftMatrix.getStackInSlot(slot) != null){
                ItemStack stack = event.craftMatrix.getStackInSlot(slot);
                if(stack.getItem().getHarvestLevel(stack, "pickaxe") >= 2){
                    if(stack.getItemDamage() < stack.getMaxDamage() - 7){
                        pickaxe = stack.copy();
                    }
                }
            }
        }
    }
    if(pickaxe != null){
        pickaxe.damageItem(5, event.player);
        if(!event.player.worldObj.isRemote) {
            MiscHelper.drop(event.player, pickaxe, 0);
        }
    }
}
项目:SmartCursor    文件:UpdateManager.java   
@SubscribeEvent
public void onEnterWorld(PlayerEvent.PlayerLoggedInEvent event) {
    this.event = event;
    new Thread() {
        public void run() {
            try {
                String page = makeRequest("https://mods.io/mods/1089-smartcursor");
                int l = page.indexOf("<td><strong>");
                if (l < 0) throw new Exception("");
                int r = page.indexOf("</strong>", l + 10);
                if (r < 0) throw new Exception("");
                String localVersion = ModInfo.VERSION;
                String globalVersion = page.substring(l + 12, r);
                if (localVersion.compareToIgnoreCase(globalVersion) < 0) {
                    UpdateManager.this.event.player.addChatComponentMessage(new ChatComponentText("SmartCursor is out-of-date. Your version - " + localVersion + ", latest version - " + globalVersion));
                    UpdateManager.this.event.player.addChatComponentMessage(generateClickableMessage());
                }
            } catch (Exception e) {
                System.out.println("Unable to fetch information about updates!");
            }
        }
    }.start();
}
项目:TheStuffMod    文件:PlayerLogin.java   
@SubscribeEvent
public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) {
    if(ConfigurationHandler.displayAmount) {
        event.player.addChatMessage(new ChatComponentText("[AllTheThings] "+Reference.BLOCKS_ADDED+" blocks added"));
        event.player.addChatMessage(new ChatComponentText("[AllTheThings] "+Reference.ITEMS_ADDED+" items added"));
    }
    for (int i = 0; i < msgs.size(); i++) {
        event.player.addChatMessage(new ChatComponentText((String) msgs.get(i)));
    }
    /**
    book.setTagInfo("author", new NBTTagString("Shnupbups100"));
    book.setTagInfo("title", new NBTTagString(StatCollector.translateToLocal("book.allthethings:guidebook.title")));
    NBTTagList pages = new NBTTagList();
       pages.appendTag(new NBTTagString(StatCollector.translateToLocal("book.allthethings:guidebook.page1")));
       pages.appendTag(new NBTTagString(StatCollector.translateToLocal("book.allthethings:guidebook.page2")));
       pages.appendTag(new NBTTagString(StatCollector.translateToLocal("book.allthethings:guidebook.page3")));
       pages.appendTag(new NBTTagString(StatCollector.translateToLocal("book.allthethings:guidebook.page4")));
       book.setTagInfo("pages", pages);
    event.player.inventory.addItemStackToInventory(book);**/
}
项目:ExtraUtilities    文件:ItemAngelRing.java   
@SubscribeEvent
public void playerLogin(final PlayerEvent.PlayerLoggedInEvent event) {
    for (final String name : MinecraftServer.getServer().getAllUsernames()) {
        if (ItemAngelRing.curFlyingPlayers.containsKey(name)) {
            NetworkHandler.sendPacketToPlayer(new PacketAngelRingNotifier(name, ItemAngelRing.curFlyingPlayers.get(name)), event.player);
        }
        else {
            NetworkHandler.sendPacketToPlayer(new PacketAngelRingNotifier(name, 0), event.player);
        }
    }
}
项目:EnhancedLootBags    文件:LootGroupsHandler.java   
/**
 * SERVERSIDE
 * 
 * @param pEvent
 */
@SubscribeEvent
public void onPlayerJoin( PlayerEvent.PlayerLoggedInEvent pEvent )
{
    if( pEvent.player instanceof EntityPlayerMP )
        sendClientUpdate( (EntityPlayerMP) pEvent.player );
}
项目:MidgarCrusade    文件:JoueurEvent.java   
@SubscribeEvent
  public void onCraft(PlayerEvent.ItemCraftedEvent event)
  {
Item item = event.crafting.getItem();

if (item == ItemRegister.BLUE_STICK)
    event.player.triggerAchievement(AchievementList.NEW_ITEMS);
else if (item == ItemRegister.TITANIUM_CHESTPLATE || item == ItemRegister.TITANIUM_BOOTS || item == ItemRegister.TITANIUM_PANTS ||item == ItemRegister.TITANIUM_HELMET)
    event.player.triggerAchievement(AchievementList.TITANIUM_STUFF);
else if (item == ItemRegister.SILVER_PICKAXE)
    event.player.triggerAchievement(AchievementList.SILVER_PICKAXE);
else if (item == ItemRegister.ETHERNIUM_SWORD)
    event.player.triggerAchievement(AchievementList.ETHERNIUM_SWORD);
  }
项目:MidgarCrusade    文件:JoueurEvent.java   
@SubscribeEvent
  public void onItemPickup(PlayerEvent.ItemPickupEvent event)
  {
Item item;

item = event.pickedUp.getEntityItem().getItem();

if (item == ItemRegister.STAFF_BUMPING || item == ItemRegister.STAFF_ELFIC || item == ItemRegister.STAFF_LIGHTNING)
    event.player.triggerAchievement(AchievementList.MAGIC_STAFF);
else if (item == ItemRegister.SULFURAS)
    event.player.triggerAchievement(AchievementList.SULFURAS);

  }
项目:MidgarCrusade    文件:JoueurEvent.java   
@SubscribeEvent
  public void onPlayerRespawn(PlayerEvent.PlayerRespawnEvent event)
  {
ServerPlayerBaseMagic player;

player = Main.getPlayerServer((EntityPlayerMP) event.player);
player.onRespawn();
  }
项目:MidgarCrusade    文件:ServerEvent.java   
@SubscribeEvent
  public void onPlayerLog(PlayerEvent.PlayerLoggedInEvent event)
  {
ServerPlayerBaseMagic player;
PacketLogIn packet;

event.player.triggerAchievement(AchievementList.LOGING);
player = Main.getPlayerServer((EntityPlayerMP) event.player);
packet = new PacketLogIn(player);
Packets.network.sendTo(packet, player.getPlayer());

for (Dungeon d : Main.DUNGEONS) //Install les maps du donjon
    d.install_map(event.player.worldObj.getWorldInfo().getWorldName());
  }
项目:BIGB    文件:PlayerDetector.java   
@SubscribeEvent
public void onJoinWorlds(PlayerEvent.PlayerLoggedInEvent e) {
     activePlayers.put(new PlayerID(e.player), (EntityPlayerMP)e.player);
     for (Acceptor<EntityPlayerMP> action: onLogin) {
         action.accept((EntityPlayerMP)e.player);
     }
}
项目:BIGB    文件:PlayerDetector.java   
@SubscribeEvent
public void onLeaveWorlds(PlayerEvent.PlayerLoggedOutEvent e) {
    activePlayers.remove(new PlayerID(e.player));
     for (Acceptor<EntityPlayerMP> action: onLogout) {
         action.accept((EntityPlayerMP)e.player);
     }
}
项目:EEWReciever    文件:AuthNoticeHandler.java   
@SubscribeEvent
public void onPlayerLogin(final PlayerEvent.PlayerLoggedInEvent event) {
    if (TweetQuake.instance().isAuthRequired()&&isOp(event.player.getGameProfile())) {
        final ChatStyle style = new ChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/eewreciever auth start"));
        ChatBuilder.create("[EEWReciever2] Twitter認証が完了していません。クリックして開始する(Twitterアカウントが必要です").setStyle(style).sendPlayer(event.player);
    }
}
项目:PopularMMOS-EpicProportions-Mod    文件:Joke.java   
@SubscribeEvent
public void PlayerEvent(PlayerEvent event) {


    int minimum = 0;
    double maximum = 21;
    int index = minimum + (int)(Math.random() * maximum); ;
    event.player.addChatComponentMessage(new ChatComponentText("�b�lHello" + " " + "�e�l" + event.player.getDisplayName() + JokeAsk.get(index)));
    System.out.println(index);
}
项目:CollectiveFramework    文件:CollectiveFramework.java   
@SubscribeEvent
public void onServerJoin(PlayerEvent.PlayerLoggedInEvent event) {
    if (FMLCommonHandler.instance().getSide() == Side.SERVER || FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER)
        for (ConfigRegistry.ConfigProxy proxy : ConfigRegistry.configs) {
            if (proxy.doesSync)
                NETWORK.sendTo(new ConfigPacket(proxy.fileName, proxy.handler.convertToString(proxy.config), false), (EntityPlayerMP) event.player);
        }
}
项目:CollectiveFramework    文件:CollectiveFramework.java   
@SubscribeEvent
public void onClientDisconnect(PlayerEvent.PlayerLoggedOutEvent event) {
    if (FMLCommonHandler.instance().getSide() == Side.SERVER || FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER)
        for (ConfigRegistry.ConfigProxy proxy : ConfigRegistry.configs) {
            if (proxy.doesSync)
                NETWORK.sendTo(new ConfigPacket(proxy.fileName, proxy.handler.convertToString(proxy.config), true), (EntityPlayerMP) event.player);
        }
}
项目:PowerLines    文件:PowerLinesMod.java   
private void sendPlayerPowerGridWorldSavedData(PlayerEvent event)
{
    World world = event.player.getEntityWorld();
    PowerGridWorldSavedData pgwsd = PowerGridWorldSavedData.get(world);
    PowerGridSynchronizationMessage message = new PowerGridSynchronizationMessage(pgwsd);

    PowerLinesMod.networking.sendTo(message, (EntityPlayerMP) event.player);
}
项目:NewHorizonsCoreMod    文件:CustomToolTipsHandler.java   
@SubscribeEvent
public void onPlayerJoin( PlayerEvent.PlayerLoggedInEvent pEvent )
{
  if( pEvent.player instanceof EntityPlayerMP ) {
    sendClientUpdate(pEvent.player);
  }
}
项目:Minecraft-Vending-Machine-Revamped    文件:VendingMachineVersion.java   
@SubscribeEvent
public void checkUpdate(PlayerEvent.PlayerLoggedInEvent event) {
    if(VendingMachineConfigs.checkUpdate) {
        if(status==Status.OUTDATED) {
            EntityPlayer player = event.player;
            player.addChatComponentMessage(new ChatComponentTranslation("vendingmachine.update"));
            IChatComponent component = IChatComponent.Serializer.func_150699_a(StatCollector.translateToLocal("vendingmachine.update.download"));
            player.addChatMessage(component);
        }
    }
}
项目:UBChisel    文件:PlayerDetector.java   
@SubscribeEvent
public void onJoinWorlds(PlayerEvent.PlayerLoggedInEvent e) {
     activePlayers.put(new PlayerID(e.player), (EntityPlayerMP)e.player);
     for (Acceptor<EntityPlayerMP> action: onLogin) {
         action.accept((EntityPlayerMP)e.player);
     }
}
项目:UBChisel    文件:PlayerDetector.java   
@SubscribeEvent
public void onLeaveWorlds(PlayerEvent.PlayerLoggedOutEvent e) {
    activePlayers.remove(new PlayerID(e.player));
     for (Acceptor<EntityPlayerMP> action: onLogout) {
         action.accept((EntityPlayerMP)e.player);
     }
}
项目:FastAsyncWorldedit    文件:ForgeMain.java   
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onPlayerQuit(PlayerEvent.PlayerLoggedOutEvent event) {
    if (event.player.worldObj.isRemote) {
        return;
    }
    handleQuit((EntityPlayerMP) event.player);
}
项目:Thallus    文件:PlayerEventHandler.java   
@SubscribeEvent
public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event)
{
    StatsHelper stats = StatsHelper.get(event.player);

    if (Configs.Mod.disableVersionCheck)
        event.player.addChatMessage(new ChatComponentText(UpdateHandler.status));
}
项目:Thallus    文件:PlayerEventHandler.java   
@SubscribeEvent
public void onItemPickup(PlayerEvent.ItemPickupEvent event)
{
    // TODO: Implement ItemPickupEventHandler (Achievement on ItemPickup ??)

    //if (event.pickedUp.getEntityItem().getItem().equals(ModItems.testItem))
    //if (event.pickedUp.getEntityItem().getItem().equals(Item.getItemFromBlock(ModBlocks.testBlock))

    //event.player.addStat(Thallus.testAchievement, 1);
}
项目:Thallus    文件:PlayerEventHandler.java   
@SubscribeEvent
public void onCrafting(PlayerEvent.ItemCraftedEvent event)
{
    // TODO: Implement ItemSmeltingHandler (Achievement on Smelt ??)

    //if (event.crafting.getItem().equals(ModItems.testItem))
    //if (event.crafting.getItem().equals(Item.getItemFromBlock(ModBlocks.testBlock))

    //event.player.addStat(AchievementHandler.DEBUG, 1);
}
项目:Thallus    文件:PlayerEventHandler.java   
@SubscribeEvent
public void onSmelting(PlayerEvent.ItemSmeltedEvent event)
{
    // TODO: Implement ItemCraftedHandler (Achievement on Craft ??)

    //if (event.smelting.getItem().equals(ModItems.testItem))
    //if (event.smelting.getItem().equals(Item.getItemFromBlock(ModBlocks.testBlock))

    //event.player.addStat(AchievementHandler.DEBUG, 1);
}
项目:qcraft-mod    文件:QCraftProxyCommon.java   
@SubscribeEvent
public void onPlayerLogin( PlayerEvent.PlayerLoggedInEvent event )
{
    EntityPlayer player = event.player;
    if( FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER )
    {
        QCraft.clearUnverifiedLuggage( player ); // Shouldn't be necessary, but can't hurt
        QCraft.requestLuggage( player );
    }
}
项目:qcraft-mod    文件:QCraftProxyCommon.java   
@SubscribeEvent
public void onPlayerLogout( PlayerEvent.PlayerLoggedOutEvent event )
{
    EntityPlayer player = event.player;
    if( FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER )
    {
        QCraft.clearUnverifiedLuggage( player );
    }
}
项目:betterbeginnings-MC1.7    文件:BBEventHandler.java   
@SubscribeEvent
public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent e)
{
    if (BBConfig.greetUser)
    {
        ChatUtil.sendChatToPlayer(e.player, ChatUtil.LIME + "BetterBeginnings " + ModMain.VERSION +
            " loaded successfully.");
    }
}