From 121ca11db2ad2e14f654a1c5233a566a69577cf3 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 3 Nov 2023 16:58:02 +0100 Subject: [PATCH 1/5] Fix text displays on 1.20.2 It seems like 1.20.2 added one more field to base displays (https://wiki.vg/Entity_metadata#Display), and a few more to text displays: https://wiki.vg/Entity_metadata#Text_Display (#4268) --- .../org/geysermc/geyser/entity/EntityDefinitions.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/entity/EntityDefinitions.java b/core/src/main/java/org/geysermc/geyser/entity/EntityDefinitions.java index a88eff111..e9d49fbd8 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/EntityDefinitions.java +++ b/core/src/main/java/org/geysermc/geyser/entity/EntityDefinitions.java @@ -299,8 +299,9 @@ public final class EntityDefinitions { .build(); EntityDefinition displayBase = EntityDefinition.inherited(entityBase.factory(), entityBase) - .addTranslator(null) // Interpolation start ticks - .addTranslator(null) // Interpolation duration ID + .addTranslator(null) // Interpolation delay + .addTranslator(null) // Transformation interpolation duration + .addTranslator(null) // Position/Rotation interpolation duration .addTranslator(null) // Translation .addTranslator(null) // Scale .addTranslator(null) // Left rotation @@ -318,6 +319,10 @@ public final class EntityDefinitions { .type(EntityType.TEXT_DISPLAY) .identifier("minecraft:armor_stand") .addTranslator(MetadataType.CHAT, TextDisplayEntity::setText) + .addTranslator(null) // Line width + .addTranslator(null) // Background color + .addTranslator(null) // Text opacity + .addTranslator(null) // Bit mask .build(); INTERACTION = EntityDefinition.inherited(InteractionEntity::new, entityBase) From 4ff8b7bff44436f55248465eeb51c2f12c46814e Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 3 Nov 2023 17:09:34 +0100 Subject: [PATCH 2/5] Bump mcpl to fix issues with the ClientboundLoginDisconnectPacket (#4264) --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9488ae3b6..a5b1a79c3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,7 +14,7 @@ protocol-connection = "3.0.0.Beta1-20231016.115644-106" raknet = "1.0.0.CR1-20230703.195238-9" blockstateupdater="1.20.40-20231016.111746-1" mcauthlib = "d9d773e" -mcprotocollib = "1.20.2-1-20231003.141424-6" +mcprotocollib = "1.20.2-1-20231101.141901-7" adventure = "4.14.0" adventure-platform = "4.3.0" junit = "5.9.2" From 644082ae84111e07923ab86d73fd0445cd9b3594 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 3 Nov 2023 17:16:09 +0100 Subject: [PATCH 3/5] Fix `/geyser reload` on Velocity (#4258) * Fix /geyser reload on Velocity * No need to create/init a new injector on Velocity * No need to warn about "abnormally long startup" on Bungee when we're reloading. And, as on velocity, no need to re-inject --- .../bungeecord/GeyserBungeePlugin.java | 17 ++++++++++++++--- .../velocity/GeyserVelocityPlugin.java | 18 ++++++++++++++++-- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeePlugin.java b/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeePlugin.java index 86f283329..e58abc3b4 100644 --- a/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeePlugin.java +++ b/bootstrap/bungeecord/src/main/java/org/geysermc/geyser/platform/bungeecord/GeyserBungeePlugin.java @@ -70,6 +70,8 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap { private GeyserImpl geyser; + private static boolean INITIALIZED = false; + @Override public void onLoad() { GeyserLocale.init(this); @@ -133,7 +135,12 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap { // Big hack - Bungee does not provide us an event to listen to, so schedule a repeating // task that waits for a field to be filled which is set after the plugin enable // process is complete - this.awaitStartupCompletion(0); + if (!INITIALIZED) { + this.awaitStartupCompletion(0); + } else { + // No need to "wait" for startup completion, just start Geyser - we're reloading. + this.postStartup(); + } } @SuppressWarnings("unchecked") @@ -166,8 +173,10 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap { private void postStartup() { GeyserImpl.start(); - this.geyserInjector = new GeyserBungeeInjector(this); - this.geyserInjector.initializeLocalChannel(this); + if (!INITIALIZED) { + this.geyserInjector = new GeyserBungeeInjector(this); + this.geyserInjector.initializeLocalChannel(this); + } this.geyserCommandManager = new GeyserCommandManager(geyser); this.geyserCommandManager.init(); @@ -187,6 +196,8 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap { } else { this.geyserBungeePingPassthrough = new GeyserBungeePingPassthrough(getProxy()); } + + INITIALIZED = true; } @Override diff --git a/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityPlugin.java b/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityPlugin.java index dbbd30c41..93b57d712 100644 --- a/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityPlugin.java +++ b/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityPlugin.java @@ -64,6 +64,11 @@ import java.util.UUID; @Plugin(id = "geyser", name = GeyserImpl.NAME + "-Velocity", version = GeyserImpl.VERSION, url = "https://geysermc.org", authors = "GeyserMC") public class GeyserVelocityPlugin implements GeyserBootstrap { + /** + * Determines if the plugin has been ran once before, including before /geyser reload. + */ + private static boolean INITIALIZED = false; + @Inject private Logger logger; @@ -114,13 +119,20 @@ public class GeyserVelocityPlugin implements GeyserBootstrap { GeyserConfiguration.checkGeyserConfiguration(geyserConfig, geyserLogger); this.geyser = GeyserImpl.load(PlatformType.VELOCITY, this); + + // Hack: Normally triggered by ListenerBoundEvent, but that doesn't fire on /geyser reload + if (INITIALIZED) { + this.postStartup(); + } } private void postStartup() { GeyserImpl.start(); - this.geyserInjector = new GeyserVelocityInjector(proxyServer); - // Will be initialized after the proxy has been bound + if (!INITIALIZED) { + this.geyserInjector = new GeyserVelocityInjector(proxyServer); + // Will be initialized after the proxy has been bound + } this.geyserCommandManager = new GeyserCommandManager(geyser); this.geyserCommandManager.init(); @@ -195,6 +207,8 @@ public class GeyserVelocityPlugin implements GeyserBootstrap { geyserInjector.initializeLocalChannel(this); } } + + INITIALIZED = true; } @Override From ec526a798d3a4325a77f07373a55323e8118b43e Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 3 Nov 2023 17:22:55 +0100 Subject: [PATCH 4/5] Send cooldown when punching air (#4257) --- .../bedrock/entity/player/BedrockActionTranslator.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockActionTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockActionTranslator.java index bff097248..611ca5824 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockActionTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockActionTranslator.java @@ -55,6 +55,7 @@ import org.geysermc.geyser.translator.inventory.item.CustomItemTranslator; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.BlockUtils; +import org.geysermc.geyser.util.CooldownUtils; @Translator(packet = PlayerActionPacket.class) public class BedrockActionTranslator extends PacketTranslator { @@ -281,6 +282,10 @@ public class BedrockActionTranslator extends PacketTranslator Date: Sat, 4 Nov 2023 16:06:23 +0100 Subject: [PATCH 5/5] Move "unknown entity definition" spam to debug level (#4270) --- .../protocol/java/entity/spawn/JavaAddEntityTranslator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddEntityTranslator.java index c17c9955d..ab7163650 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/spawn/JavaAddEntityTranslator.java @@ -49,7 +49,7 @@ public class JavaAddEntityTranslator extends PacketTranslator definition = Registries.ENTITY_DEFINITIONS.get(packet.getType()); if (definition == null) { - session.getGeyser().getLogger().warning("Could not find an entity definition with type " + packet.getType()); + session.getGeyser().getLogger().debug("Could not find an entity definition with type " + packet.getType()); return; }