mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Changed the clipboard so it doesn't store min/max anymore, just origin and offset. Added /editrotate.
This commit is contained in:
28
src/com/sk89q/worldedit/EmptyClipboardException.java
Normal file
28
src/com/sk89q/worldedit/EmptyClipboardException.java
Normal file
@ -0,0 +1,28 @@
|
||||
// $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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Albert
|
||||
*/
|
||||
public class EmptyClipboardException extends WorldEditException {
|
||||
|
||||
}
|
@ -356,6 +356,29 @@ public class Vector {
|
||||
Math.pow(pt.z - z, 2));
|
||||
}
|
||||
|
||||
/**
|
||||
* 2D transformation.
|
||||
*
|
||||
* @param vec
|
||||
* @param angle in degrees
|
||||
* @param aboutX
|
||||
* @param aboutY
|
||||
* @param translateX
|
||||
* @param translateY
|
||||
* @return
|
||||
*/
|
||||
public Vector transform2D(double angle,
|
||||
double aboutX, double aboutZ, double translateX, double translateZ) {
|
||||
angle = Math.toRadians(angle);
|
||||
double x = this.x;
|
||||
double z = this.z;
|
||||
double x2 = x * Math.cos(angle) - z * Math.sin(angle);
|
||||
double z2 = x * Math.sin(angle) + z * Math.cos(angle);
|
||||
return new Vector(x2 + aboutX + translateX,
|
||||
y,
|
||||
z2 + aboutZ + translateZ);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a block point from a point.
|
||||
*
|
||||
|
Reference in New Issue
Block a user