aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/moe/ymc/acron/s2c/Entity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/moe/ymc/acron/s2c/Entity.java')
-rw-r--r--src/main/java/moe/ymc/acron/s2c/Entity.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/moe/ymc/acron/s2c/Entity.java b/src/main/java/moe/ymc/acron/s2c/Entity.java
index 97bd567..3e0add1 100644
--- a/src/main/java/moe/ymc/acron/s2c/Entity.java
+++ b/src/main/java/moe/ymc/acron/s2c/Entity.java
@@ -2,18 +2,25 @@ package moe.ymc.acron.s2c;
import com.google.gson.annotations.SerializedName;
import com.mojang.authlib.GameProfile;
+import moe.ymc.acron.common.Vec3d;
+import moe.ymc.acron.common.WorldKey;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.UUID;
public record Entity(@SerializedName("name") @NotNull String name,
- @SerializedName("uuid") @NotNull UUID uuid) {
+ @SerializedName("uuid") @NotNull UUID uuid,
+ @SerializedName("pos") @Nullable Vec3d pos,
+ @SerializedName("world") @Nullable WorldKey world) {
public Entity(@NotNull net.minecraft.entity.Entity entity) {
this(entity.getName().getString(),
- entity.getUuid());
+ entity.getUuid(),
+ new Vec3d(entity.getPos()),
+ WorldKey.create(entity.world.getRegistryKey().getValue()));
}
public Entity(@NotNull GameProfile profile) {
- this(profile.getName(), profile.getId());
+ this(profile.getName(), profile.getId(), null, null);
}
}