mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-29 23:17:59 +02:00
removed duplicating code piece
This commit is contained in:
parent
23ee4c7fdf
commit
6192d1fead
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user