Skip to content
Permalink
Browse files

Force non-Locatable actors to use placeAtPos1

  • Loading branch information...
kenzierocks committed Sep 22, 2019
1 parent 44dc926 commit 6162a47002e26c72c37c9dc7ebe9d7030f722bd1
@@ -521,6 +521,14 @@ public BlockVector3 getPlacementPosition(Actor actor) throws IncompleteRegionExc
return selector.getPrimaryPosition();
}

public void setPlaceAtPos1(boolean placeAtPos1) {
this.placeAtPos1 = placeAtPos1;
}

public boolean isPlaceAtPos1() {
return placeAtPos1;
}

/**
* Toggle placement position.
*
@@ -34,6 +34,7 @@
import com.sk89q.worldedit.command.tool.Tool;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.event.platform.ConfigurationLoadEvent;
import com.sk89q.worldedit.extension.platform.Locatable;
import com.sk89q.worldedit.session.request.Request;
import com.sk89q.worldedit.session.storage.JsonFileSessionStore;
import com.sk89q.worldedit.session.storage.SessionStore;
@@ -199,6 +200,11 @@ public synchronized LocalSession get(SessionOwner owner) {
&& (owner.hasPermission("worldedit.inventory.unrestricted")
|| (config.useInventoryCreativeOverride && (!(owner instanceof Player) || ((Player) owner).getGameMode() == GameModes.CREATIVE)))));

// Force non-locatable actors to use placeAtPos1
if (!(owner instanceof Locatable)) {
session.setPlaceAtPos1(true);
}

return session;
}

0 comments on commit 6162a47

Please sign in to comment.
You can’t perform that action at this time.