mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 12:06:41 +00:00
Added a new Location and added Entity.getLocation().
This commit is contained in:
@ -19,17 +19,12 @@
|
||||
|
||||
package com.sk89q.worldedit.bukkit;
|
||||
|
||||
import com.sk89q.worldedit.*;
|
||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.sk89q.worldedit.LocalPlayer;
|
||||
import com.sk89q.worldedit.LocalWorld;
|
||||
import com.sk89q.worldedit.PlayerNeededException;
|
||||
import com.sk89q.worldedit.ServerInterface;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.WorldVector;
|
||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||
|
||||
public class BukkitCommandSender extends LocalPlayer {
|
||||
private CommandSender sender;
|
||||
private WorldEditPlugin plugin;
|
||||
@ -97,6 +92,11 @@ public class BukkitCommandSender extends LocalPlayer {
|
||||
throw new PlayerNeededException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getLocation() {
|
||||
throw new PlayerNeededException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldVector getPosition() {
|
||||
throw new PlayerNeededException();
|
||||
|
@ -21,6 +21,7 @@ package com.sk89q.worldedit.bukkit;
|
||||
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.util.Vectors;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -168,4 +169,12 @@ public class BukkitPlayer extends LocalPlayer {
|
||||
setPosition(new Vector(x + 0.5, y, z + 0.5));
|
||||
player.setFlying(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public com.sk89q.worldedit.util.Location getLocation() {
|
||||
Location nativeLocation = player.getLocation();
|
||||
Vector position = BukkitUtil.toVector(nativeLocation);
|
||||
Vector direction = Vectors.fromEulerDeg(nativeLocation.getYaw(), nativeLocation.getPitch());
|
||||
return new com.sk89q.worldedit.util.Location(getWorld(), position, direction);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user