mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
SPIGOT-7948: Bukkit#dispatchCommand
uses the wrong CommandListenerWrapper
for Players
By: md_5 <git@md-5.net>
This commit is contained in:
parent
d27615dcaf
commit
b9a4bb1cd1
1 changed files with 3 additions and 3 deletions
|
@ -9,7 +9,6 @@ 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;
|
||||
|
@ -22,6 +21,7 @@ import org.bukkit.command.defaults.BukkitCommand;
|
|||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.entity.CraftMinecartCommand;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
import org.bukkit.entity.minecart.CommandMinecart;
|
||||
|
||||
public final class VanillaCommandWrapper extends BukkitCommand {
|
||||
|
@ -68,8 +68,8 @@ public final class VanillaCommandWrapper extends BukkitCommand {
|
|||
return ((EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).getCommandBlock().createCommandSourceStack();
|
||||
}
|
||||
|
||||
if (sender instanceof EntityPlayer player) {
|
||||
return player.createCommandSourceStack();
|
||||
if (sender instanceof CraftPlayer player) {
|
||||
return player.getHandle().createCommandSourceStack();
|
||||
}
|
||||
|
||||
return entity.getHandle().createCommandSourceStackForNameResolution((WorldServer) entity.getHandle().level());
|
||||
|
|
Loading…
Reference in a new issue