Cleaned up some code, changed WorldEdit to be world-aware (finally).
This commit is contained in:
104
src/com/sk89q/worldedit/WorldVector.java
Normal file
104
src/com/sk89q/worldedit/WorldVector.java
Normal file
@@ -0,0 +1,104 @@
|
||||
// $Id$
|
||||
/*
|
||||
* WorldEdit
|
||||
* Copyright (C) 2010 sk89q <http://www.sk89q.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit;
|
||||
|
||||
/**
|
||||
* A vector with a world component.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class WorldVector extends Vector {
|
||||
/**
|
||||
* Represents the world.
|
||||
*/
|
||||
private LocalWorld world;
|
||||
|
||||
/**
|
||||
* Construct the Vector object.
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
*/
|
||||
public WorldVector(LocalWorld world, double x, double y, double z) {
|
||||
super(x, y, z);
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct the Vector object.
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
*/
|
||||
public WorldVector(LocalWorld world, int x, int y, int z) {
|
||||
super(x, y, z);
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct the Vector object.
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
*/
|
||||
public WorldVector(LocalWorld world, float x, float y, float z) {
|
||||
super(x, y, z);
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct the Vector object.
|
||||
*
|
||||
* @param pt
|
||||
*/
|
||||
public WorldVector(LocalWorld world, Vector pt) {
|
||||
super(pt);
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct the Vector object.
|
||||
*/
|
||||
public WorldVector(LocalWorld world) {
|
||||
super();
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the world.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public LocalWorld getWorld() {
|
||||
return world;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a BlockVector version.
|
||||
*
|
||||
* @return BlockWorldVector
|
||||
*/
|
||||
public BlockWorldVector toWorldBlockVector() {
|
||||
return new BlockWorldVector(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user