mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-22 09:07:56 +01:00
Fix interaction height on 1.19.4
This commit is contained in:
parent
219e016ee7
commit
3370fdde5d
@ -636,7 +636,7 @@ public class HologramTrait extends Trait {
|
||||
public void onSeenByPlayer(NPC npc, Player player) {
|
||||
if (lastOffset == null)
|
||||
return;
|
||||
NMS.linkTextInteraction(player, hologram.getEntity(), npc.getEntity(), lastOffset.y);
|
||||
NMS.positionInteractionText(player, hologram.getEntity(), npc.getEntity(), lastOffset.y);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -689,8 +689,8 @@ public class NMS {
|
||||
return BRIDGE.isValid(entity);
|
||||
}
|
||||
|
||||
public static void linkTextInteraction(Player player, Entity interaction, Entity mount, double height) {
|
||||
BRIDGE.linkTextInteraction(player, interaction, mount, height);
|
||||
public static void positionInteractionText(Player player, Entity interaction, Entity mount, double height) {
|
||||
BRIDGE.positionInteractionText(player, interaction, mount, height);
|
||||
}
|
||||
|
||||
public static void load(CommandManager commands) {
|
||||
|
@ -150,7 +150,7 @@ public interface NMSBridge {
|
||||
|
||||
public boolean isValid(Entity entity);
|
||||
|
||||
public default void linkTextInteraction(Player player, Entity interaction, Entity mount, double height) {
|
||||
public default void positionInteractionText(Player player, Entity interaction, Entity mount, double height) {
|
||||
}
|
||||
|
||||
public void load(CommandManager commands);
|
||||
|
@ -720,7 +720,7 @@ public class NMSImpl implements NMSBridge {
|
||||
|
||||
@Override
|
||||
public float getRidingHeightOffset(org.bukkit.entity.Entity entity, org.bukkit.entity.Entity mount) {
|
||||
return (float) (getHandle(mount).getPassengersRidingOffset() - 0.5D);
|
||||
return (float) (getHandle(mount).getPassengersRidingOffset());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -935,9 +935,9 @@ public class NMSImpl implements NMSBridge {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void linkTextInteraction(org.bukkit.entity.Player player, org.bukkit.entity.Entity entity,
|
||||
public void positionInteractionText(org.bukkit.entity.Player player, org.bukkit.entity.Entity entity,
|
||||
org.bukkit.entity.Entity mount, double offset) {
|
||||
offset += -0.9 + getHandle(mount).getPassengersRidingOffset();
|
||||
offset += getRidingHeightOffset(entity, mount) + 0.5;
|
||||
sendPacket(player,
|
||||
new ClientboundBundlePacket(List.of(
|
||||
new ClientboundSetEntityDataPacket(entity.getEntityId(),
|
||||
|
@ -912,7 +912,7 @@ public class NMSImpl implements NMSBridge {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void linkTextInteraction(org.bukkit.entity.Player player, org.bukkit.entity.Entity entity,
|
||||
public void positionInteractionText(org.bukkit.entity.Player player, org.bukkit.entity.Entity entity,
|
||||
org.bukkit.entity.Entity mount, double offset) {
|
||||
offset += getRidingHeightOffset(entity, mount);
|
||||
sendPacket(player,
|
||||
|
@ -891,7 +891,7 @@ public class NMSImpl implements NMSBridge {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void linkTextInteraction(org.bukkit.entity.Player player, org.bukkit.entity.Entity entity,
|
||||
public void positionInteractionText(org.bukkit.entity.Player player, org.bukkit.entity.Entity entity,
|
||||
org.bukkit.entity.Entity mount, double offset) {
|
||||
offset += getRidingHeightOffset(entity, mount);
|
||||
sendPacket(player,
|
||||
|
Loading…
Reference in New Issue
Block a user