Skip to content

Commit

Permalink
add fix for mojang's code not handling mount failures
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Feb 15, 2021
1 parent f7d997b commit 3741bf7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Expand Up @@ -154,7 +154,7 @@ public class ItemScriptContainer extends ScriptContainer {
// # | Most item scripts should exclude this key!
// color: ColorTag
//
// # If your material is a 'm@written_book', you can specify a book script to automatically scribe your item
// # If your material is a 'written_book', you can specify a book script to automatically scribe your item
// # upon creation. See 'book script containers' for more information.
// # | Most item scripts should exclude this key, though there are certain rare cases it may be useful to.
// book: book_script_name
Expand Down
Expand Up @@ -52,11 +52,6 @@ public TimedQueue getOrMakeQueue(final Player player, boolean quiet) {
return queue;
}
queue = new TimedQueue("EX_SUSTAINED_COMMAND", 0);
if (!quiet && player != null) {
queue.debugOutput = (s) -> {
player.spigot().sendMessage(FormattedTextHelper.parse(s, net.md_5.bungee.api.ChatColor.WHITE));
};
}
queue.waitWhenEmpty = true;
playerQueues.put(id, queue);
return queue;
Expand All @@ -77,6 +72,15 @@ public boolean onCommand(CommandSender sender, Command cmd, String alias, String
return true;
}
TimedQueue queue = getOrMakeQueue(sender instanceof Player ? (Player) sender : null, quiet);
if (!quiet && sender instanceof Player) {
Player player = (Player) sender;
queue.debugOutput = (s) -> {
player.spigot().sendMessage(FormattedTextHelper.parse(s, net.md_5.bungee.api.ChatColor.WHITE));
};
}
else {
queue.debugOutput = null;
}
if (queue.isPaused() || queue.isDelayed()) {
sender.sendMessage(ChatColor.YELLOW + "Sustained queue is currently paused or waiting, adding command to queue for later execution.");
}
Expand Down
Expand Up @@ -167,6 +167,9 @@ public void a(PacketPlayInUseEntity packet) {
@Override
public void a(PacketPlayInFlying packet) {
handlePacketIn(packet);
if (!(packet instanceof PacketPlayInFlying.PacketPlayInLook) && player.getVehicle() != null) {
player.playerConnection.sendPacket(new PacketPlayOutMount(player.getVehicle()));
}
oldListener.a(packet);
}

Expand Down

0 comments on commit 3741bf7

Please sign in to comment.