mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-13 15:20:10 +01:00
New constructor to give UUID as argument in LivingEntity, now used to specify player UUID
This commit is contained in:
parent
da3a8b17b2
commit
8a992b3e45
@ -75,10 +75,26 @@ public abstract class LivingEntity extends Entity implements EquipmentHandler {
|
||||
setGravity(0.02f, 0.08f, 3.92f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor which allows to specify an UUID. Only use if you know what you are doing!
|
||||
*/
|
||||
public LivingEntity(@NotNull EntityType entityType, @NotNull UUID uuid, @NotNull Position spawnPosition) {
|
||||
super(entityType, uuid, spawnPosition);
|
||||
setupAttributes();
|
||||
setGravity(0.02f, 0.08f, 3.92f);
|
||||
}
|
||||
|
||||
public LivingEntity(@NotNull EntityType entityType) {
|
||||
this(entityType, new Position());
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor which allows to specify an UUID. Only use if you know what you are doing!
|
||||
*/
|
||||
public LivingEntity(@NotNull EntityType entityType, @NotNull UUID uuid) {
|
||||
this(entityType, uuid, new Position());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(long time) {
|
||||
if (isOnFire()) {
|
||||
|
@ -196,8 +196,7 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
private final PlayerTickEvent playerTickEvent = new PlayerTickEvent(this);
|
||||
|
||||
public Player(@NotNull UUID uuid, @NotNull String username, @NotNull PlayerConnection playerConnection) {
|
||||
super(EntityType.PLAYER);
|
||||
this.uuid = uuid; // Override Entity#uuid defined in the constructor
|
||||
super(EntityType.PLAYER, uuid);
|
||||
this.username = username;
|
||||
this.playerConnection = playerConnection;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user