Java 类net.minecraft.world.BossInfoServer 实例源码

项目:justenoughdimensions    文件:CommandTeleportJED.java   
private void removeDragonBossBarHack(EntityPlayerMP player, WorldProviderEnd provider)
{
    // FIXME 1.9 - Somewhat ugly way to clear the Boss Info stuff when teleporting FROM The End
    DragonFightManager manager = provider.getDragonFightManager();

    if (manager != null)
    {
        try
        {
            BossInfoServer bossInfo = ReflectionHelper.getPrivateValue(DragonFightManager.class, manager, "field_186109_c", "bossInfo");
            if (bossInfo != null)
            {
                bossInfo.removePlayer(player);
            }
        }
        catch (UnableToAccessFieldException e)
        {
            JustEnoughDimensions.logger.warn("tpj: Failed to get DragonFightManager#bossInfo");
        }
    }
}
项目:enderutilities    文件:TeleportEntity.java   
private static void removeDragonBossBarHack(EntityPlayerMP player, WorldProviderEnd provider)
{
    // Somewhat ugly way to clear the Boss Info stuff when teleporting FROM The End
    DragonFightManager manager = provider.getDragonFightManager();

    if (manager != null)
    {
        try
        {
            BossInfoServer bossInfo = ReflectionHelper.getPrivateValue(DragonFightManager.class, manager, "field_186109_c", "bossInfo");

            if (bossInfo != null)
            {
                bossInfo.removePlayer(player);
            }
        }
        catch (UnableToAccessFieldException e)
        {
            EnderUtilities.logger.warn("TP: Failed to get DragonFightManager#bossInfo");
        }
    }
}
项目:BetterWithAddons    文件:AssortedHandler.java   
@SubscribeEvent
public void beginTrack(PlayerEvent.StartTracking trackEvent) {
    if (!trackEvent.getEntityPlayer().getEntityWorld().isRemote) {
        Entity target = trackEvent.getTarget();
        EntityPlayerMP player = (EntityPlayerMP) trackEvent.getEntityPlayer();

        UUID uuid = target.getUniqueID();

        if (BossList.containsKey(uuid)) {
            BossInfoServer bossInfo = BossList.get(uuid);
            bossInfo.addPlayer(player);
        }
    }
}
项目:BetterWithAddons    文件:AssortedHandler.java   
@SubscribeEvent
public void endTrack(PlayerEvent.StopTracking trackEvent) {
    if (!trackEvent.getEntityPlayer().getEntityWorld().isRemote) {
        Entity target = trackEvent.getTarget();
        EntityPlayerMP player = (EntityPlayerMP) trackEvent.getEntityPlayer();

        UUID uuid = target.getUniqueID();

        if (BossList.containsKey(uuid)) {
            BossInfoServer bossInfo = BossList.get(uuid);
            bossInfo.removePlayer(player);
        }
    }
}