mirror of
https://github.com/YouHaveTrouble/BlockEdit.git
synced 2026-06-29 13:36:19 +00:00
fix rotate logic
This commit is contained in:
@@ -55,11 +55,12 @@ public class Clipboard {
|
||||
* @param angle angle in degrees
|
||||
*/
|
||||
public void rotate(double angle) {
|
||||
double radians = Math.toRadians(angle);
|
||||
for (Map.Entry<Vector, BlockState> entry : this.blocks.entrySet()) {
|
||||
Vector relativeLocation = entry.getKey();
|
||||
relativeLocation.rotateAroundY(angle);
|
||||
relativeLocation.setX((int)relativeLocation.getX());
|
||||
relativeLocation.setZ((int)relativeLocation.getZ());
|
||||
relativeLocation.rotateAroundY(radians);
|
||||
relativeLocation.setX(Math.round(relativeLocation.getX()));
|
||||
relativeLocation.setZ(Math.round(relativeLocation.getZ()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user