Force non-Locatable actors to use placeAtPos1

Dieser Commit ist enthalten in:
Kenzie Togami 2019-09-21 18:21:22 -07:00
Ursprung 44dc926c49
Commit 6162a47002
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 5D200B325E157A81
2 geänderte Dateien mit 14 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -521,6 +521,14 @@ public class LocalSession {
return selector.getPrimaryPosition();
}
public void setPlaceAtPos1(boolean placeAtPos1) {
this.placeAtPos1 = placeAtPos1;
}
public boolean isPlaceAtPos1() {
return placeAtPos1;
}
/**
* Toggle placement position.
*

Datei anzeigen

@ -34,6 +34,7 @@ import com.sk89q.worldedit.command.tool.SelectionWand;
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 class SessionManager {
&& (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;
}