SPIGOT-7945: Bukkit#dispatchCommand throws UnsupportedOperationException
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -9,6 +9,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import net.minecraft.commands.CommandDispatcher;
|
||||
import net.minecraft.commands.CommandListenerWrapper;
|
||||
import net.minecraft.server.level.EntityPlayer;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.world.entity.vehicle.EntityMinecartCommandBlock;
|
||||
import org.bukkit.Location;
|
||||
@@ -67,6 +68,10 @@ public final class VanillaCommandWrapper extends BukkitCommand {
|
||||
return ((EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).getCommandBlock().createCommandSourceStack();
|
||||
}
|
||||
|
||||
if (sender instanceof EntityPlayer player) {
|
||||
return player.createCommandSourceStack();
|
||||
}
|
||||
|
||||
return entity.getHandle().createCommandSourceStackForNameResolution((WorldServer) entity.getHandle().level());
|
||||
}
|
||||
if (sender instanceof BlockCommandSender) {
|
||||
|
||||
Reference in New Issue
Block a user