mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Don't transform entity positions if the isIdentity() == true.
This commit is contained in:
parent
173f832352
commit
7257c7bb2b
@ -88,13 +88,19 @@ public class ExtentEntityCopy implements EntityFunction {
|
|||||||
public boolean apply(Entity entity) throws WorldEditException {
|
public boolean apply(Entity entity) throws WorldEditException {
|
||||||
BaseEntity state = entity.getState();
|
BaseEntity state = entity.getState();
|
||||||
if (state != null) {
|
if (state != null) {
|
||||||
|
Location newLocation;
|
||||||
|
|
||||||
|
if (!transform.isIdentity()) {
|
||||||
Location location = entity.getLocation();
|
Location location = entity.getLocation();
|
||||||
Vector newPosition = transform.apply(location.toVector().subtract(from));
|
Vector newPosition = transform.apply(location.toVector().subtract(from));
|
||||||
Vector newDirection = transform.apply(location.getDirection()).subtract(transform.apply(Vector.ZERO)).normalize();
|
Vector newDirection = transform.apply(location.getDirection()).subtract(transform.apply(Vector.ZERO)).normalize();
|
||||||
Location newLocation = new Location(destination, newPosition.add(to), newDirection);
|
newLocation = new Location(destination, newPosition.add(to), newDirection);
|
||||||
|
|
||||||
// Some entities store their position data in NBT
|
// Some entities store their position data in NBT
|
||||||
state = transformNbtData(state);
|
state = transformNbtData(state);
|
||||||
|
} else {
|
||||||
|
newLocation = entity.getLocation();
|
||||||
|
}
|
||||||
|
|
||||||
boolean success = destination.createEntity(newLocation, state) != null;
|
boolean success = destination.createEntity(newLocation, state) != null;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user