commanding-pipeline diff

This commit is contained in:
Jesse Boyd
2019-10-23 05:23:52 +01:00
parent fb91456bdd
commit 2080e9786b
193 changed files with 5449 additions and 3491 deletions

View File

@@ -20,6 +20,8 @@
package com.sk89q.worldedit.extension.platform;
import static com.google.common.base.Preconditions.checkNotNull;
import com.boydti.fawe.wrappers.PlayerWrapper;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.entity.BaseEntity;
@@ -48,6 +50,10 @@ public class PlayerProxy extends AbstractPlayerActor {
private final World world;
private Vector3 offset = Vector3.ZERO;
public PlayerProxy(Player player) {
this(player, player, player, player.getWorld());
}
public PlayerProxy(Player basePlayer, Actor permActor, Actor cuiActor, World world) {
checkNotNull(basePlayer);
checkNotNull(permActor);
@@ -59,6 +65,13 @@ public class PlayerProxy extends AbstractPlayerActor {
this.world = world;
}
public static Player unwrap(Player player) {
if (player instanceof PlayerProxy) {
return unwrap(((PlayerProxy) player).getBasePlayer());
}
return player;
}
public void setOffset(Vector3 position) {
this.offset = position;
}
@@ -121,7 +134,7 @@ public class PlayerProxy extends AbstractPlayerActor {
@Override
public World getWorld() {
return world;
return world == null ? basePlayer.getWorld() : world;
}
@Override