diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/paper-server/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java index 9464b04103..fb9656e077 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java @@ -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());