Skip to content

Commit

Permalink
fix null uuids breaking npc spawning (fixes #47)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrbu committed May 11, 2023
1 parent 33bee78 commit 21638dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/github/znetworkw/znpcservers/npc/NPC.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public synchronized void spawn(ZUser user) {
ServerVersion version = PacketEvents.getAPI().getServerManager().getVersion();
EntityType type = SpigotConversionUtil.fromBukkitEntityType(((Entity) bukkitEntity).getType());
if (version.isNewerThanOrEquals(ServerVersion.V_1_14)) PacketEvents.getAPI().getPlayerManager().sendPacket(
player, new WrapperPlayServerSpawnEntity(entityID, Optional.of(uuid), type, location.toVector3d(),
player, new WrapperPlayServerSpawnEntity(entityID, Optional.ofNullable(uuid), type, location.toVector3d(),
location.getPitch(), location.getYaw(), location.getYaw(), 0, Optional.empty()));
else PacketEvents.getAPI().getPlayerManager().sendPacket(player, new WrapperPlayServerSpawnLivingEntity(
entityID, uuid, type, location.toVector3d(), location.getYaw(), location.getPitch(),
Expand Down

0 comments on commit 21638dd

Please sign in to comment.