mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-15 23:26:16 +01:00
Tweak entity head yaw code
This commit is contained in:
parent
71ad607732
commit
831cb4a5d8
@ -282,7 +282,6 @@ public class EnderDragonController extends MobEntityController {
|
||||
}
|
||||
|
||||
private static final MethodHandle HURT = NMS.getMethodHandle(EnderDragon.class, "c", true, List.class);
|
||||
|
||||
private static final MethodHandle KNOCKBACK = NMS.getMethodHandle(EnderDragon.class, "b", true, List.class);
|
||||
}
|
||||
}
|
||||
|
@ -62,6 +62,12 @@ public class CitizensEntityTracker extends ChunkMap.TrackedEntity {
|
||||
if (tracker.isRemoved() || tracker.getBukkitEntity().getType() != EntityType.PLAYER)
|
||||
return;
|
||||
final ServerPlayer entityplayer = lastUpdatedPlayer;
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), () -> {
|
||||
if (tracker.isRemoved() || entityplayer.isRemoved())
|
||||
return;
|
||||
NMSImpl.sendPacket(entityplayer.getBukkitEntity(),
|
||||
new ClientboundRotateHeadPacket(tracker, (byte) (tracker.getYHeadRot() * 256.0F / 360.0F)));
|
||||
}, Setting.TABLIST_REMOVE_PACKET_DELAY.asTicks() + 1);
|
||||
boolean sendTabRemove = NMS.sendTabListAdd(entityplayer.getBukkitEntity(), (Player) tracker.getBukkitEntity());
|
||||
if (!sendTabRemove || !Setting.DISABLE_TABLIST.asBoolean()) {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(),
|
||||
@ -70,10 +76,10 @@ public class CitizensEntityTracker extends ChunkMap.TrackedEntity {
|
||||
return;
|
||||
}
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), () -> {
|
||||
NMSImpl.sendPacket(entityplayer.getBukkitEntity(),
|
||||
new ClientboundRotateHeadPacket(tracker, (byte) (tracker.getYHeadRot() * 256.0F / 360.0F)));
|
||||
NMSImpl.sendPacket(entityplayer.getBukkitEntity(), new ClientboundAnimatePacket(tracker, 0));
|
||||
if (tracker.isRemoved() || entityplayer.isRemoved())
|
||||
return;
|
||||
NMS.sendTabListRemove(entityplayer.getBukkitEntity(), (Player) tracker.getBukkitEntity());
|
||||
NMSImpl.sendPacket(entityplayer.getBukkitEntity(), new ClientboundAnimatePacket(tracker, 0));
|
||||
}, Setting.TABLIST_REMOVE_PACKET_DELAY.asTicks());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user