3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 16:12:46 +01:00

Fix Ender Crystal collision and explosion effects (#716)

Fixed the collision box being non-existent for ender crystals and fixed explosion effects not being displayed properly
Dieser Commit ist enthalten in:
rtm516 2020-06-01 20:57:27 +01:00 committet von GitHub
Ursprung 215e5a7e21
Commit ac5ab229f9
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 10 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -105,7 +105,7 @@ public enum EntityType {
THROWN_EXP_BOTTLE(ThrowableEntity.class, 68, 0.25f, 0.25f, 0f, 0f, "minecraft:xp_bottle"),
EXPERIENCE_ORB(ExpOrbEntity.class, 69, 0f, 0f, 0f, 0f, "minecraft:xp_orb"),
EYE_OF_ENDER(Entity.class, 70, 0.25f, 0.25f, 0f, 0f, "minecraft:eye_of_ender_signal"),
END_CRYSTAL(EnderCrystalEntity.class, 71, 0f, 0f, 0f, 0f, "minecraft:ender_crystal"),
END_CRYSTAL(EnderCrystalEntity.class, 71, 2.0f, 2.0f, 2.0f, 0f, "minecraft:ender_crystal"),
FIREWORK_ROCKET(FireworkEntity.class, 72, 0.25f, 0.25f, 0.25f, 0f, "minecraft:fireworks_rocket"),
TRIDENT(TridentEntity.class, 73, 0f, 0f, 0f, 0f, "minecraft:thrown_trident"),
TURTLE(AnimalEntity.class, 74, 0.4f, 1.2f),

Datei anzeigen

@ -46,14 +46,17 @@ public class JavaExplosionTranslator extends PacketTranslator<ServerExplosionPac
public void translate(ServerExplosionPacket packet, GeyserSession session) {
for (ExplodedBlockRecord record : packet.getExploded()) {
Vector3f pos = Vector3f.from(packet.getX() + record.getX(), packet.getY() + record.getY(), packet.getZ() + record.getZ());
// Since bedrock does not play an explosion sound and particles sound, we have to manually do so
LevelEventPacket levelEventPacket = new LevelEventPacket();
levelEventPacket.setType(LevelEventType.PARTICLE_LARGE_EXPLOSION);
levelEventPacket.setData(0);
levelEventPacket.setPosition(pos.toFloat());
session.sendUpstreamPacket(levelEventPacket);
ChunkUtils.updateBlock(session, BlockTranslator.AIR, pos.toInt());
}
Vector3f pos = Vector3f.from(packet.getX(), packet.getY(), packet.getZ());
// Since bedrock does not play an explosion sound and particles sound, we have to manually do so
LevelEventPacket levelEventPacket = new LevelEventPacket();
levelEventPacket.setType(packet.getRadius() >= 2.0f ? LevelEventType.PARTICLE_HUGE_EXPLODE : LevelEventType.PARTICLE_LARGE_EXPLOSION);
levelEventPacket.setData(0);
levelEventPacket.setPosition(pos.toFloat());
session.sendUpstreamPacket(levelEventPacket);
LevelSoundEventPacket levelSoundEventPacket = new LevelSoundEventPacket();
levelSoundEventPacket.setRelativeVolumeDisabled(false);
levelSoundEventPacket.setBabySound(false);