Update to Minecraft 1.19.1

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2022-07-28 04:00:00 +10:00
parent 7c33b52741
commit f8db65033c
41 changed files with 654 additions and 579 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/network/NetworkManager.java
+++ b/net/minecraft/network/NetworkManager.java
@@ -168,7 +168,7 @@
@@ -164,7 +164,7 @@
}
private static <T extends PacketListener> void genericsFtw(Packet<T> packet, PacketListener packetlistener) {
@@ -9,7 +9,7 @@
}
public void setListener(PacketListener packetlistener) {
@@ -280,7 +280,7 @@
@@ -289,7 +289,7 @@
public void disconnect(IChatBaseComponent ichatbasecomponent) {
if (this.channel.isOpen()) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/network/chat/ChatHexColor.java
+++ b/net/minecraft/network/chat/ChatHexColor.java
@@ -19,7 +19,7 @@
@@ -20,7 +20,7 @@
return chathexcolor != null ? DataResult.success(chathexcolor) : DataResult.error("String is not a valid color name or hex color code");
}, 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) -> {
@@ -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;
@@ -27,16 +27,22 @@
@@ -28,16 +28,22 @@
private final int value;
@Nullable
public final String name;

View File

@@ -0,0 +1,30 @@
--- a/net/minecraft/network/chat/ChatMessageType.java
+++ b/net/minecraft/network/chat/ChatMessageType.java
@@ -2,6 +2,7 @@
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
+import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
import net.minecraft.commands.CommandListenerWrapper;
@@ -27,6 +28,7 @@
public static final ResourceKey<ChatMessageType> TEAM_MSG_COMMAND_INCOMING = create("team_msg_command_incoming");
public static final ResourceKey<ChatMessageType> TEAM_MSG_COMMAND_OUTGOING = create("team_msg_command_outgoing");
public static final ResourceKey<ChatMessageType> EMOTE_COMMAND = create("emote_command");
+ public static final ResourceKey<ChatMessageType> RAW = create("raw"); // CraftBukkit
private static ResourceKey<ChatMessageType> create(String s) {
return ResourceKey.create(IRegistry.CHAT_TYPE_REGISTRY, new MinecraftKey(s));
@@ -39,7 +41,10 @@
RegistryGeneration.register(iregistry, ChatMessageType.MSG_COMMAND_OUTGOING, new ChatMessageType(ChatDecoration.outgoingDirectMessage("commands.message.display.outgoing"), ChatDecoration.withSender("chat.type.text.narrate")));
RegistryGeneration.register(iregistry, ChatMessageType.TEAM_MSG_COMMAND_INCOMING, new ChatMessageType(ChatDecoration.teamMessage("chat.type.team.text"), ChatDecoration.withSender("chat.type.text.narrate")));
RegistryGeneration.register(iregistry, ChatMessageType.TEAM_MSG_COMMAND_OUTGOING, new ChatMessageType(ChatDecoration.teamMessage("chat.type.team.sent"), ChatDecoration.withSender("chat.type.text.narrate")));
- return RegistryGeneration.register(iregistry, ChatMessageType.EMOTE_COMMAND, new ChatMessageType(ChatDecoration.withSender("chat.type.emote"), ChatDecoration.withSender("chat.type.emote")));
+ // CraftBukkit start
+ RegistryGeneration.register(iregistry, ChatMessageType.EMOTE_COMMAND, new ChatMessageType(ChatDecoration.withSender("chat.type.emote"), ChatDecoration.withSender("chat.type.emote")));
+ return RegistryGeneration.register(iregistry, ChatMessageType.RAW, new ChatMessageType(new ChatDecoration("%s", List.of(ChatDecoration.a.CONTENT), ChatModifier.EMPTY), new ChatDecoration("%s", List.of(ChatDecoration.a.CONTENT), ChatModifier.EMPTY)));
+ // CraftBukkit end
}
public static ChatMessageType.a bind(ResourceKey<ChatMessageType> resourcekey, Entity entity) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/network/chat/IChatBaseComponent.java
+++ b/net/minecraft/network/chat/IChatBaseComponent.java
@@ -40,7 +40,23 @@
@@ -41,7 +41,23 @@
import net.minecraft.util.ChatTypeAdapterFactory;
import net.minecraft.util.FormattedString;

View File

@@ -4,4 +4,4 @@
+// mc-dev import
package net.minecraft.network.protocol.game;
import java.util.Objects;
import net.minecraft.network.PacketDataSerializer;

View File

@@ -1,11 +0,0 @@
--- a/net/minecraft/network/protocol/game/PacketPlayInChat.java
+++ b/net/minecraft/network/protocol/game/PacketPlayInChat.java
@@ -25,7 +25,7 @@
}
public PacketPlayInChat(PacketDataSerializer packetdataserializer) {
- this.message = packetdataserializer.readUtf(256);
+ this.message = org.apache.commons.lang3.StringUtils.normalizeSpace(packetdataserializer.readUtf(256)); // CraftBukkit - see PlayerConnection
this.timeStamp = packetdataserializer.readInstant();
this.saltSignature = new MinecraftEncryption.b(packetdataserializer);
this.signedPreview = packetdataserializer.readBoolean();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/network/syncher/DataWatcher.java
+++ b/net/minecraft/network/syncher/DataWatcher.java
@@ -141,6 +141,13 @@
@@ -142,6 +142,13 @@
}
@@ -14,9 +14,9 @@
public boolean isDirty() {
return this.isDirty;
}
@@ -273,7 +280,7 @@
@@ -274,7 +281,7 @@
if (!Objects.equals(datawatcher_item1.accessor.getSerializer(), datawatcher_item.accessor.getSerializer())) {
throw new IllegalStateException(String.format("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_item1.value, datawatcher_item1.value.getClass()));
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_item1.value, datawatcher_item1.value.getClass()));
} else {
- datawatcher_item.setValue(datawatcher_item1.getValue());
+ datawatcher_item.setValue((T) datawatcher_item1.getValue()); // CraftBukkit - decompile error