2011-01-01 18:33:18 +00:00
|
|
|
/*
|
2014-04-04 22:03:18 +00:00
|
|
|
* WorldEdit, a Minecraft world manipulation toolkit
|
|
|
|
* Copyright (C) sk89q <http://www.sk89q.com>
|
|
|
|
* Copyright (C) WorldEdit team and contributors
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2014-04-04 22:03:18 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU Lesser General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or
|
2011-01-01 18:33:18 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2014-04-04 22:03:18 +00:00
|
|
|
* 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 Lesser General Public License
|
|
|
|
* for more details.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2014-04-04 22:03:18 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
2011-01-01 18:33:18 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2014-04-04 22:03:18 +00:00
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
|
|
|
|
package com.sk89q.worldedit;
|
|
|
|
|
|
|
|
/**
|
2014-07-29 14:57:45 +00:00
|
|
|
* @deprecated Replace all uses of {@link WorldVector}s with {@link Location}s
|
2011-01-01 18:33:18 +00:00
|
|
|
*/
|
2014-07-29 14:57:45 +00:00
|
|
|
@SuppressWarnings("deprecation")
|
|
|
|
@Deprecated
|
2011-01-01 18:33:18 +00:00
|
|
|
public class BlockWorldVector extends WorldVector {
|
2014-07-29 14:57:45 +00:00
|
|
|
|
2011-01-01 18:33:18 +00:00
|
|
|
/**
|
2014-07-29 14:57:45 +00:00
|
|
|
* Construct an instance from another instance.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2014-07-29 14:57:45 +00:00
|
|
|
* @param position the position to copy
|
2011-01-01 18:33:18 +00:00
|
|
|
*/
|
2014-07-29 14:57:45 +00:00
|
|
|
public BlockWorldVector(WorldVector position) {
|
|
|
|
super(position.getWorld(), position);
|
2011-01-01 18:33:18 +00:00
|
|
|
}
|
2011-11-23 01:29:48 +00:00
|
|
|
|
2011-01-01 18:33:18 +00:00
|
|
|
/**
|
2014-07-29 14:57:45 +00:00
|
|
|
* Construct an instance from another instance.
|
2011-01-01 18:33:18 +00:00
|
|
|
*
|
2014-07-29 14:57:45 +00:00
|
|
|
* @param world the world
|
|
|
|
* @param position the position to copy
|
2011-01-01 18:33:18 +00:00
|
|
|
*/
|
2014-07-29 14:57:45 +00:00
|
|
|
public BlockWorldVector(LocalWorld world, Vector position) {
|
|
|
|
super(world, position);
|
2011-01-01 18:33:18 +00:00
|
|
|
}
|
|
|
|
|
2011-05-11 04:55:07 +00:00
|
|
|
/**
|
2014-07-29 14:57:45 +00:00
|
|
|
* Construct a new instance.
|
|
|
|
*
|
|
|
|
* @param world another instance
|
|
|
|
* @param x the X coordinate
|
|
|
|
* @param y the Y coordinate
|
|
|
|
* @param z the Z coordinate
|
2011-05-11 04:55:07 +00:00
|
|
|
*/
|
|
|
|
public BlockWorldVector(WorldVector world, int x, int y, int z) {
|
|
|
|
super(world.getWorld(), x, y, z);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-07-29 14:57:45 +00:00
|
|
|
* Construct a new instance.
|
|
|
|
*
|
|
|
|
* @param world another instance
|
|
|
|
* @param v the other vector
|
2011-05-11 04:55:07 +00:00
|
|
|
*/
|
|
|
|
public BlockWorldVector(WorldVector world, Vector v) {
|
2011-05-27 21:01:15 +00:00
|
|
|
super(world.getWorld(), v.getX(), v.getY(), v.getZ());
|
2011-05-11 04:55:07 +00:00
|
|
|
}
|
|
|
|
|
2011-01-01 18:33:18 +00:00
|
|
|
/**
|
2014-07-29 14:57:45 +00:00
|
|
|
* Construct a new instance.
|
|
|
|
*
|
|
|
|
* @param world a world
|
|
|
|
* @param x the X coordinate
|
|
|
|
* @param y the Y coordinate
|
|
|
|
* @param z the Z coordinate
|
2011-01-01 18:33:18 +00:00
|
|
|
*/
|
|
|
|
public BlockWorldVector(LocalWorld world, int x, int y, int z) {
|
|
|
|
super(world, x, y, z);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-07-29 14:57:45 +00:00
|
|
|
* Construct a new instance.
|
|
|
|
*
|
|
|
|
* @param world a world
|
|
|
|
* @param x the X coordinate
|
|
|
|
* @param y the Y coordinate
|
|
|
|
* @param z the Z coordinate
|
2011-01-01 18:33:18 +00:00
|
|
|
*/
|
|
|
|
public BlockWorldVector(LocalWorld world, float x, float y, float z) {
|
|
|
|
super(world, x, y, z);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-07-29 14:57:45 +00:00
|
|
|
* Construct a new instance.
|
|
|
|
*
|
|
|
|
* @param world a world
|
|
|
|
* @param x the X coordinate
|
|
|
|
* @param y the Y coordinate
|
|
|
|
* @param z the Z coordinate
|
2011-01-01 18:33:18 +00:00
|
|
|
*/
|
|
|
|
public BlockWorldVector(LocalWorld world, double x, double y, double z) {
|
|
|
|
super(world, x, y, z);
|
|
|
|
}
|
2011-11-23 01:29:48 +00:00
|
|
|
|
2011-01-01 18:33:18 +00:00
|
|
|
@Override
|
|
|
|
public boolean equals(Object obj) {
|
2013-08-05 17:58:53 +00:00
|
|
|
if (!(obj instanceof Vector)) {
|
2011-01-01 18:33:18 +00:00
|
|
|
return false;
|
|
|
|
}
|
2013-08-05 17:58:53 +00:00
|
|
|
Vector other = (Vector) obj;
|
2011-11-23 01:29:48 +00:00
|
|
|
return (int) other.getX() == (int) this.x && (int) other.getY() == (int) this.y
|
|
|
|
&& (int) other.getZ() == (int) this.z;
|
2011-01-01 18:33:18 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int hashCode() {
|
2011-11-23 01:29:48 +00:00
|
|
|
return (Integer.valueOf((int) x).hashCode() << 19) ^
|
|
|
|
(Integer.valueOf((int) y).hashCode() << 12) ^
|
|
|
|
Integer.valueOf((int) z).hashCode();
|
2011-01-01 18:33:18 +00:00
|
|
|
}
|
2014-07-29 14:57:45 +00:00
|
|
|
|
2011-01-01 18:33:18 +00:00
|
|
|
}
|