Update to Minecraft 1.19.4

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2023-03-15 03:30:00 +11:00
parent 90a887a912
commit 40076782ed
227 changed files with 2788 additions and 1621 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/network/NetworkManager.java
+++ b/net/minecraft/network/NetworkManager.java
@@ -84,6 +84,7 @@
@@ -86,6 +86,7 @@
private float averageSentPackets;
private int tickCount;
private boolean handlingFault;
@@ -8,7 +8,7 @@
public NetworkManager(EnumProtocolDirection enumprotocoldirection) {
this.receiving = enumprotocoldirection;
@@ -164,7 +165,7 @@
@@ -167,7 +168,7 @@
}
private static <T extends PacketListener> void genericsFtw(Packet<T> packet, PacketListener packetlistener) {
@@ -17,7 +17,7 @@
}
public void setListener(PacketListener packetlistener) {
@@ -289,7 +290,7 @@
@@ -296,7 +297,7 @@
public void disconnect(IChatBaseComponent ichatbasecomponent) {
if (this.channel.isOpen()) {

View File

@@ -1,15 +1,15 @@
--- a/net/minecraft/network/PacketDataSerializer.java
+++ b/net/minecraft/network/PacketDataSerializer.java
@@ -74,6 +74,8 @@
import net.minecraft.world.phys.MovingObjectPositionBlock;
import net.minecraft.world.phys.Vec3D;
@@ -81,6 +81,8 @@
import org.joml.Quaternionf;
import org.joml.Vector3f;
+import org.bukkit.craftbukkit.inventory.CraftItemStack; // CraftBukkit
+
public class PacketDataSerializer extends ByteBuf {
private static final int MAX_VARINT_SIZE = 5;
@@ -195,7 +197,7 @@
@@ -220,7 +222,7 @@
public <T, C extends Collection<T>> C readCollection(IntFunction<C> intfunction, PacketDataSerializer.a<T> packetdataserializer_a) {
int i = this.readVarInt();
@@ -18,7 +18,7 @@
for (int j = 0; j < i; ++j) {
c0.add(packetdataserializer_a.apply(this));
@@ -206,7 +208,7 @@
@@ -231,7 +233,7 @@
public <T> void writeCollection(Collection<T> collection, PacketDataSerializer.b<T> packetdataserializer_b) {
this.writeVarInt(collection.size());
@@ -27,7 +27,7 @@
while (iterator.hasNext()) {
T t0 = iterator.next();
@@ -233,12 +235,12 @@
@@ -258,12 +260,12 @@
public void writeIntIdList(IntList intlist) {
this.writeVarInt(intlist.size());
@@ -42,7 +42,7 @@
for (int j = 0; j < i; ++j) {
K k0 = packetdataserializer_a.apply(this);
@@ -272,7 +274,7 @@
@@ -297,7 +299,7 @@
}
public <E extends Enum<E>> void writeEnumSet(EnumSet<E> enumset, Class<E> oclass) {
@@ -51,7 +51,7 @@
BitSet bitset = new BitSet(ae.length);
for (int i = 0; i < ae.length; ++i) {
@@ -283,7 +285,7 @@
@@ -308,7 +310,7 @@
}
public <E extends Enum<E>> EnumSet<E> readEnumSet(Class<E> oclass) {
@@ -60,7 +60,7 @@
BitSet bitset = this.readFixedBitSet(ae.length);
EnumSet<E> enumset = EnumSet.noneOf(oclass);
@@ -499,7 +501,7 @@
@@ -545,7 +547,7 @@
}
public <T extends Enum<T>> T readEnum(Class<T> oclass) {
@@ -69,7 +69,7 @@
}
public PacketDataSerializer writeEnum(Enum<?> oenum) {
@@ -576,7 +578,7 @@
@@ -622,7 +624,7 @@
} else {
try {
NBTCompressedStreamTools.write(nbttagcompound, (DataOutput) (new ByteBufOutputStream(this)));
@@ -78,7 +78,7 @@
throw new EncoderException(ioexception);
}
}
@@ -613,7 +615,7 @@
@@ -659,7 +661,7 @@
}
public PacketDataSerializer writeItem(ItemStack itemstack) {
@@ -87,7 +87,7 @@
this.writeBoolean(false);
} else {
this.writeBoolean(true);
@@ -642,6 +644,11 @@
@@ -688,6 +690,11 @@
ItemStack itemstack = new ItemStack(item, b0);
itemstack.setTag(this.readNbt());

View File

@@ -1,7 +1,7 @@
--- a/net/minecraft/network/chat/ChatHexColor.java
+++ b/net/minecraft/network/chat/ChatHexColor.java
@@ -20,7 +20,7 @@
return chathexcolor != null ? DataResult.success(chathexcolor) : DataResult.error("String is not a valid color name or hex color code");
@@ -22,7 +22,7 @@
});
}, ChatHexColor::serialize);
private static final Map<EnumChatFormat, ChatHexColor> LEGACY_FORMAT_TO_COLOR = (Map) Stream.of(EnumChatFormat.values()).filter(EnumChatFormat::isColor).collect(ImmutableMap.toImmutableMap(Function.identity(), (enumchatformat) -> {
- return new ChatHexColor(enumchatformat.getColor(), enumchatformat.getName());
@@ -9,7 +9,7 @@
}));
private static final Map<String, ChatHexColor> NAMED_COLORS = (Map) ChatHexColor.LEGACY_FORMAT_TO_COLOR.values().stream().collect(ImmutableMap.toImmutableMap((chathexcolor) -> {
return chathexcolor.name;
@@ -28,16 +28,22 @@
@@ -30,16 +30,22 @@
private final int value;
@Nullable
public final String name;

View File

@@ -17,7 +17,7 @@
if (!iasynctaskhandler.isSameThread()) {
iasynctaskhandler.executeIfPossible(() -> {
+ if (MinecraftServer.getServer().hasStopped() || (t0 instanceof PlayerConnection && ((PlayerConnection) t0).processedDisconnect)) return; // CraftBukkit, MC-142590
if (t0.getConnection().isConnected()) {
if (t0.isAcceptingMessages()) {
try {
packet.handle(t0);
@@ -36,6 +42,10 @@

View File

@@ -12,7 +12,7 @@
public class DataWatcher {
private static final Logger LOGGER = LogUtils.getLogger();
@@ -138,6 +143,13 @@
@@ -142,6 +147,13 @@
}
@@ -26,7 +26,7 @@
public boolean isDirty() {
return this.isDirty;
}
@@ -218,7 +230,7 @@
@@ -223,7 +235,7 @@
if (!Objects.equals(datawatcher_b.serializer(), datawatcher_item.accessor.getSerializer())) {
throw new IllegalStateException(String.format(Locale.ROOT, "Invalid entity data item type for field %d on entity %s: old=%s(%s), new=%s(%s)", datawatcher_item.accessor.getId(), this.entity, datawatcher_item.value, datawatcher_item.value.getClass(), datawatcher_b.value, datawatcher_b.value.getClass()));
} else {
@@ -35,7 +35,7 @@
}
}
@@ -226,6 +238,18 @@
@@ -231,6 +243,18 @@
return this.itemsById.isEmpty();
}
@@ -54,7 +54,7 @@
public static class Item<T> {
final DataWatcherObject<T> accessor;
@@ -268,7 +292,7 @@
@@ -273,7 +297,7 @@
}
}