|
|
|
@ -25,21 +25,25 @@ public class Sharehealth extends JavaPlugin { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private HealthManager healthManager; |
|
|
|
|
|
|
|
|
|
public HealthManager getHealthManager() { |
|
|
|
|
return healthManager; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private TotemManager totemManager; |
|
|
|
|
|
|
|
|
|
public TotemManager getTotemManager() { |
|
|
|
|
return totemManager; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Messenger messenger; |
|
|
|
|
|
|
|
|
|
public Messenger getMessenger() { |
|
|
|
|
return messenger; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Statistics statistics; |
|
|
|
|
|
|
|
|
|
public Statistics getStatistics() { |
|
|
|
|
return statistics; |
|
|
|
|
} |
|
|
|
@ -48,6 +52,7 @@ public class Sharehealth extends JavaPlugin { |
|
|
|
|
boolean isFailed = false; |
|
|
|
|
|
|
|
|
|
private final Map<String, Object> defaultStatus = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
defaultStatus.put("health", 20.); |
|
|
|
|
defaultStatus.put("isFailed", false); |
|
|
|
@ -153,12 +158,14 @@ public class Sharehealth extends JavaPlugin { |
|
|
|
|
|
|
|
|
|
saveStatus(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void onPlayerGotDamageByEntity(Player player, double damage, Entity damagingEntity, double absorbedDamage) { |
|
|
|
|
if (isFailed) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
messenger.onPlayerGotDamageMessage(player, damage + absorbedDamage, damagingEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void onPlayerGotDamageByBlock(Player player, double damage, Block damagingBlock, double absorbedDamage) { |
|
|
|
|
if (isFailed) |
|
|
|
|
return; |
|
|
|
@ -232,11 +239,13 @@ public class Sharehealth extends JavaPlugin { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static List<UUID> ActiveUUIDs = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
static List<Player> GetPlayers() { |
|
|
|
|
List<Player> players = new ArrayList<>(Bukkit.getOnlinePlayers()); |
|
|
|
|
players.removeIf(p -> !ActiveUUIDs.contains(p.getUniqueId())); |
|
|
|
|
return players; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static List<Player> GetPlayers(Player except) { |
|
|
|
|
List<Player> players = GetPlayers(); |
|
|
|
|
players.remove(except); |
|
|
|
|