geforkt von Mirrors/FastAsyncWorldEdit
Fix setPosition
Dieser Commit ist enthalten in:
Ursprung
0afae082c2
Commit
501992dd20
@ -28,6 +28,7 @@ import com.sk89q.worldedit.blocks.BaseItemStack;
|
|||||||
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
|
import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter;
|
||||||
import com.sk89q.worldedit.entity.BaseEntity;
|
import com.sk89q.worldedit.entity.BaseEntity;
|
||||||
import com.sk89q.worldedit.extension.platform.AbstractPlayerActor;
|
import com.sk89q.worldedit.extension.platform.AbstractPlayerActor;
|
||||||
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||||
import com.sk89q.worldedit.internal.cui.CUIEvent;
|
import com.sk89q.worldedit.internal.cui.CUIEvent;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
@ -162,6 +163,16 @@ public class BukkitPlayer extends AbstractPlayerActor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPosition(Vector3 pos, float pitch, float yaw) {
|
public void setPosition(Vector3 pos, float pitch, float yaw) {
|
||||||
|
if (pos instanceof com.sk89q.worldedit.util.Location) {
|
||||||
|
com.sk89q.worldedit.util.Location loc = (com.sk89q.worldedit.util.Location) pos;
|
||||||
|
Extent extent = loc.getExtent();
|
||||||
|
if (extent instanceof World) {
|
||||||
|
org.bukkit.World world = Bukkit.getWorld(((World) extent).getName());
|
||||||
|
System.out.println("Teleport to world " + world);
|
||||||
|
player.teleport(new Location(world, pos.getX(), pos.getY(),
|
||||||
|
pos.getZ(), yaw, pitch));
|
||||||
|
}
|
||||||
|
}
|
||||||
player.teleport(new Location(player.getWorld(), pos.getX(), pos.getY(),
|
player.teleport(new Location(player.getWorld(), pos.getX(), pos.getY(),
|
||||||
pos.getZ(), yaw, pitch));
|
pos.getZ(), yaw, pitch));
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable {
|
|||||||
if (y - 1 != origY) {
|
if (y - 1 != origY) {
|
||||||
final BlockVector3 pos = BlockVector3.at(x, y - 2, z);
|
final BlockVector3 pos = BlockVector3.at(x, y - 2, z);
|
||||||
final BlockStateHolder state = world.getBlock(pos);
|
final BlockStateHolder state = world.getBlock(pos);
|
||||||
setPosition(Vector3.at(x + 0.5, y - 2 + BlockTypeUtil.centralTopLimit(state), z + 0.5));
|
setPosition(new Location(world, Vector3.at(x + 0.5, y - 2 + BlockTypeUtil.centralTopLimit(state), z + 0.5)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -139,7 +139,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable {
|
|||||||
final BlockVector3 pos = BlockVector3.at(x, y, z);
|
final BlockVector3 pos = BlockVector3.at(x, y, z);
|
||||||
final BlockState id = world.getBlock(pos);
|
final BlockState id = world.getBlock(pos);
|
||||||
if (id.getBlockType().getMaterial().isMovementBlocker()) {
|
if (id.getBlockType().getMaterial().isMovementBlocker()) {
|
||||||
setPosition(Vector3.at(x + 0.5, y + + BlockTypeUtil.centralTopLimit(id), z + 0.5));
|
setPosition(new Location(world, Vector3.at(x + 0.5, y + + BlockTypeUtil.centralTopLimit(id), z + 0.5)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren