diff --git a/src/main/java/me/lrxh/practice/essentials/Essentials.java b/src/main/java/me/lrxh/practice/essentials/Essentials.java index 7c0f9ea..d4b3d2a 100644 --- a/src/main/java/me/lrxh/practice/essentials/Essentials.java +++ b/src/main/java/me/lrxh/practice/essentials/Essentials.java @@ -7,7 +7,6 @@ import org.bukkit.World; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; -import org.bukkit.entity.Item; import org.bukkit.entity.Player; import java.io.IOException; @@ -33,8 +32,7 @@ public void setSpawn(Location location) { try { practice.getMainConfig().getConfiguration().save(practice.getMainConfig().getFile()); - } catch (IOException e) { - e.printStackTrace(); + } catch (IOException ignored) { } } @@ -51,40 +49,11 @@ public void teleportToSpawn(Player player) { public void clearEntities(World world) { for (Entity entity : world.getEntities()) { - if (!(entity.getType() == EntityType.PLAYER)) { + if (entity.getType() == EntityType.PLAYER) { continue; } entity.remove(); } } - - public int clearEntities(World world, EntityType... excluded) { - int removed = 0; - - entityLoop: - for (Entity entity : world.getEntities()) { - if (entity instanceof Item) { - removed++; - entity.remove(); - continue entityLoop; - } - - for (EntityType type : excluded) { - if (entity.getType() == EntityType.PLAYER) { - continue entityLoop; - } - - if (entity.getType() == type) { - continue entityLoop; - } - } - - removed++; - entity.remove(); - } - - return removed; - } - } diff --git a/src/main/java/me/lrxh/practice/match/Match.java b/src/main/java/me/lrxh/practice/match/Match.java index bb07fa5..36bc22f 100644 --- a/src/main/java/me/lrxh/practice/match/Match.java +++ b/src/main/java/me/lrxh/practice/match/Match.java @@ -85,13 +85,7 @@ public static void cleanup() { } for (Player player : Bukkit.getOnlinePlayers()) { Profile profile = Profile.getByUuid(player.getUniqueId()); - new BukkitRunnable() { - @Override - public void run() { - profile.save(); - System.out.println("Saved Profile: " + profile); - } - }.runTaskAsynchronously(Practice.getInstance()); + profile.save(); } }