mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Hopefully fix double closing
This commit is contained in:
parent
e5c78030dc
commit
3bbdddc7d2
1 changed files with 8 additions and 0 deletions
|
|
@ -26,7 +26,9 @@
|
||||||
package org.geysermc.geyser.translator.sound.block;
|
package org.geysermc.geyser.translator.sound.block;
|
||||||
|
|
||||||
import org.cloudburstmc.math.vector.Vector3f;
|
import org.cloudburstmc.math.vector.Vector3f;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.data.LevelEvent;
|
||||||
import org.cloudburstmc.protocol.bedrock.data.SoundEvent;
|
import org.cloudburstmc.protocol.bedrock.data.SoundEvent;
|
||||||
|
import org.cloudburstmc.protocol.bedrock.packet.LevelEventPacket;
|
||||||
import org.cloudburstmc.protocol.bedrock.packet.LevelSoundEventPacket;
|
import org.cloudburstmc.protocol.bedrock.packet.LevelSoundEventPacket;
|
||||||
import org.geysermc.geyser.level.block.type.BlockState;
|
import org.geysermc.geyser.level.block.type.BlockState;
|
||||||
import org.geysermc.geyser.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
|
|
@ -49,6 +51,12 @@ public class OpenableSoundInteractionTranslator implements BlockSoundInteraction
|
||||||
levelSoundEventPacket.setSound(event);
|
levelSoundEventPacket.setSound(event);
|
||||||
levelSoundEventPacket.setExtraData(session.getBlockMappings().getBedrockBlock(state).getRuntimeId());
|
levelSoundEventPacket.setExtraData(session.getBlockMappings().getBedrockBlock(state).getRuntimeId());
|
||||||
session.sendUpstreamPacket(levelSoundEventPacket);
|
session.sendUpstreamPacket(levelSoundEventPacket);
|
||||||
|
// To ensure that the doors don't do weird double closing sometimes
|
||||||
|
LevelEventPacket levelEventPacket = new LevelEventPacket();
|
||||||
|
levelEventPacket.setType(LevelEvent.SOUND_DOOR_OPEN);
|
||||||
|
levelEventPacket.setPosition(position);
|
||||||
|
levelEventPacket.setData(-1);
|
||||||
|
session.sendUpstreamPacket(levelEventPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SoundEvent getSound(boolean open, String identifier) {
|
private SoundEvent getSound(boolean open, String identifier) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue