diff options
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/network/protocol/game')
6 files changed, 386 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ClientboundInitializeBorderPacket.java.patch b/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ClientboundInitializeBorderPacket.java.patch new file mode 100644 index 0000000000..abca0f1fb1 --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ClientboundInitializeBorderPacket.java.patch @@ -0,0 +1,78 @@ +--- a/net/minecraft/network/protocol/game/ClientboundInitializeBorderPacket.java ++++ b/net/minecraft/network/protocol/game/ClientboundInitializeBorderPacket.java +@@ -15,44 +15,44 @@ + private final int warningBlocks; + private final int warningTime; + +- public ClientboundInitializeBorderPacket(FriendlyByteBuf friendlybytebuf) { +- this.newCenterX = friendlybytebuf.readDouble(); +- this.newCenterZ = friendlybytebuf.readDouble(); +- this.oldSize = friendlybytebuf.readDouble(); +- this.newSize = friendlybytebuf.readDouble(); +- this.lerpTime = friendlybytebuf.readVarLong(); +- this.newAbsoluteMaxSize = friendlybytebuf.readVarInt(); +- this.warningBlocks = friendlybytebuf.readVarInt(); +- this.warningTime = friendlybytebuf.readVarInt(); ++ public ClientboundInitializeBorderPacket(FriendlyByteBuf buffer) { ++ this.newCenterX = buffer.readDouble(); ++ this.newCenterZ = buffer.readDouble(); ++ this.oldSize = buffer.readDouble(); ++ this.newSize = buffer.readDouble(); ++ this.lerpTime = buffer.readVarLong(); ++ this.newAbsoluteMaxSize = buffer.readVarInt(); ++ this.warningBlocks = buffer.readVarInt(); ++ this.warningTime = buffer.readVarInt(); + } + +- public ClientboundInitializeBorderPacket(WorldBorder worldborder) { +- this.newCenterX = worldborder.getCenterX(); +- this.newCenterZ = worldborder.getCenterZ(); +- this.oldSize = worldborder.getSize(); +- this.newSize = worldborder.getLerpTarget(); +- this.lerpTime = worldborder.getLerpRemainingTime(); +- this.newAbsoluteMaxSize = worldborder.getAbsoluteMaxSize(); +- this.warningBlocks = worldborder.getWarningBlocks(); +- this.warningTime = worldborder.getWarningTime(); ++ public ClientboundInitializeBorderPacket(WorldBorder worldBorder) { ++ // CraftBukkit start - multiply out nether border ++ this.newCenterX = worldBorder.getCenterX() * worldBorder.world.dimensionType().coordinateScale(); ++ this.newCenterZ = worldBorder.getCenterZ() * worldBorder.world.dimensionType().coordinateScale(); ++ // CraftBukkit end ++ this.oldSize = worldBorder.getSize(); ++ this.newSize = worldBorder.getLerpTarget(); ++ this.lerpTime = worldBorder.getLerpRemainingTime(); ++ this.newAbsoluteMaxSize = worldBorder.getAbsoluteMaxSize(); ++ this.warningBlocks = worldBorder.getWarningBlocks(); ++ this.warningTime = worldBorder.getWarningTime(); + } + + @Override +- @Override +- public void write(FriendlyByteBuf friendlybytebuf) { +- friendlybytebuf.writeDouble(this.newCenterX); +- friendlybytebuf.writeDouble(this.newCenterZ); +- friendlybytebuf.writeDouble(this.oldSize); +- friendlybytebuf.writeDouble(this.newSize); +- friendlybytebuf.writeVarLong(this.lerpTime); +- friendlybytebuf.writeVarInt(this.newAbsoluteMaxSize); +- friendlybytebuf.writeVarInt(this.warningBlocks); +- friendlybytebuf.writeVarInt(this.warningTime); ++ public void write(FriendlyByteBuf buffer) { ++ buffer.writeDouble(this.newCenterX); ++ buffer.writeDouble(this.newCenterZ); ++ buffer.writeDouble(this.oldSize); ++ buffer.writeDouble(this.newSize); ++ buffer.writeVarLong(this.lerpTime); ++ buffer.writeVarInt(this.newAbsoluteMaxSize); ++ buffer.writeVarInt(this.warningBlocks); ++ buffer.writeVarInt(this.warningTime); + } + +- @Override +- public void handle(ClientGamePacketListener clientgamepacketlistener) { +- clientgamepacketlistener.handleInitializeBorder(this); ++ public void handle(ClientGamePacketListener handler) { ++ handler.handleInitializeBorder(this); + } + + public double getNewCenterX() { diff --git a/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java.patch b/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java.patch new file mode 100644 index 0000000000..35b491f95b --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java.patch @@ -0,0 +1,109 @@ +--- a/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java ++++ b/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java +@@ -8,7 +8,7 @@ + import net.minecraft.network.FriendlyByteBuf; + import net.minecraft.network.protocol.Packet; + import net.minecraft.world.level.block.Block; +-import net.minecraft.world.level.block.state.BlockState; ++import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.level.chunk.LevelChunkSection; + + public class ClientboundSectionBlocksUpdatePacket implements Packet<ClientGamePacketListener> { +@@ -16,66 +16,72 @@ + private static final int POS_IN_SECTION_BITS = 12; + private final SectionPos sectionPos; + private final short[] positions; +- private final BlockState[] states; ++ private final IBlockData[] states; + +- public ClientboundSectionBlocksUpdatePacket(SectionPos sectionpos, ShortSet shortset, LevelChunkSection levelchunksection) { +- this.sectionPos = sectionpos; +- int i = shortset.size(); ++ public ClientboundSectionBlocksUpdatePacket(SectionPos sectionPos, ShortSet positions, LevelChunkSection section) { ++ this.sectionPos = sectionPos; ++ int i = positions.size(); + + this.positions = new short[i]; +- this.states = new BlockState[i]; ++ this.states = new IBlockData[i]; + int j = 0; + +- for (ShortIterator shortiterator = shortset.iterator(); shortiterator.hasNext(); ++j) { ++ for (ShortIterator shortiterator = positions.iterator(); shortiterator.hasNext(); ++j) { + 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 + ++ public ClientboundSectionBlocksUpdatePacket(FriendlyByteBuf buffer) { ++ this.sectionPos = SectionPos.of(buffer.readLong()); ++ int i = buffer.readVarInt(); ++ + this.positions = new short[i]; +- this.states = new BlockState[i]; ++ this.states = new IBlockData[i]; + + for (int j = 0; j < i; ++j) { +- long k = friendlybytebuf.readVarLong(); ++ long k = buffer.readVarLong(); + + this.positions[j] = (short) ((int) (k & 4095L)); +- this.states[j] = (BlockState) Block.BLOCK_STATE_REGISTRY.byId((int) (k >>> 12)); ++ this.states[j] = (IBlockData) Block.BLOCK_STATE_REGISTRY.byId((int) (k >>> 12)); + } + + } + + @Override +- @Override +- public void write(FriendlyByteBuf friendlybytebuf) { +- friendlybytebuf.writeLong(this.sectionPos.asLong()); +- friendlybytebuf.writeVarInt(this.positions.length); ++ public void write(FriendlyByteBuf buffer) { ++ buffer.writeLong(this.sectionPos.asLong()); ++ buffer.writeVarInt(this.positions.length); + + for (int i = 0; i < this.positions.length; ++i) { +- friendlybytebuf.writeVarLong((long) Block.getId(this.states[i]) << 12 | (long) this.positions[i]); ++ buffer.writeVarLong((long) Block.getId(this.states[i]) << 12 | (long) this.positions[i]); + } + + } + +- @Override +- public void handle(ClientGamePacketListener clientgamepacketlistener) { +- clientgamepacketlistener.handleChunkBlocksUpdate(this); ++ public void handle(ClientGamePacketListener handler) { ++ handler.handleChunkBlocksUpdate(this); + } + +- public void runUpdates(BiConsumer<BlockPos, BlockState> biconsumer) { +- BlockPos.MutableBlockPos blockpos_mutableblockpos = new BlockPos.MutableBlockPos(); ++ public void runUpdates(BiConsumer<BlockPos, IBlockData> consumer) { ++ BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(); + + for (int i = 0; i < this.positions.length; ++i) { + short short0 = this.positions[i]; + +- blockpos_mutableblockpos.set(this.sectionPos.relativeToBlockX(short0), this.sectionPos.relativeToBlockY(short0), this.sectionPos.relativeToBlockZ(short0)); +- biconsumer.accept(blockpos_mutableblockpos, this.states[i]); ++ blockposition_mutableblockposition.set(this.sectionPos.relativeToBlockX(short0), this.sectionPos.relativeToBlockY(short0), this.sectionPos.relativeToBlockZ(short0)); ++ consumer.accept(blockposition_mutableblockposition, this.states[i]); + } + + } diff --git a/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ClientboundSetBorderCenterPacket.java.patch b/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ClientboundSetBorderCenterPacket.java.patch new file mode 100644 index 0000000000..5ac38655e0 --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ClientboundSetBorderCenterPacket.java.patch @@ -0,0 +1,42 @@ +--- a/net/minecraft/network/protocol/game/ClientboundSetBorderCenterPacket.java ++++ b/net/minecraft/network/protocol/game/ClientboundSetBorderCenterPacket.java +@@ -9,26 +9,26 @@ + private final double newCenterX; + private final double newCenterZ; + +- public ClientboundSetBorderCenterPacket(WorldBorder worldborder) { +- this.newCenterX = worldborder.getCenterX(); +- this.newCenterZ = worldborder.getCenterZ(); ++ public ClientboundSetBorderCenterPacket(WorldBorder worldBorder) { ++ // CraftBukkit start - multiply out nether border ++ this.newCenterX = worldBorder.getCenterX() * (worldBorder.world != null ? worldBorder.world.dimensionType().coordinateScale() : 1.0); ++ this.newCenterZ = worldBorder.getCenterZ() * (worldBorder.world != null ? worldBorder.world.dimensionType().coordinateScale() : 1.0); ++ // CraftBukkit end + } + +- public ClientboundSetBorderCenterPacket(FriendlyByteBuf friendlybytebuf) { +- this.newCenterX = friendlybytebuf.readDouble(); +- this.newCenterZ = friendlybytebuf.readDouble(); ++ public ClientboundSetBorderCenterPacket(FriendlyByteBuf buffer) { ++ this.newCenterX = buffer.readDouble(); ++ this.newCenterZ = buffer.readDouble(); + } + + @Override +- @Override +- public void write(FriendlyByteBuf friendlybytebuf) { +- friendlybytebuf.writeDouble(this.newCenterX); +- friendlybytebuf.writeDouble(this.newCenterZ); ++ public void write(FriendlyByteBuf buffer) { ++ buffer.writeDouble(this.newCenterX); ++ buffer.writeDouble(this.newCenterZ); + } + +- @Override +- public void handle(ClientGamePacketListener clientgamepacketlistener) { +- clientgamepacketlistener.handleSetBorderCenter(this); ++ public void handle(ClientGamePacketListener handler) { ++ handler.handleSetBorderCenter(this); + } + + public double getNewCenterZ() { diff --git a/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java.patch b/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java.patch new file mode 100644 index 0000000000..0cdd79b9c8 --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java.patch @@ -0,0 +1,39 @@ +--- a/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java ++++ b/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java +@@ -1,3 +1,4 @@ ++// mc-dev import + package net.minecraft.network.protocol.game; + + import net.minecraft.network.FriendlyByteBuf; +@@ -6,24 +7,21 @@ + + public record ClientboundSystemChatPacket(Component content, boolean overlay) implements Packet<ClientGamePacketListener> { + +- public ClientboundSystemChatPacket(FriendlyByteBuf friendlybytebuf) { +- this(friendlybytebuf.readComponentTrusted(), friendlybytebuf.readBoolean()); ++ public ClientboundSystemChatPacket(FriendlyByteBuf buffer) { ++ this(buffer.readComponentTrusted(), buffer.readBoolean()); + } + + @Override +- @Override +- public void write(FriendlyByteBuf friendlybytebuf) { +- friendlybytebuf.writeComponent(this.content); +- friendlybytebuf.writeBoolean(this.overlay); ++ public void write(FriendlyByteBuf buffer) { ++ buffer.writeComponent(this.content); ++ buffer.writeBoolean(this.overlay); + } + +- @Override +- public void handle(ClientGamePacketListener clientgamepacketlistener) { +- clientgamepacketlistener.handleSystemChat(this); ++ public void handle(ClientGamePacketListener handler) { ++ handler.handleSystemChat(this); + } + + @Override +- @Override + public boolean isSkippable() { + return true; + } diff --git a/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ServerboundUseItemOnPacket.java.patch b/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ServerboundUseItemOnPacket.java.patch new file mode 100644 index 0000000000..b1f7aa6e0c --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ServerboundUseItemOnPacket.java.patch @@ -0,0 +1,63 @@ +--- a/net/minecraft/network/protocol/game/ServerboundUseItemOnPacket.java ++++ b/net/minecraft/network/protocol/game/ServerboundUseItemOnPacket.java +@@ -1,42 +1,41 @@ ++// mc-dev import + package net.minecraft.network.protocol.game; + + import net.minecraft.network.FriendlyByteBuf; + import net.minecraft.network.protocol.Packet; +-import net.minecraft.world.InteractionHand; ++import net.minecraft.world.EnumHand; + import net.minecraft.world.phys.BlockHitResult; + + public class ServerboundUseItemOnPacket implements Packet<ServerGamePacketListener> { + + private final BlockHitResult blockHit; +- private final InteractionHand hand; ++ private final EnumHand hand; + private final int sequence; + +- public ServerboundUseItemOnPacket(InteractionHand interactionhand, BlockHitResult blockhitresult, int i) { +- this.hand = interactionhand; +- this.blockHit = blockhitresult; +- this.sequence = i; ++ public ServerboundUseItemOnPacket(EnumHand hand, BlockHitResult blockHit, int sequence) { ++ this.hand = hand; ++ this.blockHit = blockHit; ++ this.sequence = sequence; + } + +- public ServerboundUseItemOnPacket(FriendlyByteBuf friendlybytebuf) { +- this.hand = (InteractionHand) friendlybytebuf.readEnum(InteractionHand.class); +- this.blockHit = friendlybytebuf.readBlockHitResult(); +- this.sequence = friendlybytebuf.readVarInt(); ++ public ServerboundUseItemOnPacket(FriendlyByteBuf buffer) { ++ this.hand = (EnumHand) buffer.readEnum(EnumHand.class); ++ this.blockHit = buffer.readBlockHitResult(); ++ this.sequence = buffer.readVarInt(); + } + + @Override +- @Override +- public void write(FriendlyByteBuf friendlybytebuf) { +- friendlybytebuf.writeEnum(this.hand); +- friendlybytebuf.writeBlockHitResult(this.blockHit); +- friendlybytebuf.writeVarInt(this.sequence); ++ public void write(FriendlyByteBuf buffer) { ++ buffer.writeEnum(this.hand); ++ buffer.writeBlockHitResult(this.blockHit); ++ buffer.writeVarInt(this.sequence); + } + +- @Override +- public void handle(ServerGamePacketListener servergamepacketlistener) { +- servergamepacketlistener.handleUseItemOn(this); ++ public void handle(ServerGamePacketListener handler) { ++ handler.handleUseItemOn(this); + } + +- public InteractionHand getHand() { ++ public EnumHand getHand() { + return this.hand; + } + diff --git a/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ServerboundUseItemPacket.java.patch b/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ServerboundUseItemPacket.java.patch new file mode 100644 index 0000000000..09f410f55b --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/network/protocol/game/ServerboundUseItemPacket.java.patch @@ -0,0 +1,55 @@ +--- a/net/minecraft/network/protocol/game/ServerboundUseItemPacket.java ++++ b/net/minecraft/network/protocol/game/ServerboundUseItemPacket.java +@@ -1,37 +1,36 @@ ++// mc-dev import + package net.minecraft.network.protocol.game; + + import net.minecraft.network.FriendlyByteBuf; + import net.minecraft.network.protocol.Packet; +-import net.minecraft.world.InteractionHand; ++import net.minecraft.world.EnumHand; + + public class ServerboundUseItemPacket implements Packet<ServerGamePacketListener> { + +- private final InteractionHand hand; ++ private final EnumHand hand; + private final int sequence; + +- public ServerboundUseItemPacket(InteractionHand interactionhand, int i) { +- this.hand = interactionhand; +- this.sequence = i; ++ public ServerboundUseItemPacket(EnumHand hand, int sequence) { ++ this.hand = hand; ++ this.sequence = sequence; + } + +- public ServerboundUseItemPacket(FriendlyByteBuf friendlybytebuf) { +- this.hand = (InteractionHand) friendlybytebuf.readEnum(InteractionHand.class); +- this.sequence = friendlybytebuf.readVarInt(); ++ public ServerboundUseItemPacket(FriendlyByteBuf buffer) { ++ this.hand = (EnumHand) buffer.readEnum(EnumHand.class); ++ this.sequence = buffer.readVarInt(); + } + + @Override +- @Override +- public void write(FriendlyByteBuf friendlybytebuf) { +- friendlybytebuf.writeEnum(this.hand); +- friendlybytebuf.writeVarInt(this.sequence); ++ public void write(FriendlyByteBuf buffer) { ++ buffer.writeEnum(this.hand); ++ buffer.writeVarInt(this.sequence); + } + +- @Override +- public void handle(ServerGamePacketListener servergamepacketlistener) { +- servergamepacketlistener.handleUseItem(this); ++ public void handle(ServerGamePacketListener handler) { ++ handler.handleUseItem(this); + } + +- public InteractionHand getHand() { ++ public EnumHand getHand() { + return this.hand; + } + |