From d74b0e236d4a5fb78ece87f1e911d06df1530c04 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Thu, 26 May 2022 18:04:58 -0400 Subject: [PATCH] Fix encoding SpawnParticleEffectPacket for 1.18.30+ --- .../geyser/entity/type/living/monster/EnderDragonEntity.java | 2 ++ .../translator/protocol/java/entity/JavaAnimateTranslator.java | 3 +++ .../protocol/java/level/JavaLevelParticlesTranslator.java | 2 ++ 3 files changed, 7 insertions(+) diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonEntity.java index 99ab1a55c..1d689e806 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/EnderDragonEntity.java @@ -39,6 +39,7 @@ import org.geysermc.geyser.entity.type.living.MobEntity; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.util.DimensionUtils; +import java.util.Optional; import java.util.Random; import java.util.UUID; import java.util.concurrent.ThreadLocalRandom; @@ -262,6 +263,7 @@ public class EnderDragonEntity extends MobEntity implements Tickable { spawnParticleEffectPacket.setDimensionId(DimensionUtils.javaToBedrock(session.getDimension())); spawnParticleEffectPacket.setPosition(head.getPosition().add(random.nextGaussian() / 2f, random.nextGaussian() / 2f, random.nextGaussian() / 2f)); spawnParticleEffectPacket.setIdentifier("minecraft:dragon_breath_fire"); + spawnParticleEffectPacket.setMolangVariablesJson(Optional.empty()); session.sendUpstreamPacket(spawnParticleEffectPacket); } } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaAnimateTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaAnimateTranslator.java index b9cbebb22..559964f63 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaAnimateTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/entity/JavaAnimateTranslator.java @@ -36,6 +36,8 @@ import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.util.DimensionUtils; +import java.util.Optional; + @Translator(packet = ClientboundAnimatePacket.class) public class JavaAnimateTranslator extends PacketTranslator { @@ -77,6 +79,7 @@ public class JavaAnimateTranslator extends PacketTranslator