Add Raw Byte Entity Serialization

== AT ==
public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V
This commit is contained in:
Mariell Hoversholm
2021-10-24 16:20:31 -04:00
parent ef5b6401b3
commit 33aad47ee1
3 changed files with 115 additions and 64 deletions

View File

@@ -1083,6 +1083,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
// Paper end - tracked players API
// Paper start - raw entity serialization API
@Override
public boolean spawnAt(Location location, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
Preconditions.checkNotNull(location, "location cannot be null");
Preconditions.checkNotNull(reason, "reason cannot be null");
this.entity.setLevel(((CraftWorld) location.getWorld()).getHandle());
this.entity.setPos(location.getX(), location.getY(), location.getZ());
this.entity.setRot(location.getYaw(), location.getPitch());
return !this.entity.valid && this.entity.level().addFreshEntity(this.entity, reason);
}
// Paper end - raw entity serialization API
// Paper start - missing entity api
@Override
public boolean isInvisible() { // Paper - moved up from LivingEntity