-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: forward LevelSoundEvent2Packet
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...r/src/main/java/org/allaymc/server/network/processor/LevelSoundEvent2PacketProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |