mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Fix encoding SpawnParticleEffectPacket for 1.18.30+
This commit is contained in:
parent
38625312a1
commit
d74b0e236d
3 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<ClientboundAnimatePacket> {
|
||||
|
||||
|
@ -77,6 +79,7 @@ public class JavaAnimateTranslator extends PacketTranslator<ClientboundAnimatePa
|
|||
stringPacket.setDimensionId(DimensionUtils.javaToBedrock(session.getDimension()));
|
||||
stringPacket.setPosition(Vector3f.ZERO);
|
||||
stringPacket.setUniqueEntityId(entity.getGeyserId());
|
||||
stringPacket.setMolangVariablesJson(Optional.empty());
|
||||
session.sendUpstreamPacket(stringPacket);
|
||||
break;
|
||||
case LEAVE_BED:
|
||||
|
|
|
@ -42,6 +42,7 @@ import org.geysermc.geyser.registry.Registries;
|
|||
import org.geysermc.geyser.registry.type.ParticleMapping;
|
||||
import org.geysermc.geyser.util.DimensionUtils;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.function.Function;
|
||||
|
@ -150,6 +151,7 @@ public class JavaLevelParticlesTranslator extends PacketTranslator<ClientboundLe
|
|||
stringPacket.setIdentifier(particleMapping.identifier());
|
||||
stringPacket.setDimensionId(dimensionId);
|
||||
stringPacket.setPosition(position);
|
||||
stringPacket.setMolangVariablesJson(Optional.empty());
|
||||
return stringPacket;
|
||||
};
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue