use unmasked player location for scripting

This commit is contained in:
Jesse Boyd 2016-12-13 15:01:05 +11:00
parent 23cb3642f1
commit abb6588c24
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.wrappers.LocationMaskedPlayerWrapper;
import com.sk89q.minecraft.util.commands.Command; import com.sk89q.minecraft.util.commands.Command;
import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandContext;
import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.CommandPermissions;
@ -68,7 +69,7 @@ public class ScriptingCommands {
final File dir = this.worldEdit.getWorkingDirectoryFile(this.worldEdit.getConfiguration().scriptsDir); final File dir = this.worldEdit.getWorkingDirectoryFile(this.worldEdit.getConfiguration().scriptsDir);
final File f = this.worldEdit.getSafeOpenFile(player, dir, name, "js", "js"); final File f = this.worldEdit.getSafeOpenFile(player, dir, name, "js", "js");
try { try {
ScriptingCommands.this.worldEdit.runScript(player, f, scriptArgs); ScriptingCommands.this.worldEdit.runScript(LocationMaskedPlayerWrapper.unwrap(player), f, scriptArgs);
} catch (final WorldEditException ex) { } catch (final WorldEditException ex) {
player.printError("Error while executing CraftScript."); player.printError("Error while executing CraftScript.");
} }
@ -96,7 +97,7 @@ public class ScriptingCommands {
final File f = this.worldEdit.getSafeOpenFile(player, dir, lastScript, "js", "js"); final File f = this.worldEdit.getSafeOpenFile(player, dir, lastScript, "js", "js");
try { try {
ScriptingCommands.this.worldEdit.runScript(player, f, scriptArgs); ScriptingCommands.this.worldEdit.runScript(LocationMaskedPlayerWrapper.unwrap(player), f, scriptArgs);
} catch (final WorldEditException ex) { } catch (final WorldEditException ex) {
player.printError("Error while executing CraftScript."); player.printError("Error while executing CraftScript.");
} }