From 7eaf813228a670d7151923c4e9571690c6492863 Mon Sep 17 00:00:00 2001 From: mathiascode Date: Sun, 2 Aug 2020 22:48:51 +0300 Subject: [PATCH] Add limiter for command block minecarts --- .../java/pw/kaboom/extras/modules/server/ServerCommand.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java b/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java index c92a36d..1c61f64 100644 --- a/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java +++ b/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java @@ -3,6 +3,7 @@ package pw.kaboom.extras.modules.server; import org.bukkit.block.CommandBlock; import org.bukkit.command.BlockCommandSender; import org.bukkit.command.CommandSender; +import org.bukkit.entity.minecart.CommandMinecart; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.server.ServerCommandEvent; @@ -144,6 +145,10 @@ public final class ServerCommand implements Listener { commandBlock.setCommand(""); commandBlock.update(); + } else if (sender instanceof CommandMinecart) { + final CommandMinecart commandMinecart = (CommandMinecart) sender; + + commandMinecart.setCommand(""); } final String command = event.getCommand();