Skip to content

Commit

Permalink
feat: forward LevelSoundEvent2Packet
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcmd committed Jun 10, 2024
1 parent 86699b5 commit 91bc2da
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ protected void registerDefaultPacketProcessors(AllayPacketProcessorHolder holder
holder.registerProcessor(new ModalFormResponsePacketProcessor());
holder.registerProcessor(new ServerSettingsRequestProcessor());
holder.registerProcessor(new PlayerSkinPacketProcessor());
holder.registerProcessor(new LevelSoundEvent2PacketProcessor());
}

public PacketProcessor<BedrockPacket> getProcessor(BedrockPacket packet) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package org.allaymc.server.network.processor;

import org.allaymc.api.entity.interfaces.EntityPlayer;
import org.allaymc.api.network.processor.PacketProcessor;
import org.cloudburstmc.protocol.bedrock.data.GameType;
import org.cloudburstmc.protocol.bedrock.packet.BedrockPacketType;
import org.cloudburstmc.protocol.bedrock.packet.LevelSoundEvent2Packet;
import org.cloudburstmc.protocol.common.PacketSignal;

/**
* Allay Project 2024/6/10
*
* @author daoge_cmd
*/
public class LevelSoundEvent2PacketProcessor extends PacketProcessor<LevelSoundEvent2Packet> {
@Override
public BedrockPacketType getPacketType() {
return BedrockPacketType.LEVEL_SOUND_EVENT_2;
}

@Override
public PacketSignal handleAsync(EntityPlayer player, LevelSoundEvent2Packet packet) {
if (player.getGameType() != GameType.SPECTATOR) {
player.getCurrentChunk().addChunkPacket(packet);
}
return PacketSignal.HANDLED;
}
}

0 comments on commit 91bc2da

Please sign in to comment.