Merge remote-tracking branch 'upstream/master' into fix/protocol

This commit is contained in:
Joshua Castle 2024-04-20 17:16:59 -07:00
commit fe26035668
No known key found for this signature in database
GPG key ID: 7ECA1A2FC38ABA9F
3 changed files with 5 additions and 5 deletions

View file

@ -260,8 +260,6 @@ public final class BlockStateValues {
} }
/** /**
* Non-water cauldrons (since Bedrock 1.18.30) must have a block entity packet sent on chunk load to fix rendering issues.
*
* @return if this Java block state is a non-empty non-water cauldron * @return if this Java block state is a non-empty non-water cauldron
*/ */
public static boolean isNonWaterCauldron(int state) { public static boolean isNonWaterCauldron(int state) {
@ -269,6 +267,8 @@ public final class BlockStateValues {
} }
/** /**
* Cauldrons (since Bedrock 1.18.30) must have a block entity packet sent on chunk load to fix rendering issues.
* <p>
* When using a bucket on a cauldron sending a ServerboundUseItemPacket can result in the liquid being placed. * When using a bucket on a cauldron sending a ServerboundUseItemPacket can result in the liquid being placed.
* *
* @return if this Java block state is a cauldron * @return if this Java block state is a cauldron

View file

@ -63,7 +63,7 @@ public interface BedrockOnlyBlockEntity extends RequiresBlockState {
return FlowerPotBlockEntityTranslator.getTag(session, blockState, position); return FlowerPotBlockEntityTranslator.getTag(session, blockState, position);
} else if (PistonBlockEntityTranslator.isBlock(blockState)) { } else if (PistonBlockEntityTranslator.isBlock(blockState)) {
return PistonBlockEntityTranslator.getTag(blockState, position); return PistonBlockEntityTranslator.getTag(blockState, position);
} else if (BlockStateValues.isNonWaterCauldron(blockState)) { } else if (BlockStateValues.isCauldron(blockState)) {
// As of 1.18.30: this is required to make rendering not look weird on chunk load (lava and snow cauldrons look dim) // As of 1.18.30: this is required to make rendering not look weird on chunk load (lava and snow cauldrons look dim)
return NbtMap.builder() return NbtMap.builder()
.putString("id", "Cauldron") .putString("id", "Cauldron")

View file

@ -200,7 +200,7 @@ public class JavaLevelChunkWithLightTranslator extends PacketTranslator<Clientbo
} }
// Check if block is piston or flower to see if we'll need to create additional block entities, as they're only block entities in Bedrock // Check if block is piston or flower to see if we'll need to create additional block entities, as they're only block entities in Bedrock
if (BlockStateValues.getFlowerPotValues().containsKey(javaId) || BlockStateValues.getPistonValues().containsKey(javaId) || BlockStateValues.isNonWaterCauldron(javaId)) { if (BlockStateValues.getFlowerPotValues().containsKey(javaId) || BlockStateValues.getPistonValues().containsKey(javaId) || BlockStateValues.isCauldron(javaId)) {
bedrockBlockEntities.add(BedrockOnlyBlockEntity.getTag(session, bedrockBlockEntities.add(BedrockOnlyBlockEntity.getTag(session,
Vector3i.from((packet.getX() << 4) + (yzx & 0xF), ((sectionY + yOffset) << 4) + ((yzx >> 8) & 0xF), (packet.getZ() << 4) + ((yzx >> 4) & 0xF)), Vector3i.from((packet.getX() << 4) + (yzx & 0xF), ((sectionY + yOffset) << 4) + ((yzx >> 8) & 0xF), (packet.getZ() << 4) + ((yzx >> 4) & 0xF)),
javaId javaId
@ -259,7 +259,7 @@ public class JavaLevelChunkWithLightTranslator extends PacketTranslator<Clientbo
} }
// Check if block is piston, flower or cauldron to see if we'll need to create additional block entities, as they're only block entities in Bedrock // Check if block is piston, flower or cauldron to see if we'll need to create additional block entities, as they're only block entities in Bedrock
if (BlockStateValues.getFlowerPotValues().containsKey(javaId) || BlockStateValues.getPistonValues().containsKey(javaId) || BlockStateValues.isNonWaterCauldron(javaId)) { if (BlockStateValues.getFlowerPotValues().containsKey(javaId) || BlockStateValues.getPistonValues().containsKey(javaId) || BlockStateValues.isCauldron(javaId)) {
bedrockOnlyBlockEntityIds.set(i); bedrockOnlyBlockEntityIds.set(i);
} }
} }