Move CraftBukkit per-file patches

By: Initial <noreply+automated@papermc.io>
This commit is contained in:
CraftBukkit/Spigot
2024-12-11 22:26:36 +01:00
parent a4de181b77
commit a265d64138
583 changed files with 71 additions and 857 deletions

View File

@@ -0,0 +1,15 @@
--- a/net/minecraft/network/protocol/game/ClientboundInitializeBorderPacket.java
+++ b/net/minecraft/network/protocol/game/ClientboundInitializeBorderPacket.java
@@ -30,8 +30,10 @@
}
public ClientboundInitializeBorderPacket(WorldBorder worldborder) {
- this.newCenterX = worldborder.getCenterX();
- this.newCenterZ = worldborder.getCenterZ();
+ // 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();

View File

@@ -0,0 +1,15 @@
--- a/net/minecraft/network/protocol/game/ClientboundSetBorderCenterPacket.java
+++ b/net/minecraft/network/protocol/game/ClientboundSetBorderCenterPacket.java
@@ -13,8 +13,10 @@
private final double newCenterZ;
public ClientboundSetBorderCenterPacket(WorldBorder worldborder) {
- this.newCenterX = worldborder.getCenterX();
- this.newCenterZ = worldborder.getCenterZ();
+ // 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
}
private ClientboundSetBorderCenterPacket(PacketDataSerializer packetdataserializer) {

View File

@@ -0,0 +1,7 @@
--- 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.RegistryFriendlyByteBuf;

View File

@@ -0,0 +1,7 @@
--- a/net/minecraft/network/protocol/game/PacketPlayInBlockPlace.java
+++ b/net/minecraft/network/protocol/game/PacketPlayInBlockPlace.java
@@ -1,3 +1,4 @@
+// mc-dev import
package net.minecraft.network.protocol.game;
import net.minecraft.network.PacketDataSerializer;

View File

@@ -0,0 +1,7 @@
--- a/net/minecraft/network/protocol/game/PacketPlayInUseItem.java
+++ b/net/minecraft/network/protocol/game/PacketPlayInUseItem.java
@@ -1,3 +1,4 @@
+// mc-dev import
package net.minecraft.network.protocol.game;
import net.minecraft.network.PacketDataSerializer;

View File

@@ -0,0 +1,23 @@
--- a/net/minecraft/network/protocol/game/PacketPlayOutMultiBlockChange.java
+++ b/net/minecraft/network/protocol/game/PacketPlayOutMultiBlockChange.java
@@ -33,11 +33,19 @@
short short0 = (Short) shortiterator.next();
this.positions[j] = short0;
- this.states[j] = chunksection.getBlockState(SectionPosition.sectionRelativeX(short0), SectionPosition.sectionRelativeY(short0), SectionPosition.sectionRelativeZ(short0));
+ this.states[j] = (chunksection != null) ? chunksection.getBlockState(SectionPosition.sectionRelativeX(short0), SectionPosition.sectionRelativeY(short0), SectionPosition.sectionRelativeZ(short0)) : net.minecraft.world.level.block.Blocks.AIR.defaultBlockState(); // CraftBukkit - SPIGOT-6076, Mojang bug when empty chunk section notified
}
}
+ // CraftBukkit start - Add constructor
+ public PacketPlayOutMultiBlockChange(SectionPosition sectionposition, ShortSet shortset, IBlockData[] states) {
+ this.sectionPos = sectionposition;
+ this.positions = shortset.toShortArray();
+ this.states = states;
+ }
+ // CraftBukkit end
+
private PacketPlayOutMultiBlockChange(PacketDataSerializer packetdataserializer) {
this.sectionPos = SectionPosition.of(packetdataserializer.readLong());
int i = packetdataserializer.readVarInt();