#1181: Consolidate Location conversion code
By: Doc <nachito94@msn.com>
This commit is contained in:
@@ -190,6 +190,7 @@ import org.bukkit.craftbukkit.tag.CraftFluidTag;
|
||||
import org.bukkit.craftbukkit.tag.CraftItemTag;
|
||||
import org.bukkit.craftbukkit.util.CraftChatMessage;
|
||||
import org.bukkit.craftbukkit.util.CraftIconCache;
|
||||
import org.bukkit.craftbukkit.util.CraftLocation;
|
||||
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
import org.bukkit.craftbukkit.util.CraftSpawnCategory;
|
||||
@@ -1568,7 +1569,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
WorldServer worldServer = ((CraftWorld) world).getHandle();
|
||||
Location structureLocation = world.locateNearestStructure(location, structureType, radius, findUnexplored);
|
||||
BlockPosition structurePosition = new BlockPosition(structureLocation.getBlockX(), structureLocation.getBlockY(), structureLocation.getBlockZ());
|
||||
BlockPosition structurePosition = CraftLocation.toBlockPosition(structureLocation);
|
||||
|
||||
// Create map with trackPlayer = true, unlimitedTracking = true
|
||||
net.minecraft.world.item.ItemStack stack = ItemWorldMap.create(worldServer, structurePosition.getX(), structurePosition.getZ(), MapView.Scale.NORMAL.getValue(), true, true);
|
||||
@@ -1967,7 +1968,7 @@ public final class CraftServer implements Server {
|
||||
if (pos == null) {
|
||||
completions = getCommandMap().tabComplete(player, message);
|
||||
} else {
|
||||
completions = getCommandMap().tabComplete(player, message, new Location(world.getWorld(), pos.x, pos.y, pos.z));
|
||||
completions = getCommandMap().tabComplete(player, message, CraftLocation.toBukkit(pos, world.getWorld()));
|
||||
}
|
||||
} catch (CommandException ex) {
|
||||
player.sendMessage(ChatColor.RED + "An internal error occurred while attempting to tab-complete this command");
|
||||
|
||||
Reference in New Issue
Block a user