13
0
geforkt von Mirrors/Paper

Add Raw Byte Entity Serialization

Dieser Commit ist enthalten in:
Mariell Hoversholm 2021-10-24 16:19:26 -04:00
Ursprung fbce8f41cc
Commit 65568bbe27
2 geänderte Dateien mit 35 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -169,6 +169,14 @@ public interface UnsafeValues {
ItemStack deserializeItem(byte[] data);
byte[] serializeEntity(org.bukkit.entity.Entity entity);
default org.bukkit.entity.Entity deserializeEntity(byte[] data, World world) {
return deserializeEntity(data, world, false);
}
org.bukkit.entity.Entity deserializeEntity(byte[] data, World world, boolean preserveUUID);
/**
* Creates and returns the next EntityId available.
* <p>

Datei anzeigen

@ -946,5 +946,32 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
@Deprecated
@NotNull Set<Player> getTrackedPlayers();
/**
* Spawns the entity in the world at the given {@link Location} with the default spawn reason.
* <p>
* This will not spawn the entity if the entity is already spawned or has previously been despawned.
* <p>
* Also, this method will fire the same events as a normal entity spawn.
*
* @param location The location to spawn the entity at.
* @return Whether the entity was successfully spawned.
*/
public default boolean spawnAt(@NotNull Location location) {
return spawnAt(location, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT);
}
/**
* Spawns the entity in the world at the given {@link Location} with the reason given.
* <p>
* This will not spawn the entity if the entity is already spawned or has previously been despawned.
* <p>
* Also, this method will fire the same events as a normal entity spawn.
*
* @param location The location to spawn the entity at.
* @param reason The reason for the entity being spawned.
* @return Whether the entity was successfully spawned.
*/
public boolean spawnAt(@NotNull Location location, @NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason);
// Paper end
}