Skip to content

Commit

Permalink
Add missing sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Alemiz112 committed Feb 7, 2024
1 parent f79f51f commit 47afe61
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@

import org.cloudburstmc.protocol.bedrock.codec.BedrockCodec;
import org.cloudburstmc.protocol.bedrock.codec.v291.serializer.LevelEventSerializer_v291;
import org.cloudburstmc.protocol.bedrock.codec.v291.serializer.LevelSoundEvent1Serializer_v291;
import org.cloudburstmc.protocol.bedrock.codec.v313.serializer.LevelSoundEvent2Serializer_v313;
import org.cloudburstmc.protocol.bedrock.codec.v332.serializer.LevelSoundEventSerializer_v332;
import org.cloudburstmc.protocol.bedrock.codec.v361.serializer.LevelEventGenericSerializer_v361;
import org.cloudburstmc.protocol.bedrock.codec.v575.BedrockCodecHelper_v575;
import org.cloudburstmc.protocol.bedrock.codec.v622.Bedrock_v622;
import org.cloudburstmc.protocol.bedrock.codec.v630.Bedrock_v630;
import org.cloudburstmc.protocol.bedrock.codec.v649.serializer.*;
import org.cloudburstmc.protocol.bedrock.data.LevelEvent;
import org.cloudburstmc.protocol.bedrock.data.LevelEventType;
import org.cloudburstmc.protocol.bedrock.data.ParticleType;
import org.cloudburstmc.protocol.bedrock.data.SoundEvent;
import org.cloudburstmc.protocol.bedrock.packet.*;
import org.cloudburstmc.protocol.common.util.TypeMap;

public class Bedrock_v649 extends Bedrock_v630 {

protected static final TypeMap<ParticleType> PARTICLE_TYPES = Bedrock_v622.PARTICLE_TYPES
protected static final TypeMap<ParticleType> PARTICLE_TYPES = Bedrock_v630.PARTICLE_TYPES
.toBuilder()
.shift(18, 1)
.insert(18, ParticleType.WIND_EXPLOSION)
Expand All @@ -31,6 +34,18 @@ public class Bedrock_v649 extends Bedrock_v630 {
.insert(LEVEL_EVENT_PARTICLE_TYPE, PARTICLE_TYPES)
.build();

protected static final TypeMap<SoundEvent> SOUND_EVENTS = Bedrock_v630.SOUND_EVENTS
.toBuilder()
.replace(492, SoundEvent.AMBIENT_IN_AIR)
.insert(493, SoundEvent.WIND_BURST)
.insert(494, SoundEvent.IMITATE_BREEZE)
.insert(495, SoundEvent.ARMADILLO_BRUSH)
.insert(496, SoundEvent.ARMADILLO_SCUTE_DROP)
.insert(497, SoundEvent.EQUIP_WOLF)
.insert(498, SoundEvent.UNEQUIP_WOLF)
.insert(499, SoundEvent.REFLECT)
.replace(500, SoundEvent.UNDEFINED)
.build();

// TODO: check for command params

Expand All @@ -41,6 +56,9 @@ public class Bedrock_v649 extends Bedrock_v630 {
.helper(() -> new BedrockCodecHelper_v575(ENTITY_DATA, GAME_RULE_TYPES, ITEM_STACK_REQUEST_TYPES, CONTAINER_SLOT_TYPES, PLAYER_ABILITIES, TEXT_PROCESSING_ORIGINS))
.updateSerializer(LevelEventPacket.class, new LevelEventSerializer_v291(LEVEL_EVENTS))
.updateSerializer(LevelEventGenericPacket.class, new LevelEventGenericSerializer_v361(LEVEL_EVENTS))
.updateSerializer(LevelSoundEvent1Packet.class, new LevelSoundEvent1Serializer_v291(SOUND_EVENTS))
.updateSerializer(LevelSoundEvent2Packet.class, new LevelSoundEvent2Serializer_v313(SOUND_EVENTS))
.updateSerializer(LevelSoundEventPacket.class, new LevelSoundEventSerializer_v332(SOUND_EVENTS))
.updateSerializer(CorrectPlayerMovePredictionPacket.class, CorrectPlayerMovePredictionSerializer_v649.INSTANCE)
.updateSerializer(LevelChunkPacket.class, LevelChunkSerializer_v649.INSTANCE)
.updateSerializer(PlayerAuthInputPacket.class, new PlayerAuthInputSerializer_v649())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,38 @@ public enum SoundEvent {
* @since v630
*/
COPPER_BULB_OFF,
/**
* @since v649
*/
AMBIENT_IN_AIR,
/**
* @since v649
*/
WIND_BURST,
/**
* @since v649
*/
IMITATE_BREEZE,
/**
* @since v649
*/
ARMADILLO_BRUSH,
/**
* @since v649
*/
ARMADILLO_SCUTE_DROP,
/**
* @since v649
*/
EQUIP_WOLF,
/**
* @since v649
*/
UNEQUIP_WOLF,
/**
* @since v649
*/
REFLECT,

UNDEFINED
}

0 comments on commit 47afe61

Please sign in to comment.