removed duplicating code piece

This commit is contained in:
Konstantin Shandurenko 2021-02-25 14:40:14 +03:00
parent 23ee4c7fdf
commit 6192d1fead

View File

@ -128,9 +128,6 @@ public class Entity implements Viewable, EventHandler, DataContainer, Permission
this.entityType = entityType; this.entityType = entityType;
this.uuid = uuid; this.uuid = uuid;
this.position = new Position(); this.position = new Position();
this.lastX = this.position.getX();
this.lastY = this.position.getY();
this.lastZ = this.position.getZ();
setBoundingBox(entityType.getWidth(), entityType.getHeight(), entityType.getWidth()); setBoundingBox(entityType.getWidth(), entityType.getHeight(), entityType.getWidth());
@ -148,22 +145,11 @@ public class Entity implements Viewable, EventHandler, DataContainer, Permission
@Deprecated @Deprecated
public Entity(@NotNull EntityType entityType, @NotNull UUID uuid, @NotNull Position spawnPosition) { public Entity(@NotNull EntityType entityType, @NotNull UUID uuid, @NotNull Position spawnPosition) {
this.id = generateId(); this(entityType, uuid);
this.entityType = entityType; this.position.set(spawnPosition);
this.uuid = uuid;
this.position = spawnPosition.clone();
this.lastX = spawnPosition.getX(); this.lastX = spawnPosition.getX();
this.lastY = spawnPosition.getY(); this.lastY = spawnPosition.getY();
this.lastZ = spawnPosition.getZ(); this.lastZ = spawnPosition.getZ();
setBoundingBox(entityType.getWidth(), entityType.getHeight(), entityType.getWidth());
this.entityMeta = entityType.getMetaConstructor().apply(this, this.metadata);
setAutoViewable(true);
Entity.entityById.put(id, this);
Entity.entityByUuid.put(uuid, this);
} }
@Deprecated @Deprecated