diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlayBuiltinSoundTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlayBuiltinSoundTranslator.java index b4873d7e7..ec7adc034 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlayBuiltinSoundTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlayBuiltinSoundTranslator.java @@ -34,6 +34,7 @@ import com.nukkitx.protocol.bedrock.packet.LevelSoundEventPacket; import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.connector.network.translators.PacketTranslator; import org.geysermc.connector.network.translators.Translator; +import org.geysermc.connector.network.translators.world.block.BlockStateValues; import org.geysermc.connector.registry.BlockRegistries; import org.geysermc.connector.utils.SoundUtils; import org.geysermc.connector.registry.Registries; @@ -85,7 +86,8 @@ public class JavaPlayBuiltinSoundTranslator extends PacketTranslator { LevelEventPacket packet = new LevelEventPacket(); - packet.setType(typeParticle); + packet.setType(particleMapping.getLevelEventType()); packet.setPosition(position); return packet; }; + } else if (particleMapping.getIdentifier() != null) { + int dimensionId = DimensionUtils.javaToBedrock(session.getDimension()); + return (position) -> { + SpawnParticleEffectPacket stringPacket = new SpawnParticleEffectPacket(); + stringPacket.setIdentifier(particleMapping.getIdentifier()); + stringPacket.setDimensionId(dimensionId); + stringPacket.setPosition(position); + return stringPacket; + }; } else { - String stringParticle = Registries.PARTICLES.get(particle.getType()).getIdentifier(); - if (stringParticle != null) { - int dimensionId = DimensionUtils.javaToBedrock(session.getDimension()); - return (position) -> { - SpawnParticleEffectPacket stringPacket = new SpawnParticleEffectPacket(); - stringPacket.setIdentifier(stringParticle); - stringPacket.setDimensionId(dimensionId); - stringPacket.setPosition(position); - return stringPacket; - }; - } else { - return null; - } + return null; } + } } } } \ No newline at end of file