mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-16 03:14:04 +00:00
Better enforce the Request lifetime.
Previously, the current request would just get a new EditSession when one was created. Now, a Request is reset before and after: - a command is used and - an interact is fired with the platform This means each action taken will get a single, non-reusable Request. Note that this only applies to actions taken through the platform. API users will not be using requests anyway, since things like Masks, etc. will be constructed directly instead of being passed through the platform's parsers and so on. (e.g. if a plugin loads a schematic into the world with a mask, they should create the EditSession and mask it directly, and not use that Mask again for another EditSession in another World). Also, get rid of a bunch of (some now-)unnecessary EditSession creation during command dispatching. Note that this also fixed the dynamic selection mask, which apparently has been broken for some unknown amount of time.
This commit is contained in:
@@ -26,9 +26,7 @@ import com.sk89q.minecraft.util.commands.Command;
|
||||
import com.sk89q.minecraft.util.commands.CommandContext;
|
||||
import com.sk89q.minecraft.util.commands.CommandPermissions;
|
||||
import com.sk89q.minecraft.util.commands.Logging;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
@@ -121,7 +119,7 @@ public class NavigationCommands {
|
||||
)
|
||||
@CommandPermissions("worldedit.navigation.ceiling")
|
||||
@Logging(POSITION)
|
||||
public void ceiling(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
||||
public void ceiling(Player player, CommandContext args) throws WorldEditException {
|
||||
|
||||
final int clearance = args.argsLength() > 0 ?
|
||||
Math.max(0, args.getInteger(0)) : 0;
|
||||
@@ -142,7 +140,7 @@ public class NavigationCommands {
|
||||
max = 0
|
||||
)
|
||||
@CommandPermissions("worldedit.navigation.thru.command")
|
||||
public void thru(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
||||
public void thru(Player player) throws WorldEditException {
|
||||
if (player.passThroughForwardWall(6)) {
|
||||
player.print("Whoosh!");
|
||||
} else {
|
||||
@@ -158,7 +156,7 @@ public class NavigationCommands {
|
||||
max = 0
|
||||
)
|
||||
@CommandPermissions("worldedit.navigation.jumpto.command")
|
||||
public void jumpTo(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
||||
public void jumpTo(Player player) throws WorldEditException {
|
||||
|
||||
Location pos = player.getSolidBlockTrace(300);
|
||||
if (pos != null) {
|
||||
@@ -179,7 +177,7 @@ public class NavigationCommands {
|
||||
)
|
||||
@CommandPermissions("worldedit.navigation.up")
|
||||
@Logging(POSITION)
|
||||
public void up(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {
|
||||
public void up(Player player, CommandContext args) throws WorldEditException {
|
||||
final int distance = args.getInteger(0);
|
||||
|
||||
final boolean alwaysGlass = getAlwaysGlass(args);
|
||||
|
Reference in New Issue
Block a user