Fix TNT physics overflow

This commit is contained in:
mathias 2019-08-07 15:37:11 +03:00
parent 6835013bef
commit 2e5eecf936
2 changed files with 14 additions and 2 deletions

View file

@ -321,7 +321,7 @@ class EntitySpawn implements Listener {
final double tps = Bukkit.getTPS()[0];
if (tps < 10) {
event.setCancelled(true);
event.getBlock().setType(Material.AIR, false);
}
}
}

View file

@ -33,7 +33,19 @@ class PlayerCommand implements Listener {
return;
}
if (("/minecraft:gamerule".equalsIgnoreCase(arr[0]) ||
if (("/minecraft:execute".equals(arr[0].toLowerCase()) ||
"/execute".equals(arr[0].toLowerCase())) &&
arr.length >= 1) {
final StringBuilder stringBuilder = new StringBuilder();
for (int i = 1; i < arr.length; i++) {
stringBuilder.append(arr[i] + " ");
}
if (stringBuilder.toString().toLowerCase().contains("execute") ||
stringBuilder.toString().toLowerCase().contains("sudo")) {
event.setCancelled(true);
}
} else if (("/minecraft:gamerule".equalsIgnoreCase(arr[0]) ||
"/gamerule".equalsIgnoreCase(arr[0])) &&
arr.length >= 3) {
if ("randomTickSpeed".equalsIgnoreCase(arr[1]) &&