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"); } } }
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"); } } }
@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); } } }
@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); } } }