From 2cce5278684259385770fdaed012573040aac90f Mon Sep 17 00:00:00 2001 From: strom <> Date: Mon, 17 Jun 2024 18:24:29 +0200 Subject: [PATCH] Code optimization #2 --- core/src/main/java/org/geysermc/geyser/util/EntityUtils.java | 4 +--- 1 file changed, 1 insertion(+), 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 5b79f7158..87cae2e66 100644 --- a/core/src/main/java/org/geysermc/geyser/util/EntityUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/EntityUtils.java @@ -195,9 +195,7 @@ public final class EntityUtils { case CHICKEN -> zOffset = -0.1f; case TRADER_LLAMA, LLAMA -> zOffset = -0.3f; case TEXT_DISPLAY -> { - TextDisplayEntity textDisplay; - if (passenger instanceof TextDisplayEntity) { - textDisplay = (TextDisplayEntity) passenger; + if (passenger instanceof TextDisplayEntity textDisplay) { if (!textDisplay.hasTranslation()) return; xOffset = textDisplay.getTranslation().getX();