mirror of
https://github.com/kaboomserver/extras.git
synced 2025-07-28 00:16:12 +00:00
perf: don't use block state snapshot in ServerCommandEvent
This commit is contained in:
parent
dd8b5a4729
commit
0888a863bb
1 changed files with 1 additions and 2 deletions
|
@ -180,10 +180,9 @@ public final class ServerCommand implements Listener {
|
||||||
final CommandSender sender = event.getSender();
|
final CommandSender sender = event.getSender();
|
||||||
|
|
||||||
if (sender instanceof BlockCommandSender blockCommandSender) {
|
if (sender instanceof BlockCommandSender blockCommandSender) {
|
||||||
final var commandBlock = (CommandBlock) blockCommandSender.getBlock().getState();
|
final var commandBlock = (CommandBlock) blockCommandSender.getBlock().getState(false);
|
||||||
|
|
||||||
commandBlock.setCommand("");
|
commandBlock.setCommand("");
|
||||||
commandBlock.update();
|
|
||||||
} else if (sender instanceof CommandMinecart commandMinecart) {
|
} else if (sender instanceof CommandMinecart commandMinecart) {
|
||||||
commandMinecart.setCommand("");
|
commandMinecart.setCommand("");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue