diff options
Diffstat (limited to 'patches/server')
13 files changed, 137 insertions, 128 deletions
diff --git a/patches/server/0012-Adventure.patch b/patches/server/0012-Adventure.patch index 6d6a1e0f6c..f07557f17e 100644 --- a/patches/server/0012-Adventure.patch +++ b/patches/server/0012-Adventure.patch @@ -26,7 +26,7 @@ index 756a2ab6ad416f55fa3864cff9818473840b04fc..701a2ffd04df48d437b2cb963dd150af } diff --git a/src/main/java/io/papermc/paper/adventure/AdventureComponent.java b/src/main/java/io/papermc/paper/adventure/AdventureComponent.java new file mode 100644 -index 0000000000000000000000000000000000000000..e597a90def72c5903382d7169fb7a2fb667b8a69 +index 0000000000000000000000000000000000000000..85546e1ac1d1ed7f70c3c0a1bf49937f865ad091 --- /dev/null +++ b/src/main/java/io/papermc/paper/adventure/AdventureComponent.java @@ -0,0 +1,82 @@ @@ -43,27 +43,27 @@ index 0000000000000000000000000000000000000000..e597a90def72c5903382d7169fb7a2fb +import net.minecraft.network.chat.Style; +import net.minecraft.util.FormattedCharSequence; +import org.checkerframework.checker.nullness.qual.MonotonicNonNull; -+import org.checkerframework.checker.nullness.qual.Nullable; ++import org.jetbrains.annotations.Nullable; + +public final class AdventureComponent implements net.minecraft.network.chat.Component { -+ final Component wrapped; -+ private net.minecraft.network.chat.@MonotonicNonNull Component converted; ++ final Component adventure; ++ private net.minecraft.network.chat.@MonotonicNonNull Component vanilla; + -+ public AdventureComponent(final Component wrapped) { -+ this.wrapped = wrapped; ++ public AdventureComponent(final Component adventure) { ++ this.adventure = adventure; + } + + public net.minecraft.network.chat.Component deepConverted() { -+ net.minecraft.network.chat.Component converted = this.converted; -+ if (converted == null) { -+ converted = PaperAdventure.WRAPPER_AWARE_SERIALIZER.serialize(this.wrapped); -+ this.converted = converted; ++ net.minecraft.network.chat.Component vanilla = this.vanilla; ++ if (vanilla == null) { ++ vanilla = PaperAdventure.WRAPPER_AWARE_SERIALIZER.serialize(this.adventure); ++ this.vanilla = vanilla; + } -+ return converted; ++ return vanilla; + } + + public net.minecraft.network.chat.@Nullable Component deepConvertedIfPresent() { -+ return this.converted; ++ return this.vanilla; + } + + @Override @@ -73,8 +73,8 @@ index 0000000000000000000000000000000000000000..e597a90def72c5903382d7169fb7a2fb + + @Override + public String getContents() { -+ if (this.wrapped instanceof TextComponent) { -+ return ((TextComponent) this.wrapped).content(); ++ if (this.adventure instanceof TextComponent) { ++ return ((TextComponent) this.adventure).content(); + } else { + return this.deepConverted().getContents(); + } @@ -82,7 +82,7 @@ index 0000000000000000000000000000000000000000..e597a90def72c5903382d7169fb7a2fb + + @Override + public String getString() { -+ return PaperAdventure.PLAIN.serialize(this.wrapped); ++ return PaperAdventure.PLAIN.serialize(this.adventure); + } + + @Override @@ -108,7 +108,7 @@ index 0000000000000000000000000000000000000000..e597a90def72c5903382d7169fb7a2fb + public static class Serializer implements JsonSerializer<AdventureComponent> { + @Override + public JsonElement serialize(final AdventureComponent src, final Type type, final JsonSerializationContext context) { -+ return PaperAdventure.GSON.serializer().toJsonTree(src.wrapped, Component.class); ++ return PaperAdventure.GSON.serializer().toJsonTree(src.adventure, Component.class); + } + } +} @@ -502,10 +502,10 @@ index 0000000000000000000000000000000000000000..eeedc30a45d9637d68f04f185b3dd90d +} diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java new file mode 100644 -index 0000000000000000000000000000000000000000..f763a3ea5796737304e0c1f41349622e1d7adadf +index 0000000000000000000000000000000000000000..f506244b4917b362a954d2bf73ba0b5f46c96843 --- /dev/null +++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java -@@ -0,0 +1,381 @@ +@@ -0,0 +1,359 @@ +package io.papermc.paper.adventure; + +import com.mojang.brigadier.exceptions.CommandSyntaxException; @@ -527,7 +527,7 @@ index 0000000000000000000000000000000000000000..f763a3ea5796737304e0c1f41349622e +import net.kyori.adventure.text.format.TextColor; +import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; +import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; -+import net.kyori.adventure.text.serializer.plain.PlainComponentSerializer; ++import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; +import net.kyori.adventure.translation.GlobalTranslator; +import net.kyori.adventure.translation.TranslationRegistry; +import net.kyori.adventure.translation.Translator; @@ -544,8 +544,8 @@ index 0000000000000000000000000000000000000000..f763a3ea5796737304e0c1f41349622e +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.WrittenBookItem; +import org.bukkit.ChatColor; -+import org.checkerframework.checker.nullness.qual.NonNull; -+import org.checkerframework.checker.nullness.qual.Nullable; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public final class PaperAdventure { + public static final AttributeKey<Locale> LOCALE_ATTRIBUTE = AttributeKey.valueOf("adventure:locale"); @@ -560,7 +560,7 @@ index 0000000000000000000000000000000000000000..f763a3ea5796737304e0c1f41349622e + } + } + } -+ final @NonNull String translated = Language.getInstance().getOrDefault(translatable.key()); ++ final @NotNull String translated = Language.getInstance().getOrDefault(translatable.key()); + + final Matcher matcher = LOCALIZATION_PATTERN.matcher(translated); + final List<Component> args = translatable.args(); @@ -599,7 +599,7 @@ index 0000000000000000000000000000000000000000..f763a3ea5796737304e0c1f41349622e + }) + .build(); + public static final LegacyComponentSerializer LEGACY_SECTION_UXRC = LegacyComponentSerializer.builder().flattener(FLATTENER).hexColors().useUnusualXRepeatedCharacterHexFormat().build(); -+ public static final PlainComponentSerializer PLAIN = PlainComponentSerializer.builder().flattener(FLATTENER).build(); ++ public static final PlainTextComponentSerializer PLAIN = PlainTextComponentSerializer.builder().flattener(FLATTENER).build(); + public static final GsonComponentSerializer GSON = GsonComponentSerializer.builder() + .legacyHoverEventSerializer(NBTLegacyHoverEventSerializer.INSTANCE) + .build(); @@ -609,7 +609,7 @@ index 0000000000000000000000000000000000000000..f763a3ea5796737304e0c1f41349622e + .build(); + private static final Codec<CompoundTag, String, IOException, IOException> NBT_CODEC = new Codec<CompoundTag, String, IOException, IOException>() { + @Override -+ public @NonNull CompoundTag decode(final @NonNull String encoded) throws IOException { ++ public @NotNull CompoundTag decode(final @NotNull String encoded) throws IOException { + try { + return TagParser.parseTag(encoded); + } catch (final CommandSyntaxException e) { @@ -618,7 +618,7 @@ index 0000000000000000000000000000000000000000..f763a3ea5796737304e0c1f41349622e + } + + @Override -+ public @NonNull String encode(final @NonNull CompoundTag decoded) { ++ public @NotNull String encode(final @NotNull CompoundTag decoded) { + return decoded.toString(); + } + }; @@ -671,6 +671,7 @@ index 0000000000000000000000000000000000000000..f763a3ea5796737304e0c1f41349622e + } + + public static net.minecraft.network.chat.Component asVanilla(final Component component) { ++ if (component == null) return null; + if (true) return new AdventureComponent(component); + return net.minecraft.network.chat.Component.Serializer.fromJson(GSON.serializer().toJsonTree(component)); + } @@ -697,7 +698,7 @@ index 0000000000000000000000000000000000000000..f763a3ea5796737304e0c1f41349622e + + public static String asJsonString(final net.minecraft.network.chat.Component component, final Locale locale) { + if (component instanceof AdventureComponent) { -+ return asJsonString(((AdventureComponent) component).wrapped, locale); ++ return asJsonString(((AdventureComponent) component).adventure, locale); + } + return net.minecraft.network.chat.Component.Serializer.toJson(component); + } @@ -722,71 +723,47 @@ index 0000000000000000000000000000000000000000..f763a3ea5796737304e0c1f41349622e + // BossBar + + public static BossEvent.BossBarColor asVanilla(final BossBar.Color color) { -+ if (color == BossBar.Color.PINK) { -+ return BossEvent.BossBarColor.PINK; -+ } else if (color == BossBar.Color.BLUE) { -+ return BossEvent.BossBarColor.BLUE; -+ } else if (color == BossBar.Color.RED) { -+ return BossEvent.BossBarColor.RED; -+ } else if (color == BossBar.Color.GREEN) { -+ return BossEvent.BossBarColor.GREEN; -+ } else if (color == BossBar.Color.YELLOW) { -+ return BossEvent.BossBarColor.YELLOW; -+ } else if (color == BossBar.Color.PURPLE) { -+ return BossEvent.BossBarColor.PURPLE; -+ } else if (color == BossBar.Color.WHITE) { -+ return BossEvent.BossBarColor.WHITE; -+ } -+ throw new IllegalArgumentException(color.name()); ++ return switch (color) { ++ case PINK -> BossEvent.BossBarColor.PINK; ++ case BLUE -> BossEvent.BossBarColor.BLUE; ++ case RED -> BossEvent.BossBarColor.RED; ++ case GREEN -> BossEvent.BossBarColor.GREEN; ++ case YELLOW -> BossEvent.BossBarColor.YELLOW; ++ case PURPLE -> BossEvent.BossBarColor.PURPLE; ++ case WHITE -> BossEvent.BossBarColor.WHITE; ++ }; + } + + public static BossBar.Color asAdventure(final BossEvent.BossBarColor color) { -+ if(color == BossEvent.BossBarColor.PINK) { -+ return BossBar.Color.PINK; -+ } else if(color == BossEvent.BossBarColor.BLUE) { -+ return BossBar.Color.BLUE; -+ } else if(color == BossEvent.BossBarColor.RED) { -+ return BossBar.Color.RED; -+ } else if(color == BossEvent.BossBarColor.GREEN) { -+ return BossBar.Color.GREEN; -+ } else if(color == BossEvent.BossBarColor.YELLOW) { -+ return BossBar.Color.YELLOW; -+ } else if(color == BossEvent.BossBarColor.PURPLE) { -+ return BossBar.Color.PURPLE; -+ } else if(color == BossEvent.BossBarColor.WHITE) { -+ return BossBar.Color.WHITE; -+ } -+ throw new IllegalArgumentException(color.name()); ++ return switch (color) { ++ case PINK -> BossBar.Color.PINK; ++ case BLUE -> BossBar.Color.BLUE; ++ case RED -> BossBar.Color.RED; ++ case GREEN -> BossBar.Color.GREEN; ++ case YELLOW -> BossBar.Color.YELLOW; ++ case PURPLE -> BossBar.Color.PURPLE; ++ case WHITE -> BossBar.Color.WHITE; ++ }; + } + + public static BossEvent.BossBarOverlay asVanilla(final BossBar.Overlay overlay) { -+ if (overlay == BossBar.Overlay.PROGRESS) { -+ return BossEvent.BossBarOverlay.PROGRESS; -+ } else if (overlay == BossBar.Overlay.NOTCHED_6) { -+ return BossEvent.BossBarOverlay.NOTCHED_6; -+ } else if (overlay == BossBar.Overlay.NOTCHED_10) { -+ return BossEvent.BossBarOverlay.NOTCHED_10; -+ } else if (overlay == BossBar.Overlay.NOTCHED_12) { -+ return BossEvent.BossBarOverlay.NOTCHED_12; -+ } else if (overlay == BossBar.Overlay.NOTCHED_20) { -+ return BossEvent.BossBarOverlay.NOTCHED_20; -+ } -+ throw new IllegalArgumentException(overlay.name()); ++ return switch (overlay) { ++ case PROGRESS -> BossEvent.BossBarOverlay.PROGRESS; ++ case NOTCHED_6 -> BossEvent.BossBarOverlay.NOTCHED_6; ++ case NOTCHED_10 -> BossEvent.BossBarOverlay.NOTCHED_10; ++ case NOTCHED_12 -> BossEvent.BossBarOverlay.NOTCHED_12; ++ case NOTCHED_20 -> BossEvent.BossBarOverlay.NOTCHED_20; ++ }; + } + + public static BossBar.Overlay asAdventure(final BossEvent.BossBarOverlay overlay) { -+ if (overlay == BossEvent.BossBarOverlay.PROGRESS) { -+ return BossBar.Overlay.PROGRESS; -+ } else if (overlay == BossEvent.BossBarOverlay.NOTCHED_6) { -+ return BossBar.Overlay.NOTCHED_6; -+ } else if (overlay == BossEvent.BossBarOverlay.NOTCHED_10) { -+ return BossBar.Overlay.NOTCHED_10; -+ } else if (overlay == BossEvent.BossBarOverlay.NOTCHED_12) { -+ return BossBar.Overlay.NOTCHED_12; -+ } else if (overlay == BossEvent.BossBarOverlay.NOTCHED_20) { -+ return BossBar.Overlay.NOTCHED_20; -+ } -+ throw new IllegalArgumentException(overlay.name()); ++ return switch (overlay) { ++ case PROGRESS -> BossBar.Overlay.PROGRESS; ++ case NOTCHED_6 -> BossBar.Overlay.NOTCHED_6; ++ case NOTCHED_10 -> BossBar.Overlay.NOTCHED_10; ++ case NOTCHED_12 -> BossBar.Overlay.NOTCHED_12; ++ case NOTCHED_20 -> BossBar.Overlay.NOTCHED_20; ++ }; + } + + public static void setFlag(final BossBar bar, final BossBar.Flag flag, final boolean value) { @@ -876,14 +853,15 @@ index 0000000000000000000000000000000000000000..f763a3ea5796737304e0c1f41349622e + + // Colors + -+ public static @NonNull TextColor asAdventure(ChatFormatting minecraftColor) { -+ if (minecraftColor.getColor() == null) { ++ public static @NotNull TextColor asAdventure(final ChatFormatting formatting) { ++ final Integer color = formatting.getColor(); ++ if (color == null) { + throw new IllegalArgumentException("Not a valid color"); + } -+ return TextColor.color(minecraftColor.getColor()); ++ return TextColor.color(color); + } + -+ public static @Nullable ChatFormatting asVanilla(TextColor color) { ++ public static @Nullable ChatFormatting asVanilla(final TextColor color) { + return ChatFormatting.getByHexValue(color.value()); + } +} @@ -939,7 +917,7 @@ index 0000000000000000000000000000000000000000..7493efba31403cbe7f26e493f165f1b8 +} diff --git a/src/main/java/io/papermc/paper/adventure/WrapperAwareSerializer.java b/src/main/java/io/papermc/paper/adventure/WrapperAwareSerializer.java new file mode 100644 -index 0000000000000000000000000000000000000000..6b202f4b3ddbe1f5dde188136f39414dc68ae4e4 +index 0000000000000000000000000000000000000000..76be058996599dd798d26a166d1a5139ee72761a --- /dev/null +++ b/src/main/java/io/papermc/paper/adventure/WrapperAwareSerializer.java @@ -0,0 +1,19 @@ @@ -952,7 +930,7 @@ index 0000000000000000000000000000000000000000..6b202f4b3ddbe1f5dde188136f39414d + @Override + public Component deserialize(final net.minecraft.network.chat.Component input) { + if (input instanceof AdventureComponent) { -+ return ((AdventureComponent) input).wrapped; ++ return ((AdventureComponent) input).adventure; + } + return PaperAdventure.GSON.serializer().fromJson(net.minecraft.network.chat.Component.Serializer.toJsonTree(input), Component.class); + } @@ -2368,7 +2346,7 @@ index 446fdca49a5a6999626a7ee3a1d5c168b15a09dd..f9863e138994f6c7a7975a852f106faa public boolean isOp() { return true; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index bfb1ced180ff4943ba15eb16f01530cd1b5b8a90..10e23477f58c7189dee1b3c06a21d656c9b50e82 100644 +index bfb1ced180ff4943ba15eb16f01530cd1b5b8a90..b62ddd41236b6561672eeedf4bbdd4fa220130e7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -252,14 +252,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2533,7 +2511,47 @@ index bfb1ced180ff4943ba15eb16f01530cd1b5b8a90..10e23477f58c7189dee1b3c06a21d656 } @Override -@@ -1740,6 +1804,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1305,7 +1369,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + + @Override + public void setResourcePack(String url) { +- this.setResourcePack(url, null); ++ this.setResourcePack(url, (byte[]) null); + } + + @Override +@@ -1320,7 +1384,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + + @Override + public void setResourcePack(String url, byte[] hash, boolean force) { +- this.setResourcePack(url, hash, null, force); ++ this.setResourcePack(url, hash, (String) null, force); + } + + @Override +@@ -1336,6 +1400,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + } + } + ++ // Paper start ++ @Override ++ public void setResourcePack(String url, byte[] hashBytes, net.kyori.adventure.text.Component prompt, boolean force) { ++ Validate.notNull(url, "Resource pack URL cannot be null"); ++ final String hash; ++ if (hashBytes != null) { ++ Validate.isTrue(hashBytes.length == 20, "Resource pack hash should be 20 bytes long but was " + hashBytes.length); ++ hash = BaseEncoding.base16().lowerCase().encode(hashBytes); ++ } else { ++ hash = ""; ++ } ++ this.getHandle().sendTexturePack(url, hash, force, io.papermc.paper.adventure.PaperAdventure.asVanilla(prompt)); ++ } ++ // Paper end ++ + public void addChannel(String channel) { + Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel); + channel = StandardMessenger.validateAndCorrectChannel(channel); +@@ -1740,6 +1819,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return (this.getHandle().clientViewDistance == null) ? Bukkit.getViewDistance() : this.getHandle().clientViewDistance; } @@ -2546,7 +2564,7 @@ index bfb1ced180ff4943ba15eb16f01530cd1b5b8a90..10e23477f58c7189dee1b3c06a21d656 @Override public int getPing() { return this.getHandle().latency; -@@ -1785,6 +1855,194 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1785,6 +1870,194 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.getHandle().allowsListing(); } @@ -3505,7 +3523,7 @@ index f9b7b8f7ccc95b73967a51420fd6ce88d80d75fe..0de5a46423ae0403dcbfca630dfd7c5a boolean hadFormat = false; diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index afdf4bc63dfaa469a16701541332e5380a027c22..4a25660971042322b1f9322b906e2775e81a6f01 100644 +index afdf4bc63dfaa469a16701541332e5380a027c22..8cbd488ee38a568d746ccb909710a2bce85ab762 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -57,6 +57,33 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -3529,7 +3547,7 @@ index afdf4bc63dfaa469a16701541332e5380a027c22..4a25660971042322b1f9322b906e2775 + } + + @Override -+ public net.kyori.adventure.text.serializer.plain.PlainComponentSerializer plainComponentSerializer() { ++ public net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer plainComponentSerializer() { + return io.papermc.paper.adventure.PaperAdventure.PLAIN; + } + diff --git a/patches/server/0023-Player-affects-spawning-API.patch b/patches/server/0023-Player-affects-spawning-API.patch index 47b0dfb42a..bc034bc112 100644 --- a/patches/server/0023-Player-affects-spawning-API.patch +++ b/patches/server/0023-Player-affects-spawning-API.patch @@ -117,10 +117,10 @@ index c65d1dc6eb0c1fc7c4a91faf0f1c6f26b3c2a76e..0dc46471f7247e5d36c3896a0c874730 for(Player player : this.players()) { if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 10e23477f58c7189dee1b3c06a21d656c9b50e82..2f6a08b66c7451cbc9990062286199f25f7da36a 100644 +index 37f6e5f0e9b31c10769ae06dc99395330b0a5c55..ef2001db09ca1ca3412aa01c09a8ee3bd70ed228 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1818,8 +1818,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1833,8 +1833,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { return this.getHandle().locale; diff --git a/patches/server/0026-Only-refresh-abilities-if-needed.patch b/patches/server/0026-Only-refresh-abilities-if-needed.patch index 9bc49b87da..73f5e88d48 100644 --- a/patches/server/0026-Only-refresh-abilities-if-needed.patch +++ b/patches/server/0026-Only-refresh-abilities-if-needed.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Only refresh abilities if needed diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 2f6a08b66c7451cbc9990062286199f25f7da36a..5fe5a4d12f53d340f9920e3fb3ae61d5b9711e59 100644 +index ef2001db09ca1ca3412aa01c09a8ee3bd70ed228..216c73d3b9f8c3e7f9c81a4349ac4989bb0209c3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1487,12 +1487,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1502,12 +1502,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setFlying(boolean value) { diff --git a/patches/server/0039-Implement-PlayerLocaleChangeEvent.patch b/patches/server/0039-Implement-PlayerLocaleChangeEvent.patch index c559bab19d..34f594249b 100644 --- a/patches/server/0039-Implement-PlayerLocaleChangeEvent.patch +++ b/patches/server/0039-Implement-PlayerLocaleChangeEvent.patch @@ -30,10 +30,10 @@ index 88b6be62678fc09b5a39db28c6d71cc31b16dbcd..352bfe795aea26307de9c998d67a43af this.locale = packet.language; // Paper start diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5fe5a4d12f53d340f9920e3fb3ae61d5b9711e59..1a27cc950e23fbdf91a7b700f7dc4f994e05b316 100644 +index 216c73d3b9f8c3e7f9c81a4349ac4989bb0209c3..c29ca680f3c639d284488bfd95c44ccdcfada2ee 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1818,8 +1818,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1833,8 +1833,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { diff --git a/patches/server/0061-Complete-resource-pack-API.patch b/patches/server/0061-Complete-resource-pack-API.patch index b03c6b826a..bb5373485e 100644 --- a/patches/server/0061-Complete-resource-pack-API.patch +++ b/patches/server/0061-Complete-resource-pack-API.patch @@ -23,7 +23,7 @@ index 25117f4b7f6139688c1845a1dc257f7d5c268fde..103d0afd73de68e3b07a9a4ef6d2f5af @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1c5d31872ba125f6bc990fedb0c350b2825f301d..27d4b69bc3184869e9b66d1933ceb3fb8f8832ac 100644 +index 00e9f75a065b598358bc049027ee8896e168091f..4cb1cd3bd5905735daab669206d51ebcdecaea10 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -134,6 +134,7 @@ import org.bukkit.metadata.MetadataValue; @@ -45,16 +45,7 @@ index 1c5d31872ba125f6bc990fedb0c350b2825f301d..27d4b69bc3184869e9b66d1933ceb3fb public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -1494,7 +1499,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - - @Override - public void setResourcePack(String url) { -- this.setResourcePack(url, null); -+ this.setResourcePack(url, (byte[]) null); - } - - @Override -@@ -1958,6 +1963,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1973,6 +1978,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public boolean getAffectsSpawning() { return this.getHandle().affectsSpawning; } diff --git a/patches/server/0069-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/0069-handle-NaN-health-absorb-values-and-repair-bad-data.patch index 9d86d7922f..30ec526b19 100644 --- a/patches/server/0069-handle-NaN-health-absorb-values-and-repair-bad-data.patch +++ b/patches/server/0069-handle-NaN-health-absorb-values-and-repair-bad-data.patch @@ -44,10 +44,10 @@ index 76da306041b61f6c93e6f58f580054af7dfc234e..2277b06e3e13a1abb469064d5b23495a } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a8cdb69c3d1187d28529fae3b4e35d0550980c2b..d47e9df3a0decca7a360be01d488ba21cef7091e 100644 +index 339e36932e2e5ef13a9123322f2d4a0d43e0d030..da201f9f65760aa6b1d94b5bc078e26863545526 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1763,6 +1763,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1778,6 +1778,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setRealHealth(double health) { diff --git a/patches/server/0190-Flag-to-disable-the-channel-limit.patch b/patches/server/0190-Flag-to-disable-the-channel-limit.patch index f5852d36cf..ceff0d7ca8 100644 --- a/patches/server/0190-Flag-to-disable-the-channel-limit.patch +++ b/patches/server/0190-Flag-to-disable-the-channel-limit.patch @@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs. provide an optional flag to disable this check, at your own risk. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 54fe0cca4b45924ae6e27a8cbab0fc00e325ec50..0b193616a1a89857e22356c03d05f5fa0fc78aea 100644 +index 69b0566660b0ad8571782feddff7726dda474b4e..4c08a07b0f21e2f57c802a3b05142f4ad94fda9f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -155,6 +155,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -20,8 +20,8 @@ index 54fe0cca4b45924ae6e27a8cbab0fc00e325ec50..0b193616a1a89857e22356c03d05f5fa // Paper end public CraftPlayer(CraftServer server, ServerPlayer entity) { -@@ -1660,7 +1661,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - } +@@ -1675,7 +1676,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + // Paper end public void addChannel(String channel) { - Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel); diff --git a/patches/server/0260-Expose-attack-cooldown-methods-for-Player.patch b/patches/server/0260-Expose-attack-cooldown-methods-for-Player.patch index 427f745ced..56ce418f3a 100644 --- a/patches/server/0260-Expose-attack-cooldown-methods-for-Player.patch +++ b/patches/server/0260-Expose-attack-cooldown-methods-for-Player.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ec369a97fe3bdea9a75467a166a732674e497003..602164382586cc73704a776efebcd82ffba22e83 100644 +index b549107e022e036164a213ff22b03d8148271118..bce9305b736832abbc9de10a1bf6554c2e724fdf 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2357,6 +2357,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2372,6 +2372,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.adventure$pointers; } diff --git a/patches/server/0261-Improve-death-events.patch b/patches/server/0261-Improve-death-events.patch index 9d23e96394..922f0be605 100644 --- a/patches/server/0261-Improve-death-events.patch +++ b/patches/server/0261-Improve-death-events.patch @@ -295,10 +295,10 @@ index 91cf7728aee475cb36f2c02bbfb7e3d2e0d00576..a3a900d10440ed5ebe24370a77ccb6ca } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 602164382586cc73704a776efebcd82ffba22e83..e2c4f56d7bcf4c0c0be38a60d47b814fc615732b 100644 +index bce9305b736832abbc9de10a1bf6554c2e724fdf..076135ecdfcb589e39deef50c44196d5ffe53434 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1920,7 +1920,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1935,7 +1935,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void sendHealthUpdate() { diff --git a/patches/server/0303-Block-Entity-remove-from-being-called-on-Players.patch b/patches/server/0303-Block-Entity-remove-from-being-called-on-Players.patch index 2ec35187a1..80f6e7191d 100644 --- a/patches/server/0303-Block-Entity-remove-from-being-called-on-Players.patch +++ b/patches/server/0303-Block-Entity-remove-from-being-called-on-Players.patch @@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to be unintentional in the few cases we've seen so far. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 133111bdb165fc2c98824c0592223fe435860368..5efda81f8028f3a939ba581ceaf328f4f537c225 100644 +index 03b7b95f8a571e2818a240415a96e09ee564158c..302ecb512dc5bfa7ff448810b25bed3bfab3d3ea 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2404,6 +2404,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2419,6 +2419,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void resetCooldown() { getHandle().resetAttackStrengthTicker(); } diff --git a/patches/server/0487-Brand-support.patch b/patches/server/0487-Brand-support.patch index 29cb274d4e..b3c9a3d8e1 100644 --- a/patches/server/0487-Brand-support.patch +++ b/patches/server/0487-Brand-support.patch @@ -72,10 +72,10 @@ index 938e6ee89bdb398dc4e2ce1682727c0e63f28c26..4065a1cb1b4b68aa3ff9f1c3e86c270e return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9eb324b576cd9b50cf7cfad6470ae6a9b8de0a19..fa3554c96e87fc58c3e71e1635b5cf76fe18e27d 100644 +index 8429d6aa616c08520bdf7bf71f7e61895583e3ed..95dae09e710cc50905a6af3a33e8c4c0a29719da 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2548,6 +2548,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2563,6 +2563,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper end }; diff --git a/patches/server/0539-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/0539-Fix-Player-spawnParticle-x-y-z-precision-loss.patch index 97588b69a4..8b85239552 100644 --- a/patches/server/0539-Fix-Player-spawnParticle-x-y-z-precision-loss.patch +++ b/patches/server/0539-Fix-Player-spawnParticle-x-y-z-precision-loss.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d392a02d996140ab8102e8b9243fd6119fe343a2..8e41be518510e559724f2f26c195f9a99ba343e5 100644 +index 4afa5667e58999b684376e2eda9cfe3c7832ec32..84d26ab488b0c13ce253d64a053e1aef8de78567 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2119,7 +2119,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2134,7 +2134,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (data != null && !particle.getDataType().isInstance(data)) { throw new IllegalArgumentException("data should be " + particle.getDataType() + " got " + data.getClass()); } diff --git a/patches/server/0820-Add-player-health-update-API.patch b/patches/server/0820-Add-player-health-update-API.patch index ca1dc0afce..60d79df5d3 100644 --- a/patches/server/0820-Add-player-health-update-API.patch +++ b/patches/server/0820-Add-player-health-update-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add player health update API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 03888e95445147ed462233c0115d7e90411c192c..741a03430199cc28b64e2f7ab7167c1d7b7110bc 100644 +index f2cbfcb069e882ca117d1538e0e69c846bcffd85..cbb24244ec09ab25c7ff8da8bd3ee5a1ef4ae1cc 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1998,9 +1998,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2013,9 +2013,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().maxHealthCache = getMaxHealth(); } @@ -22,7 +22,7 @@ index 03888e95445147ed462233c0115d7e90411c192c..741a03430199cc28b64e2f7ab7167c1d if (this.getHandle().queueHealthUpdatePacket) { this.getHandle().queuedHealthUpdatePacket = packet; } else { -@@ -2008,7 +2010,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2023,7 +2025,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end } |