|
15 | 15 | import net.minecraft.network.syncher.SynchedEntityData; |
16 | 16 | import net.minecraft.server.MinecraftServer; |
17 | 17 | import net.minecraft.server.level.ClientInformation; |
| 18 | +import net.minecraft.server.level.ServerEntity; |
18 | 19 | import net.minecraft.server.level.ServerLevel; |
19 | 20 | import net.minecraft.server.level.ServerPlayer; |
20 | 21 | import net.minecraft.server.network.ServerGamePacketListenerImpl; |
|
26 | 27 | import net.pascalpex.npc.NpcData; |
27 | 28 | import org.apache.commons.lang.Validate; |
28 | 29 | import org.bukkit.*; |
29 | | -import org.bukkit.craftbukkit.v1_20_R4.CraftServer; |
30 | | -import org.bukkit.craftbukkit.v1_20_R4.CraftWorld; |
31 | | -import org.bukkit.craftbukkit.v1_20_R4.entity.CraftPlayer; |
32 | | -import org.bukkit.craftbukkit.v1_20_R4.inventory.CraftItemStack; |
| 30 | +import org.bukkit.craftbukkit.v1_21_R1.CraftServer; |
| 31 | +import org.bukkit.craftbukkit.v1_21_R1.CraftWorld; |
| 32 | +import org.bukkit.craftbukkit.v1_21_R1.entity.CraftPlayer; |
| 33 | +import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftItemStack; |
33 | 34 | import org.bukkit.entity.Player; |
34 | 35 | import org.bukkit.inventory.ItemStack; |
35 | 36 | import org.bukkit.scheduler.BukkitRunnable; |
@@ -230,7 +231,7 @@ public static void addNPCPacket(ServerPlayer npc, String suffix) { |
230 | 231 | if (player.getWorld().equals(worldMap.get(npc.getId()))) { |
231 | 232 | ServerGamePacketListenerImpl connection = ((CraftPlayer) player).getHandle().connection; |
232 | 233 | connection.send(createInitPacket(npc)); |
233 | | - connection.send(new ClientboundAddEntityPacket(npc)); |
| 234 | + connection.send(new ClientboundAddEntityPacket(npc, 0, npc.blockPosition())); |
234 | 235 | connection.send(new ClientboundRotateHeadPacket(npc, (byte) (NpcData.getLocation(getID(npc)).getYaw() * 256f / 360f))); |
235 | 236 | Scoreboard scoreboard = new Scoreboard(); |
236 | 237 | PlayerTeam team = new PlayerTeam(scoreboard, npc.getUUID().toString()); |
@@ -265,7 +266,7 @@ public static void addJoinPacket(Player player) { |
265 | 266 | ServerGamePacketListenerImpl connection = ((CraftPlayer) player).getHandle().connection; |
266 | 267 | connection.send(createInitPacket(npc)); |
267 | 268 | connection.send(new ClientboundEntityEventPacket(npc, (byte) 1)); |
268 | | - connection.send(new ClientboundAddEntityPacket(npc)); |
| 269 | + connection.send(new ClientboundAddEntityPacket(npc, 0, npc.blockPosition())); |
269 | 270 | connection.send(new ClientboundRotateHeadPacket(npc, (byte) (NpcData.getLocation(getID(npc)).getYaw() * 256f / 360f))); |
270 | 271 | Scoreboard scoreboard = new Scoreboard(); |
271 | 272 | PlayerTeam team = new PlayerTeam(scoreboard, npc.getUUID().toString()); |
|
0 commit comments