mirror of https://github.com/PaperMC/Paper.git
26 lines
1.4 KiB
Diff
26 lines
1.4 KiB
Diff
--- a/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
|
+++ b/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
|
|
@@ -30,14 +30,18 @@
|
|
short short0 = (Short) shortiterator.next();
|
|
|
|
this.positions[j] = short0;
|
|
- this.states[j] = levelchunksection.getBlockState(SectionPos.sectionRelativeX(short0), SectionPos.sectionRelativeY(short0), SectionPos.sectionRelativeZ(short0));
|
|
+ this.states[j] = (section != null) ? section.getBlockState(SectionPos.sectionRelativeX(short0), SectionPos.sectionRelativeY(short0), SectionPos.sectionRelativeZ(short0)) : net.minecraft.world.level.block.Blocks.AIR.defaultBlockState(); // CraftBukkit - SPIGOT-6076, Mojang bug when empty chunk section notified
|
|
}
|
|
|
|
}
|
|
|
|
- public ClientboundSectionBlocksUpdatePacket(FriendlyByteBuf friendlybytebuf) {
|
|
- this.sectionPos = SectionPos.of(friendlybytebuf.readLong());
|
|
- int i = friendlybytebuf.readVarInt();
|
|
+ // CraftBukkit start - Add constructor
|
|
+ public ClientboundSectionBlocksUpdatePacket(SectionPos sectionposition, ShortSet shortset, IBlockData[] states) {
|
|
+ this.sectionPos = sectionposition;
|
|
+ this.positions = shortset.toShortArray();
|
|
+ this.states = states;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
|
|
this.positions = new short[i];
|
|
this.states = new BlockState[i];
|