Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Data Asset Sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Java data generator and its setup steps are in [generator/README.md](generat

### data/bedrock/biomes.json

[axolotl-pm/BedrockData](https://github.com/axolotl-pm/BedrockData/blob/4d9723bc0c4ca86e679d753751574399334ceca4/biome_id_map.json)
[axolotl-pm/BedrockData](https://github.com/axolotl-pm/BedrockData/blob/aeb5f24894f1873dde6f7b4f39490ad85ce59094/biome_id_map.json)

### data/bedrock/block_id_meta_to_1_12_0_nbt.bin

Expand All @@ -23,7 +23,7 @@ The Java data generator and its setup steps are in [generator/README.md](generat

### data/bedrock/block_palette.nbt

[GeyserMC/Geyser](https://github.com/GeyserMC/Geyser/blob/50115039af4cd92e50545075d3a13eea6880cf88/core/src/main/resources/bedrock/block_palette.26_50.nbt)
[GeyserMC/Geyser](https://github.com/GeyserMC/Geyser/blob/fd35d5918ae8e8b6c05d91179315fa00413c1f65/core/src/main/resources/bedrock/block_palette.26_60.nbt)

### data/bedrock/block_sounds.json

Expand Down Expand Up @@ -61,7 +61,7 @@ This file has been generated using `./gradlew generateBedrockParticleList` from

### data/bedrock/runtime_item_states.json

[CloudburstMC/Data](https://github.com/CloudburstMC/Data/blob/a8a4341d7763d6eb8547cff3ca46b4153d60163d/runtime_item_states.json)
[CloudburstMC/Data](https://github.com/CloudburstMC/Data/blob/293c848098cc636a2758937fb6610b8bed1f12c5/runtime_item_states.json)

### data/bedrock/sounds.json

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ org.gradle.configuration-cache=true
java_version=17
maven_group=net.raphimc
maven_name=ViaBedrock
maven_version=0.0.31-SNAPSHOT
maven_version=0.0.32-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ public JsonBlockStateUpgradeSchema(final JsonObject jsonObject) {

if (tag.get("states") instanceof CompoundTag states) {
for (Pair<String, ?> property : toAdd) {
states.put(property.key(), NbtUtil.createTag(property.value()));
if (!states.contains(property.key())) {
states.put(property.key(), NbtUtil.createTag(property.value()));
}
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ public void sendSwingPacketToServer() {
animate.write(Types.UNSIGNED_BYTE, (short) AnimatePacketPayload_Action.Swing.getValue()); // action
animate.write(BedrockTypes.UNSIGNED_VAR_LONG, this.runtimeId); // entity runtime id
animate.write(BedrockTypes.FLOAT_LE, 0F); // data
animate.write(BedrockTypes.OPTIONAL_STRING, ActorSwingSource.Attack.name().toLowerCase(Locale.ROOT)); // swing source // TODO: 1.21.130
animate.write(BedrockTypes.OPTIONAL_STRING, ActorSwingSource.Attack.name().toLowerCase(Locale.ROOT)); // swing source
animate.write(Types.BYTE, (byte) HandSlot.Mainhand.getValue()); // hand slot
animate.sendToServer(BedrockProtocol.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final L
}

final int rawAlgorithm = in.readUnsignedByte();
final PacketCompressionAlgorithm algorithm = PacketCompressionAlgorithm.getByValue(rawAlgorithm);
final PacketCompressionAlgorithm algorithm = rawAlgorithm == 0xFF ? PacketCompressionAlgorithm.None : PacketCompressionAlgorithm.getByValue(rawAlgorithm);
if (algorithm == null) { // Bedrock client drops the packet if the algorithm is unknown
ViaBedrock.getPlatform().getLogger().log(Level.WARNING, "Dropping packet with unknown PacketCompressionAlgorithm: " + rawAlgorithm);
in.skipBytes(in.readableBytes());
Expand All @@ -95,7 +95,7 @@ protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final L

final CompressionAlgorithm compressionAlgorithm = this.getCompressionAlgorithm(algorithm);
if (compressionAlgorithm instanceof NoopCompression) {
out.add(in.retain());
out.add(in.readRetainedSlice(in.readableBytes()));
} else {
final ByteBuf uncompressedData = ctx.alloc().buffer();
compressionAlgorithm.decompress(in, uncompressedData); // Bedrock client would drop packets with invalid data, but this would be too insane to do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ public enum ClientboundBedrockPackets implements ClientboundPacketType {
PLAYER_VIDEO_CAPTURE(MinecraftPacketIds.PlayerVideoCapturePacket.getValue()),
PLAYER_UPDATE_ENTITY_OVERRIDES(MinecraftPacketIds.PlayerUpdateEntityOverridesPacket.getValue()),
PLAYER_LOCATION(MinecraftPacketIds.PlayerLocation.getValue()),
CAMERA_SPLINE(MinecraftPacketIds.CameraSplinePacket.getValue()),
//CAMERA_SPLINE(MinecraftPacketIds.CameraSplinePacket.getValue()),
SYNC_WORLD_CLOCKS(MinecraftPacketIds.SyncWorldClocks.getValue()),
VOXEL_SHAPES(MinecraftPacketIds.VoxelShapesPacket.getValue()),
SET_PLAYER_FURNACE_OPTIONS(MinecraftPacketIds.SetPlayerFurnaceOptions.getValue()),
RECORD_STARTED(MinecraftPacketIds.RecordStarted.getValue()),
STONECUTTER_SET_RECIPE(MinecraftPacketIds.ClientboundStonecutterSetRecipePacket.getValue());
RECORD_STARTED(MinecraftPacketIds.RecordStarted.getValue());
//STONECUTTER_SET_RECIPE(MinecraftPacketIds.ClientboundStonecutterSetRecipePacket.getValue());
// UPDATE_SOUND_DATA(MinecraftPacketIds.ClientboundUpdateSoundDataPacket.getValue());
// CONTROL_SCHEME_SET(MinecraftPacketIds.ClientboundControlSchemeSetPacket.getValue()),
// PRIMITIVE_SHAPES(MinecraftPacketIds.PrimitiveShapesPacket.getValue()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public enum ServerboundBedrockPackets implements ServerboundPacketType {
CLIENT_CAMERA_AIM_ASSIST(MinecraftPacketIds.ClientCameraAimAssist.getValue()),
MOVEMENT_PREDICTION_SYNC(MinecraftPacketIds.ClientMovementPredictionSyncPacket.getValue()),
UPDATE_CLIENT_OPTIONS(MinecraftPacketIds.UpdateClientOptions.getValue()),
PLAYER_LOCATION(MinecraftPacketIds.PlayerLocation.getValue()),
STONECUTTER_SET_RECIPE(MinecraftPacketIds.ServerboundStonecutterSetRecipePacket.getValue());
PLAYER_LOCATION(MinecraftPacketIds.PlayerLocation.getValue());
//STONECUTTER_SET_RECIPE(MinecraftPacketIds.ServerboundStonecutterSetRecipePacket.getValue());
//PACK_SETTING_CHANGE(MinecraftPacketIds.ServerboundPackSettingChange.getValue()),
//DATA_STORE(MinecraftPacketIds.ServerboundDataStore.getValue()),
//RESOURCE_PACKS_READY_FOR_VALIDATION(MinecraftPacketIds.ResourcePacksReadyForValidation.getValue()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public final class ProtocolConstants {
public static final TextComponentCodec JAVA_TEXT_COMPONENT_SERIALIZER = TextComponentCodec.V26_1;
public static final int JAVA_AIR_ID = 0;

public static final String BEDROCK_VERSION_NAME = "1.26.51";
public static final int BEDROCK_PROTOCOL_VERSION = 2193;
public static final String BEDROCK_VERSION_NAME = "1.26.60";
public static final int BEDROCK_PROTOCOL_VERSION = 2225;
public static final int BEDROCK_RAKNET_PROTOCOL_VERSION = 11;
public static final int BEDROCK_DEFAULT_PORT = 19132;
public static final int BEDROCK_NETHERNET_LAN_DEFAULT_PORT = 7551;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ public enum ActorType {
CamelHusk(70552),
SulfurCube(921),
Cushion(154),
Frostbite(199579),
IceBall(4194460),
;

private static final Int2ObjectMap<ActorType> BY_VALUE = new Int2ObjectOpenHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT!
package net.raphimc.viabedrock.protocol.data.enums.bedrock.generated;

import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap;

public enum AudioContentPlaybackType {

Music(0),
Sound(1),
;

private static final Int2ObjectMap<AudioContentPlaybackType> BY_VALUE = new Int2ObjectOpenHashMap<>();

static {
for (AudioContentPlaybackType value : values()) {
if (!BY_VALUE.containsKey(value.value)) {
BY_VALUE.put(value.value, value);
}
}
}

public static AudioContentPlaybackType getByValue(final int value) {
return BY_VALUE.get(value);
}

public static AudioContentPlaybackType getByValue(final int value, final AudioContentPlaybackType fallback) {
return BY_VALUE.getOrDefault(value, fallback);
}

public static AudioContentPlaybackType getByName(final String name) {
for (AudioContentPlaybackType value : values()) {
if (value.name().equalsIgnoreCase(name)) {
return value;
}
}
return null;
}

public static AudioContentPlaybackType getByName(final String name, final AudioContentPlaybackType fallback) {
for (AudioContentPlaybackType value : values()) {
if (value.name().equalsIgnoreCase(name)) {
return value;
}
}
return fallback;
}

private final int value;

AudioContentPlaybackType(final AudioContentPlaybackType value) {
this(value.value);
}

AudioContentPlaybackType(final int value) {
this.value = value;
}

public int getValue() {
return this.value;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public enum ContainerEnumName {
SmithingTableTemplateContainer(61),
CrafterLevelEntityContainer(62),
DynamicContainer(63),
ReservedContainerA(67),
ReservedContainerB(68),
ReservedContainerC(69),
ReservedContainerD(70),
;

private static final Int2ObjectMap<ContainerEnumName> BY_VALUE = new Int2ObjectOpenHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public enum ContainerType {
CHEST_BOAT(34),
DECORATED_POT(35),
CRAFTER(36),
RESERVED_CONTAINER_TYPE(38),
;

private static final Int2ObjectMap<ContainerType> BY_VALUE = new Int2ObjectOpenHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public enum CurrentCmdVersion {
LocateStructureOutput(42),
PostBlockFlattening(43),
TestForBlockCommandDoesNotIgnoreBlockState(44),
Count(55),
Latest(54),
Count(56),
Latest(55),
;

private static final Int2ObjectMap<CurrentCmdVersion> BY_VALUE = new Int2ObjectOpenHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT!
package net.raphimc.viabedrock.protocol.data.enums.bedrock.generated;

import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap;

public enum CursorItemDragState {

Start(0),
Stop(1),
;

private static final Int2ObjectMap<CursorItemDragState> BY_VALUE = new Int2ObjectOpenHashMap<>();

static {
for (CursorItemDragState value : values()) {
if (!BY_VALUE.containsKey(value.value)) {
BY_VALUE.put(value.value, value);
}
}
}

public static CursorItemDragState getByValue(final int value) {
return BY_VALUE.get(value);
}

public static CursorItemDragState getByValue(final int value, final CursorItemDragState fallback) {
return BY_VALUE.getOrDefault(value, fallback);
}

public static CursorItemDragState getByName(final String name) {
for (CursorItemDragState value : values()) {
if (value.name().equalsIgnoreCase(name)) {
return value;
}
}
return null;
}

public static CursorItemDragState getByName(final String name, final CursorItemDragState fallback) {
for (CursorItemDragState value : values()) {
if (value.name().equalsIgnoreCase(name)) {
return value;
}
}
return fallback;
}

private final int value;

CursorItemDragState(final CursorItemDragState value) {
this(value.value);
}

CursorItemDragState(final int value) {
this.value = value;
}

public int getValue() {
return this.value;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

public enum DataItemType {

Unknown(-1),
Byte(0),
Short(1),
Int(2),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public enum DisconnectFailReason {
EditorNotAllowed(147),
MissingStructureData(148),
UnsupportedTransport(149),
SubClientLoginNotBound(150),
;

private static final Int2ObjectMap<DisconnectFailReason> BY_VALUE = new Int2ObjectOpenHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT!
package net.raphimc.viabedrock.protocol.data.enums.bedrock.generated;

import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap;

public enum EditorLevelMigrationVersion {

Legacy(0),
EditorAchievements(1),
;

private static final Int2ObjectMap<EditorLevelMigrationVersion> BY_VALUE = new Int2ObjectOpenHashMap<>();

static {
for (EditorLevelMigrationVersion value : values()) {
if (!BY_VALUE.containsKey(value.value)) {
BY_VALUE.put(value.value, value);
}
}
}

public static EditorLevelMigrationVersion getByValue(final int value) {
return BY_VALUE.get(value);
}

public static EditorLevelMigrationVersion getByValue(final int value, final EditorLevelMigrationVersion fallback) {
return BY_VALUE.getOrDefault(value, fallback);
}

public static EditorLevelMigrationVersion getByName(final String name) {
for (EditorLevelMigrationVersion value : values()) {
if (value.name().equalsIgnoreCase(name)) {
return value;
}
}
return null;
}

public static EditorLevelMigrationVersion getByName(final String name, final EditorLevelMigrationVersion fallback) {
for (EditorLevelMigrationVersion value : values()) {
if (value.name().equalsIgnoreCase(name)) {
return value;
}
}
return fallback;
}

private final int value;

EditorLevelMigrationVersion(final EditorLevelMigrationVersion value) {
this(value.value);
}

EditorLevelMigrationVersion(final int value) {
this.value = value;
}

public int getValue() {
return this.value;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ public enum ItemStackRequestActionType {
CraftRecipeOptional(15),
CraftRepairAndDisenchant(16),
CraftLoom(17),
CraftNonImplemented(18),
CraftResults(19),
CraftReservedAction(18),
CraftNonImplemented(19),
CraftResults(20),
;

private static final Int2ObjectMap<ItemStackRequestActionType> BY_VALUE = new Int2ObjectOpenHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ public enum MatchmakingState {
Idle(0),
Matchmaking(1),
MatchFound(2),
Canceled(3),
PlayerLeftParty(4),
PlayerLeftServer(5),
ServerShutdown(6),
TimedOut(7),
RequeueAsParty(8),
;

private static final Int2ObjectMap<MatchmakingState> BY_VALUE = new Int2ObjectOpenHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public enum MinecraftEventing_AchievementIds {
MonsterHunter(124),
Diamonds(125),
PlethoraOfCats(126),
WhatGoesAroundComesAround(127),
;

private static final Int2ObjectMap<MinecraftEventing_AchievementIds> BY_VALUE = new Int2ObjectOpenHashMap<>();
Expand Down
Loading