Remove excessive check

This commit is contained in:
mathias 2019-08-01 18:58:35 +03:00
parent 3d1581d5b4
commit 9e03cd15f5
2 changed files with 3 additions and 16 deletions

View file

@ -25,8 +25,6 @@ import org.bukkit.event.entity.EntitySpawnEvent;
import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.entity.SpawnerSpawnEvent; import org.bukkit.event.entity.SpawnerSpawnEvent;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import com.destroystokyo.paper.event.block.TNTPrimeEvent; import com.destroystokyo.paper.event.block.TNTPrimeEvent;
@ -36,17 +34,6 @@ import com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent;
import com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent; import com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent;
class EntitySpawn implements Listener { class EntitySpawn implements Listener {
@EventHandler
void onChunkLoad(ChunkLoadEvent event) {
final int count = event.getChunk().getEntities().length;
if (count > 50) {
for (int i = 51; i <= count; i++) {
event.getChunk().getEntities()[i].remove();
}
}
}
@EventHandler @EventHandler
void onCreatureSpawn(CreatureSpawnEvent event) { void onCreatureSpawn(CreatureSpawnEvent event) {
if (event.getSpawnReason() == SpawnReason.CUSTOM || if (event.getSpawnReason() == SpawnReason.CUSTOM ||

View file

@ -86,10 +86,10 @@ class PlayerConnection implements Listener {
@EventHandler @EventHandler
void onPlayerLogin(PlayerLoginEvent event) { void onPlayerLogin(PlayerLoginEvent event) {
if (!(event.getHostname().startsWith("play.kaboom.pw") && /*if (!(event.getHostname().startsWith("play.kaboom.pw") &&
event.getHostname().endsWith(":53950"))) { event.getHostname().endsWith(":53950"))) {
event.disallow(Result.KICK_OTHER, "You connected to the server using an outdated server address/IP.\nPlease use the following address/IP:\n\nkaboom.pw"); event.disallow(Result.KICK_OTHER, "You connected to the server using an outdated server address/IP.\nPlease use the following address/IP:\n\nkaboom.pw");
} else { } else {*/
final Player player = event.getPlayer(); final Player player = event.getPlayer();
event.allow(); event.allow();
@ -101,7 +101,7 @@ class PlayerConnection implements Listener {
} catch (Exception exception) { } catch (Exception exception) {
} }
main.playerProfile.remove(player.getName()); main.playerProfile.remove(player.getName());
} /*}*/
} }
@EventHandler @EventHandler