mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-16 03:14:04 +00:00
Refactor vector system to be cleaner
- Move Vector, etc. into `.math` package - Drop many methods that will be auto-promoted anyways, eg. with `divide(int)` and `divide(double)` the first is now gone. - Take Block vectors into their own class hierarchy - Make it clear throughout the API what takes blockvectors - many more improvements
This commit is contained in:
@@ -40,6 +40,7 @@ import com.sk89q.worldedit.extension.platform.PlatformManager;
|
||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.scripting.CraftScriptContext;
|
||||
import com.sk89q.worldedit.scripting.CraftScriptEngine;
|
||||
import com.sk89q.worldedit.scripting.RhinoCraftScriptEngine;
|
||||
@@ -370,7 +371,7 @@ public class WorldEdit {
|
||||
* @return a direction vector
|
||||
* @throws UnknownDirectionException thrown if the direction is not known
|
||||
*/
|
||||
public Vector getDirection(Player player, String dirStr) throws UnknownDirectionException {
|
||||
public BlockVector3 getDirection(Player player, String dirStr) throws UnknownDirectionException {
|
||||
dirStr = dirStr.toLowerCase();
|
||||
|
||||
final PlayerDirection dir = getPlayerDirection(player, dirStr);
|
||||
@@ -382,7 +383,7 @@ public class WorldEdit {
|
||||
case NORTH:
|
||||
case UP:
|
||||
case DOWN:
|
||||
return dir.vector();
|
||||
return dir.vector().toBlockPoint();
|
||||
|
||||
default:
|
||||
throw new UnknownDirectionException(dir.name());
|
||||
|
Reference in New Issue
Block a user