From 2fc44da2370ce845492d27f0c6af2fbf3c820cef Mon Sep 17 00:00:00 2001 From: strom <> Date: Mon, 17 Jun 2024 18:20:08 +0200 Subject: [PATCH] Code optimization --- core/src/main/java/org/geysermc/geyser/util/EntityUtils.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/util/EntityUtils.java b/core/src/main/java/org/geysermc/geyser/util/EntityUtils.java index 87de3b4ff..5b79f7158 100644 --- a/core/src/main/java/org/geysermc/geyser/util/EntityUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/EntityUtils.java @@ -154,9 +154,6 @@ public final class EntityUtils { * Adjust an entity's height if they have mounted/dismounted an entity. */ public static void updateMountOffset(Entity passenger, Entity mount, boolean rider, boolean riding, boolean moreThanOneEntity) { - if (passenger instanceof TextDisplayEntity textDisplay - && !textDisplay.hasTranslation()) return; - passenger.setFlag(EntityFlag.RIDING, riding); if (riding) { // Without the Y offset, Bedrock players will find themselves in the floor when mounting @@ -201,6 +198,8 @@ public final class EntityUtils { TextDisplayEntity textDisplay; if (passenger instanceof TextDisplayEntity) { textDisplay = (TextDisplayEntity) passenger; + if (!textDisplay.hasTranslation()) return; + xOffset = textDisplay.getTranslation().getX(); yOffset = textDisplay.getTranslation().getY() + 0.2f; zOffset = textDisplay.getTranslation().getZ();