From 4d56e8ebf64a08ff5d3c6c8b93309067b41e3174 Mon Sep 17 00:00:00 2001 From: mathias Date: Mon, 10 Jun 2019 14:10:53 +0300 Subject: [PATCH] Hotfix for sign crash --- src/main/java/pw/kaboom/extras/Events.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/pw/kaboom/extras/Events.java b/src/main/java/pw/kaboom/extras/Events.java index 2d27bdd..ff9444f 100644 --- a/src/main/java/pw/kaboom/extras/Events.java +++ b/src/main/java/pw/kaboom/extras/Events.java @@ -535,6 +535,11 @@ class Events implements Listener { String particleArr[] = event.getMessage().split(" ", 11); event.setMessage(particleArr[0].replaceAll(" [^ ]+$", "") + " 10 " + particleArr[1]); } + } else if (arr[0].toLowerCase().equals("/minecraft:setblock") || + arr[0].toLowerCase().equals("/setblock")) { + if (event.getMessage().contains("translation.test.invalid")) { + event.setCancelled(true); + } } } @@ -573,7 +578,7 @@ class Events implements Listener { @EventHandler void onPlayerLogin(PlayerLoginEvent event) { if (!(event.getHostname().startsWith("play.kaboom.pw") && - event.getHostname().endsWith(":49450"))) { + 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"); } else { final Player player = event.getPlayer(); @@ -696,6 +701,11 @@ class Events implements Listener { String particleArr[] = event.getCommand().split(" ", 11); event.setCommand(particleArr[0].replaceAll(" [^ ]+$", "") + " 10 " + particleArr[1]); } + } else if (arr[0].toLowerCase().equals("minecraft:setblock") || + arr[0].toLowerCase().equals("setblock")) { + if (event.getCommand().contains("translation.test.invalid")) { + event.setCancelled(true); + } } }