diff --git a/nms-patches/net/minecraft/CrashReport.patch b/nms-patches/net/minecraft/CrashReport.patch deleted file mode 100644 index 0c5cb0b0..00000000 --- a/nms-patches/net/minecraft/CrashReport.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/net/minecraft/CrashReport.java -+++ b/net/minecraft/CrashReport.java -@@ -36,6 +36,7 @@ - public CrashReport(String s, Throwable throwable) { - this.title = s; - this.exception = throwable; -+ this.systemReport.setDetail("CraftBukkit Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit - } - - public String getTitle() { diff --git a/nms-patches/net/minecraft/core/component/DataComponentPatch.patch b/nms-patches/net/minecraft/core/component/DataComponentPatch.patch deleted file mode 100644 index 5e70217b..00000000 --- a/nms-patches/net/minecraft/core/component/DataComponentPatch.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- a/net/minecraft/core/component/DataComponentPatch.java -+++ b/net/minecraft/core/component/DataComponentPatch.java -@@ -61,7 +61,7 @@ - } - } - -- return reference2objectmap; -+ return (Reference2ObjectMap) reference2objectmap; // CraftBukkit - decompile error - }); - public static final StreamCodec STREAM_CODEC = new StreamCodec() { - public DataComponentPatch decode(RegistryFriendlyByteBuf registryfriendlybytebuf) { -@@ -144,7 +144,7 @@ - } - - private static void encodeComponent(RegistryFriendlyByteBuf registryfriendlybytebuf, DataComponentType datacomponenttype, Object object) { -- datacomponenttype.streamCodec().encode(registryfriendlybytebuf, object); -+ datacomponenttype.streamCodec().encode(registryfriendlybytebuf, (T) object); // CraftBukkit - decompile error - } - }; - private static final String REMOVED_PREFIX = "!"; -@@ -271,6 +271,42 @@ - - a() {} - -+ // CraftBukkit start -+ public void copy(DataComponentPatch orig) { -+ this.map.putAll(orig.map); -+ } -+ -+ public void clear(DataComponentType type) { -+ this.map.remove(type); -+ } -+ -+ public boolean isSet(DataComponentType type) { -+ return map.containsKey(type); -+ } -+ -+ public boolean isEmpty() { -+ return this.map.isEmpty(); -+ } -+ -+ @Override -+ public boolean equals(Object object) { -+ if (this == object) { -+ return true; -+ } -+ -+ if (object instanceof DataComponentPatch.a patch) { -+ return this.map.equals(patch.map); -+ } -+ -+ return false; -+ } -+ -+ @Override -+ public int hashCode() { -+ return this.map.hashCode(); -+ } -+ // CraftBukkit end -+ - public DataComponentPatch.a set(DataComponentType datacomponenttype, T t0) { - this.map.put(datacomponenttype, Optional.of(t0)); - return this; diff --git a/nms-patches/net/minecraft/server/bossevents/BossBattleCustom.patch b/nms-patches/net/minecraft/server/bossevents/BossBattleCustom.patch deleted file mode 100644 index 3dacf956..00000000 --- a/nms-patches/net/minecraft/server/bossevents/BossBattleCustom.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/net/minecraft/server/bossevents/BossBattleCustom.java -+++ b/net/minecraft/server/bossevents/BossBattleCustom.java -@@ -19,12 +19,27 @@ - import net.minecraft.util.MathHelper; - import net.minecraft.world.BossBattle; - -+// CraftBukkit start -+import org.bukkit.boss.KeyedBossBar; -+import org.bukkit.craftbukkit.boss.CraftKeyedBossbar; -+// CraftBukkit end -+ - public class BossBattleCustom extends BossBattleServer { - - private final MinecraftKey id; - private final Set players = Sets.newHashSet(); - private int value; - private int max = 100; -+ // CraftBukkit start -+ private KeyedBossBar bossBar; -+ -+ public KeyedBossBar getBukkitEntity() { -+ if (bossBar == null) { -+ bossBar = new CraftKeyedBossbar(this); -+ } -+ return bossBar; -+ } -+ // CraftBukkit end - - public BossBattleCustom(MinecraftKey minecraftkey, IChatBaseComponent ichatbasecomponent) { - super(ichatbasecomponent, BossBattle.BarColor.WHITE, BossBattle.BarStyle.PROGRESS); diff --git a/nms-patches/net/minecraft/server/gui/ServerGUI.patch b/nms-patches/net/minecraft/server/gui/ServerGUI.patch deleted file mode 100644 index e99114a8..00000000 --- a/nms-patches/net/minecraft/server/gui/ServerGUI.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- a/net/minecraft/server/gui/ServerGUI.java -+++ b/net/minecraft/server/gui/ServerGUI.java -@@ -96,7 +96,7 @@ - private JComponent buildInfoPanel() { - JPanel jpanel = new JPanel(new BorderLayout()); - GuiStatsComponent guistatscomponent = new GuiStatsComponent(this.server); -- Collection collection = this.finalizers; -+ Collection collection = this.finalizers; // CraftBukkit - decompile error - - Objects.requireNonNull(guistatscomponent); - collection.add(guistatscomponent::close); -@@ -132,7 +132,7 @@ - - jtextfield.setText(""); - }); -- jtextarea.addFocusListener(new FocusAdapter(this) { -+ jtextarea.addFocusListener(new FocusAdapter() { // CraftBukkit - decompile error - public void focusGained(FocusEvent focusevent) {} - }); - jpanel.add(jscrollpane, "Center"); -@@ -166,6 +166,7 @@ - this.finalizers.forEach(Runnable::run); - } - -+ private static final java.util.regex.Pattern ANSI = java.util.regex.Pattern.compile("\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})*)?[m|K]"); // CraftBukkit - public void print(JTextArea jtextarea, JScrollPane jscrollpane, String s) { - if (!SwingUtilities.isEventDispatchThread()) { - SwingUtilities.invokeLater(() -> { -@@ -181,7 +182,7 @@ - } - - try { -- document.insertString(document.getLength(), s, (AttributeSet) null); -+ document.insertString(document.getLength(), ANSI.matcher(s).replaceAll(""), (AttributeSet) null); // CraftBukkit - } catch (BadLocationException badlocationexception) { - ; - } diff --git a/nms-patches/net/minecraft/stats/RecipeBookServer.patch b/nms-patches/net/minecraft/stats/RecipeBookServer.patch deleted file mode 100644 index 82d48407..00000000 --- a/nms-patches/net/minecraft/stats/RecipeBookServer.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/net/minecraft/stats/RecipeBookServer.java -+++ b/net/minecraft/stats/RecipeBookServer.java -@@ -20,6 +20,8 @@ - import net.minecraft.world.item.crafting.RecipeHolder; - import org.slf4j.Logger; - -+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit -+ - public class RecipeBookServer extends RecipeBook { - - public static final String RECIPE_BOOK_TAG = "recipeBook"; -@@ -36,7 +38,7 @@ - RecipeHolder recipeholder = (RecipeHolder) iterator.next(); - MinecraftKey minecraftkey = recipeholder.id(); - -- if (!this.known.contains(minecraftkey) && !recipeholder.value().isSpecial()) { -+ if (!this.known.contains(minecraftkey) && !recipeholder.value().isSpecial() && CraftEventFactory.handlePlayerRecipeListUpdateEvent(entityplayer, minecraftkey)) { // CraftBukkit - this.add(minecraftkey); - this.addHighlight(minecraftkey); - list.add(minecraftkey); -@@ -73,6 +75,7 @@ - } - - private void sendRecipes(PacketPlayOutRecipes.Action packetplayoutrecipes_action, EntityPlayer entityplayer, List list) { -+ if (entityplayer.connection == null) return; // SPIGOT-4478 during PlayerLoginEvent - entityplayer.connection.send(new PacketPlayOutRecipes(packetplayoutrecipes_action, list, Collections.emptyList(), this.getBookSettings())); - } - diff --git a/nms-patches/net/minecraft/stats/ServerStatisticManager.patch b/nms-patches/net/minecraft/stats/ServerStatisticManager.patch deleted file mode 100644 index ac3c4fff..00000000 --- a/nms-patches/net/minecraft/stats/ServerStatisticManager.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/net/minecraft/stats/ServerStatisticManager.java -+++ b/net/minecraft/stats/ServerStatisticManager.java -@@ -1,3 +1,4 @@ -+// mc-dev import - package net.minecraft.stats; - - import com.google.common.collect.Maps; -@@ -158,13 +159,12 @@ - } - - private Optional> getStat(StatisticWrapper statisticwrapper, String s) { -- Optional optional = Optional.ofNullable(MinecraftKey.tryParse(s)); -- IRegistry iregistry = statisticwrapper.getRegistry(); -+ // CraftBukkit - decompile error start -+ Optional optional = Optional.ofNullable(MinecraftKey.tryParse(s)); -+ IRegistry iregistry = statisticwrapper.getRegistry(); - -- Objects.requireNonNull(iregistry); -- optional = optional.flatMap(iregistry::getOptional); -- Objects.requireNonNull(statisticwrapper); -- return optional.map(statisticwrapper::get); -+ return optional.flatMap(iregistry::getOptional).map(statisticwrapper::get); -+ // CraftBukkit - decompile error end - } - - private static NBTTagCompound fromJson(JsonObject jsonobject) { diff --git a/nms-patches/net/minecraft/stats/StatisticManager.patch b/nms-patches/net/minecraft/stats/StatisticManager.patch deleted file mode 100644 index 118075d5..00000000 --- a/nms-patches/net/minecraft/stats/StatisticManager.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/net/minecraft/stats/StatisticManager.java -+++ b/net/minecraft/stats/StatisticManager.java -@@ -16,6 +16,12 @@ - public void increment(EntityHuman entityhuman, Statistic statistic, int i) { - int j = (int) Math.min((long) this.getValue(statistic) + (long) i, 2147483647L); - -+ // CraftBukkit start - fire Statistic events -+ org.bukkit.event.Cancellable cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.handleStatisticsIncrease(entityhuman, statistic, this.getValue(statistic), j); -+ if (cancellable != null && cancellable.isCancelled()) { -+ return; -+ } -+ // CraftBukkit end - this.setValue(entityhuman, statistic, j); - } - diff --git a/nms-patches/net/minecraft/util/SpawnUtil.patch b/nms-patches/net/minecraft/util/SpawnUtil.patch deleted file mode 100644 index 7ac5d4fa..00000000 --- a/nms-patches/net/minecraft/util/SpawnUtil.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- a/net/minecraft/util/SpawnUtil.java -+++ b/net/minecraft/util/SpawnUtil.java -@@ -20,6 +20,12 @@ - public SpawnUtil() {} - - public static Optional trySpawnMob(EntityTypes entitytypes, EnumMobSpawn enummobspawn, WorldServer worldserver, BlockPosition blockposition, int i, int j, int k, SpawnUtil.a spawnutil_a) { -+ // CraftBukkit start -+ return trySpawnMob(entitytypes, enummobspawn, worldserver, blockposition, i, j, k, spawnutil_a, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT); -+ } -+ -+ public static Optional trySpawnMob(EntityTypes entitytypes, EnumMobSpawn enummobspawn, WorldServer worldserver, BlockPosition blockposition, int i, int j, int k, SpawnUtil.a spawnutil_a, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) { -+ // CraftBukkit end - BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.mutable(); - - for (int l = 0; l < i; ++l) { -@@ -28,15 +34,15 @@ - - blockposition_mutableblockposition.setWithOffset(blockposition, i1, k, j1); - if (worldserver.getWorldBorder().isWithinBounds((BlockPosition) blockposition_mutableblockposition) && moveToPossibleSpawnPosition(worldserver, k, blockposition_mutableblockposition, spawnutil_a)) { -- T t0 = (EntityInsentient) entitytypes.create(worldserver, (Consumer) null, blockposition_mutableblockposition, enummobspawn, false, false); -+ T t0 = entitytypes.create(worldserver, (Consumer) null, blockposition_mutableblockposition, enummobspawn, false, false); // CraftBukkit - decompile error - - if (t0 != null) { - if (t0.checkSpawnRules(worldserver, enummobspawn) && t0.checkSpawnObstruction(worldserver)) { -- worldserver.addFreshEntityWithPassengers(t0); -+ worldserver.addFreshEntityWithPassengers(t0, reason); // CraftBukkit - return Optional.of(t0); - } - -- t0.discard(); -+ t0.discard(null); // CraftBukkit - add Bukkit remove cause - } - } - } diff --git a/nms-patches/net/minecraft/util/datafix/DataConverterRegistry.patch b/nms-patches/net/minecraft/util/datafix/DataConverterRegistry.patch deleted file mode 100644 index ebbba19e..00000000 --- a/nms-patches/net/minecraft/util/datafix/DataConverterRegistry.patch +++ /dev/null @@ -1,82 +0,0 @@ ---- a/net/minecraft/util/datafix/DataConverterRegistry.java -+++ b/net/minecraft/util/datafix/DataConverterRegistry.java -@@ -495,6 +495,18 @@ - datafixerbuilder.addFixer(new DataConverterItemFrame(schema44, false)); - Schema schema45 = datafixerbuilder.addSchema(1458, DataConverterRegistry.SAME_NAMESPACED); - -+ // CraftBukkit start -+ datafixerbuilder.addFixer(new com.mojang.datafixers.DataFix(schema45, false) { -+ @Override -+ protected com.mojang.datafixers.TypeRewriteRule makeRule() { -+ return this.fixTypeEverywhereTyped("Player CustomName", this.getInputSchema().getType(DataConverterTypes.PLAYER), (typed) -> { -+ return typed.update(DSL.remainderFinder(), (dynamic) -> { -+ return DataConverterCustomNameEntity.fixTagCustomName(dynamic); -+ }); -+ }); -+ } -+ }); -+ // CraftBukkit end - datafixerbuilder.addFixer(new DataConverterCustomNameEntity(schema45, false)); - datafixerbuilder.addFixer(new DataConverterCustomNameItem(schema45, false)); - datafixerbuilder.addFixer(new DataConverterCustomNameTile(schema45, false)); -@@ -753,7 +765,8 @@ - datafixerbuilder.addFixer(new DataConverterAddChoices(schema110, "Added Zoglin", DataConverterTypes.ENTITY)); - Schema schema111 = datafixerbuilder.addSchema(2523, DataConverterRegistry.SAME_NAMESPACED); - -- datafixerbuilder.addFixer(new DataConverterAttributes(schema111, "Attribute renames", createRenamerNoNamespace(ImmutableMap.builder().put("generic.maxHealth", "minecraft:generic.max_health").put("Max Health", "minecraft:generic.max_health").put("zombie.spawnReinforcements", "minecraft:zombie.spawn_reinforcements").put("Spawn Reinforcements Chance", "minecraft:zombie.spawn_reinforcements").put("horse.jumpStrength", "minecraft:horse.jump_strength").put("Jump Strength", "minecraft:horse.jump_strength").put("generic.followRange", "minecraft:generic.follow_range").put("Follow Range", "minecraft:generic.follow_range").put("generic.knockbackResistance", "minecraft:generic.knockback_resistance").put("Knockback Resistance", "minecraft:generic.knockback_resistance").put("generic.movementSpeed", "minecraft:generic.movement_speed").put("Movement Speed", "minecraft:generic.movement_speed").put("generic.flyingSpeed", "minecraft:generic.flying_speed").put("Flying Speed", "minecraft:generic.flying_speed").put("generic.attackDamage", "minecraft:generic.attack_damage").put("generic.attackKnockback", "minecraft:generic.attack_knockback").put("generic.attackSpeed", "minecraft:generic.attack_speed").put("generic.armorToughness", "minecraft:generic.armor_toughness").build()))); -+ // CraftBukkit - decompile error -+ datafixerbuilder.addFixer(new DataConverterAttributes(schema111, "Attribute renames", createRenamerNoNamespace(ImmutableMap.builder().put("generic.maxHealth", "minecraft:generic.max_health").put("Max Health", "minecraft:generic.max_health").put("zombie.spawnReinforcements", "minecraft:zombie.spawn_reinforcements").put("Spawn Reinforcements Chance", "minecraft:zombie.spawn_reinforcements").put("horse.jumpStrength", "minecraft:horse.jump_strength").put("Jump Strength", "minecraft:horse.jump_strength").put("generic.followRange", "minecraft:generic.follow_range").put("Follow Range", "minecraft:generic.follow_range").put("generic.knockbackResistance", "minecraft:generic.knockback_resistance").put("Knockback Resistance", "minecraft:generic.knockback_resistance").put("generic.movementSpeed", "minecraft:generic.movement_speed").put("Movement Speed", "minecraft:generic.movement_speed").put("generic.flyingSpeed", "minecraft:generic.flying_speed").put("Flying Speed", "minecraft:generic.flying_speed").put("generic.attackDamage", "minecraft:generic.attack_damage").put("generic.attackKnockback", "minecraft:generic.attack_knockback").put("generic.attackSpeed", "minecraft:generic.attack_speed").put("generic.armorToughness", "minecraft:generic.armor_toughness").build()))); - Schema schema112 = datafixerbuilder.addSchema(2527, DataConverterRegistry.SAME_NAMESPACED); - - datafixerbuilder.addFixer(new DataConverterBitStorageAlign(schema112)); -@@ -816,12 +829,14 @@ - datafixerbuilder.addFixer(new DataConverterAddChoices(schema130, "Added Glow Squid", DataConverterTypes.ENTITY)); - datafixerbuilder.addFixer(new DataConverterAddChoices(schema130, "Added Glow Item Frame", DataConverterTypes.ENTITY)); - Schema schema131 = datafixerbuilder.addSchema(2690, DataConverterRegistry.SAME_NAMESPACED); -- ImmutableMap immutablemap = ImmutableMap.builder().put("minecraft:weathered_copper_block", "minecraft:oxidized_copper_block").put("minecraft:semi_weathered_copper_block", "minecraft:weathered_copper_block").put("minecraft:lightly_weathered_copper_block", "minecraft:exposed_copper_block").put("minecraft:weathered_cut_copper", "minecraft:oxidized_cut_copper").put("minecraft:semi_weathered_cut_copper", "minecraft:weathered_cut_copper").put("minecraft:lightly_weathered_cut_copper", "minecraft:exposed_cut_copper").put("minecraft:weathered_cut_copper_stairs", "minecraft:oxidized_cut_copper_stairs").put("minecraft:semi_weathered_cut_copper_stairs", "minecraft:weathered_cut_copper_stairs").put("minecraft:lightly_weathered_cut_copper_stairs", "minecraft:exposed_cut_copper_stairs").put("minecraft:weathered_cut_copper_slab", "minecraft:oxidized_cut_copper_slab").put("minecraft:semi_weathered_cut_copper_slab", "minecraft:weathered_cut_copper_slab").put("minecraft:lightly_weathered_cut_copper_slab", "minecraft:exposed_cut_copper_slab").put("minecraft:waxed_semi_weathered_copper", "minecraft:waxed_weathered_copper").put("minecraft:waxed_lightly_weathered_copper", "minecraft:waxed_exposed_copper").put("minecraft:waxed_semi_weathered_cut_copper", "minecraft:waxed_weathered_cut_copper").put("minecraft:waxed_lightly_weathered_cut_copper", "minecraft:waxed_exposed_cut_copper").put("minecraft:waxed_semi_weathered_cut_copper_stairs", "minecraft:waxed_weathered_cut_copper_stairs").put("minecraft:waxed_lightly_weathered_cut_copper_stairs", "minecraft:waxed_exposed_cut_copper_stairs").put("minecraft:waxed_semi_weathered_cut_copper_slab", "minecraft:waxed_weathered_cut_copper_slab").put("minecraft:waxed_lightly_weathered_cut_copper_slab", "minecraft:waxed_exposed_cut_copper_slab").build(); -+ // CraftBukkit - decompile error -+ ImmutableMap immutablemap = ImmutableMap.builder().put("minecraft:weathered_copper_block", "minecraft:oxidized_copper_block").put("minecraft:semi_weathered_copper_block", "minecraft:weathered_copper_block").put("minecraft:lightly_weathered_copper_block", "minecraft:exposed_copper_block").put("minecraft:weathered_cut_copper", "minecraft:oxidized_cut_copper").put("minecraft:semi_weathered_cut_copper", "minecraft:weathered_cut_copper").put("minecraft:lightly_weathered_cut_copper", "minecraft:exposed_cut_copper").put("minecraft:weathered_cut_copper_stairs", "minecraft:oxidized_cut_copper_stairs").put("minecraft:semi_weathered_cut_copper_stairs", "minecraft:weathered_cut_copper_stairs").put("minecraft:lightly_weathered_cut_copper_stairs", "minecraft:exposed_cut_copper_stairs").put("minecraft:weathered_cut_copper_slab", "minecraft:oxidized_cut_copper_slab").put("minecraft:semi_weathered_cut_copper_slab", "minecraft:weathered_cut_copper_slab").put("minecraft:lightly_weathered_cut_copper_slab", "minecraft:exposed_cut_copper_slab").put("minecraft:waxed_semi_weathered_copper", "minecraft:waxed_weathered_copper").put("minecraft:waxed_lightly_weathered_copper", "minecraft:waxed_exposed_copper").put("minecraft:waxed_semi_weathered_cut_copper", "minecraft:waxed_weathered_cut_copper").put("minecraft:waxed_lightly_weathered_cut_copper", "minecraft:waxed_exposed_cut_copper").put("minecraft:waxed_semi_weathered_cut_copper_stairs", "minecraft:waxed_weathered_cut_copper_stairs").put("minecraft:waxed_lightly_weathered_cut_copper_stairs", "minecraft:waxed_exposed_cut_copper_stairs").put("minecraft:waxed_semi_weathered_cut_copper_slab", "minecraft:waxed_weathered_cut_copper_slab").put("minecraft:waxed_lightly_weathered_cut_copper_slab", "minecraft:waxed_exposed_cut_copper_slab").build(); - - datafixerbuilder.addFixer(DataConverterItemName.create(schema131, "Renamed copper block items to new oxidized terms", createRenamer(immutablemap))); - datafixerbuilder.addFixer(DataConverterBlockRename.create(schema131, "Renamed copper blocks to new oxidized terms", createRenamer(immutablemap))); - Schema schema132 = datafixerbuilder.addSchema(2691, DataConverterRegistry.SAME_NAMESPACED); -- ImmutableMap immutablemap1 = ImmutableMap.builder().put("minecraft:waxed_copper", "minecraft:waxed_copper_block").put("minecraft:oxidized_copper_block", "minecraft:oxidized_copper").put("minecraft:weathered_copper_block", "minecraft:weathered_copper").put("minecraft:exposed_copper_block", "minecraft:exposed_copper").build(); -+ // CraftBukkit - decompile error -+ ImmutableMap immutablemap1 = ImmutableMap.builder().put("minecraft:waxed_copper", "minecraft:waxed_copper_block").put("minecraft:oxidized_copper_block", "minecraft:oxidized_copper").put("minecraft:weathered_copper_block", "minecraft:weathered_copper").put("minecraft:exposed_copper_block", "minecraft:exposed_copper").build(); - - datafixerbuilder.addFixer(DataConverterItemName.create(schema132, "Rename copper item suffixes", createRenamer(immutablemap1))); - datafixerbuilder.addFixer(DataConverterBlockRename.create(schema132, "Rename copper blocks suffixes", createRenamer(immutablemap1))); -@@ -829,7 +844,8 @@ - - datafixerbuilder.addFixer(new AddFlagIfNotPresentFix(schema133, DataConverterTypes.WORLD_GEN_SETTINGS, "has_increased_height_already", false)); - Schema schema134 = datafixerbuilder.addSchema(2696, DataConverterRegistry.SAME_NAMESPACED); -- ImmutableMap immutablemap2 = ImmutableMap.builder().put("minecraft:grimstone", "minecraft:deepslate").put("minecraft:grimstone_slab", "minecraft:cobbled_deepslate_slab").put("minecraft:grimstone_stairs", "minecraft:cobbled_deepslate_stairs").put("minecraft:grimstone_wall", "minecraft:cobbled_deepslate_wall").put("minecraft:polished_grimstone", "minecraft:polished_deepslate").put("minecraft:polished_grimstone_slab", "minecraft:polished_deepslate_slab").put("minecraft:polished_grimstone_stairs", "minecraft:polished_deepslate_stairs").put("minecraft:polished_grimstone_wall", "minecraft:polished_deepslate_wall").put("minecraft:grimstone_tiles", "minecraft:deepslate_tiles").put("minecraft:grimstone_tile_slab", "minecraft:deepslate_tile_slab").put("minecraft:grimstone_tile_stairs", "minecraft:deepslate_tile_stairs").put("minecraft:grimstone_tile_wall", "minecraft:deepslate_tile_wall").put("minecraft:grimstone_bricks", "minecraft:deepslate_bricks").put("minecraft:grimstone_brick_slab", "minecraft:deepslate_brick_slab").put("minecraft:grimstone_brick_stairs", "minecraft:deepslate_brick_stairs").put("minecraft:grimstone_brick_wall", "minecraft:deepslate_brick_wall").put("minecraft:chiseled_grimstone", "minecraft:chiseled_deepslate").build(); -+ // CraftBukkit - decompile error -+ ImmutableMap immutablemap2 = ImmutableMap.builder().put("minecraft:grimstone", "minecraft:deepslate").put("minecraft:grimstone_slab", "minecraft:cobbled_deepslate_slab").put("minecraft:grimstone_stairs", "minecraft:cobbled_deepslate_stairs").put("minecraft:grimstone_wall", "minecraft:cobbled_deepslate_wall").put("minecraft:polished_grimstone", "minecraft:polished_deepslate").put("minecraft:polished_grimstone_slab", "minecraft:polished_deepslate_slab").put("minecraft:polished_grimstone_stairs", "minecraft:polished_deepslate_stairs").put("minecraft:polished_grimstone_wall", "minecraft:polished_deepslate_wall").put("minecraft:grimstone_tiles", "minecraft:deepslate_tiles").put("minecraft:grimstone_tile_slab", "minecraft:deepslate_tile_slab").put("minecraft:grimstone_tile_stairs", "minecraft:deepslate_tile_stairs").put("minecraft:grimstone_tile_wall", "minecraft:deepslate_tile_wall").put("minecraft:grimstone_bricks", "minecraft:deepslate_bricks").put("minecraft:grimstone_brick_slab", "minecraft:deepslate_brick_slab").put("minecraft:grimstone_brick_stairs", "minecraft:deepslate_brick_stairs").put("minecraft:grimstone_brick_wall", "minecraft:deepslate_brick_wall").put("minecraft:chiseled_grimstone", "minecraft:chiseled_deepslate").build(); - - datafixerbuilder.addFixer(DataConverterItemName.create(schema134, "Renamed grimstone block items to deepslate", createRenamer(immutablemap2))); - datafixerbuilder.addFixer(DataConverterBlockRename.create(schema134, "Renamed grimstone blocks to deepslate", createRenamer(immutablemap2))); -@@ -916,10 +932,11 @@ - datafixerbuilder.addFixer(new DataConverterAddChoices(schema159, "Added Allay", DataConverterTypes.ENTITY)); - Schema schema160 = datafixerbuilder.addSchema(3084, DataConverterRegistry.SAME_NAMESPACED); - -- datafixerbuilder.addFixer(new NamespacedTypeRenameFix(schema160, "game_event_renames_3084", DataConverterTypes.GAME_EVENT_NAME, createRenamer(ImmutableMap.builder().put("minecraft:block_press", "minecraft:block_activate").put("minecraft:block_switch", "minecraft:block_activate").put("minecraft:block_unpress", "minecraft:block_deactivate").put("minecraft:block_unswitch", "minecraft:block_deactivate").put("minecraft:drinking_finish", "minecraft:drink").put("minecraft:elytra_free_fall", "minecraft:elytra_glide").put("minecraft:entity_damaged", "minecraft:entity_damage").put("minecraft:entity_dying", "minecraft:entity_die").put("minecraft:entity_killed", "minecraft:entity_die").put("minecraft:mob_interact", "minecraft:entity_interact").put("minecraft:ravager_roar", "minecraft:entity_roar").put("minecraft:ring_bell", "minecraft:block_change").put("minecraft:shulker_close", "minecraft:container_close").put("minecraft:shulker_open", "minecraft:container_open").put("minecraft:wolf_shaking", "minecraft:entity_shake").build()))); -+ // CraftBukkit - decompile error -+ datafixerbuilder.addFixer(new NamespacedTypeRenameFix(schema160, "game_event_renames_3084", DataConverterTypes.GAME_EVENT_NAME, createRenamer(ImmutableMap.builder().put("minecraft:block_press", "minecraft:block_activate").put("minecraft:block_switch", "minecraft:block_activate").put("minecraft:block_unpress", "minecraft:block_deactivate").put("minecraft:block_unswitch", "minecraft:block_deactivate").put("minecraft:drinking_finish", "minecraft:drink").put("minecraft:elytra_free_fall", "minecraft:elytra_glide").put("minecraft:entity_damaged", "minecraft:entity_damage").put("minecraft:entity_dying", "minecraft:entity_die").put("minecraft:entity_killed", "minecraft:entity_die").put("minecraft:mob_interact", "minecraft:entity_interact").put("minecraft:ravager_roar", "minecraft:entity_roar").put("minecraft:ring_bell", "minecraft:block_change").put("minecraft:shulker_close", "minecraft:container_close").put("minecraft:shulker_open", "minecraft:container_open").put("minecraft:wolf_shaking", "minecraft:entity_shake").build()))); - Schema schema161 = datafixerbuilder.addSchema(3086, DataConverterRegistry.SAME_NAMESPACED); - TypeReference typereference = DataConverterTypes.ENTITY; -- Int2ObjectOpenHashMap int2objectopenhashmap = (Int2ObjectOpenHashMap) SystemUtils.make(new Int2ObjectOpenHashMap(), (int2objectopenhashmap1) -> { -+ Int2ObjectOpenHashMap int2objectopenhashmap = (Int2ObjectOpenHashMap) SystemUtils.make(new Int2ObjectOpenHashMap(), (int2objectopenhashmap1) -> { // CraftBukkit - decompile error - int2objectopenhashmap1.defaultReturnValue("minecraft:tabby"); - int2objectopenhashmap1.put(0, "minecraft:tabby"); - int2objectopenhashmap1.put(1, "minecraft:black"); -@@ -936,7 +953,8 @@ - - Objects.requireNonNull(int2objectopenhashmap); - datafixerbuilder.addFixer(new EntityVariantFix(schema161, "Change cat variant type", typereference, "minecraft:cat", "CatType", int2objectopenhashmap::get)); -- ImmutableMap immutablemap3 = ImmutableMap.builder().put("textures/entity/cat/tabby.png", "minecraft:tabby").put("textures/entity/cat/black.png", "minecraft:black").put("textures/entity/cat/red.png", "minecraft:red").put("textures/entity/cat/siamese.png", "minecraft:siamese").put("textures/entity/cat/british_shorthair.png", "minecraft:british").put("textures/entity/cat/calico.png", "minecraft:calico").put("textures/entity/cat/persian.png", "minecraft:persian").put("textures/entity/cat/ragdoll.png", "minecraft:ragdoll").put("textures/entity/cat/white.png", "minecraft:white").put("textures/entity/cat/jellie.png", "minecraft:jellie").put("textures/entity/cat/all_black.png", "minecraft:all_black").build(); -+ // CraftBukkit - decompile error -+ ImmutableMap immutablemap3 = ImmutableMap.builder().put("textures/entity/cat/tabby.png", "minecraft:tabby").put("textures/entity/cat/black.png", "minecraft:black").put("textures/entity/cat/red.png", "minecraft:red").put("textures/entity/cat/siamese.png", "minecraft:siamese").put("textures/entity/cat/british_shorthair.png", "minecraft:british").put("textures/entity/cat/calico.png", "minecraft:calico").put("textures/entity/cat/persian.png", "minecraft:persian").put("textures/entity/cat/ragdoll.png", "minecraft:ragdoll").put("textures/entity/cat/white.png", "minecraft:white").put("textures/entity/cat/jellie.png", "minecraft:jellie").put("textures/entity/cat/all_black.png", "minecraft:all_black").build(); - - datafixerbuilder.addFixer(new CriteriaRenameFix(schema161, "Migrate cat variant advancement", "minecraft:husbandry/complete_catalogue", (s) -> { - return (String) immutablemap3.getOrDefault(s, s); diff --git a/nms-patches/net/minecraft/util/datafix/fixes/DataConverterFlatten.patch b/nms-patches/net/minecraft/util/datafix/fixes/DataConverterFlatten.patch deleted file mode 100644 index 6916dff5..00000000 --- a/nms-patches/net/minecraft/util/datafix/fixes/DataConverterFlatten.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/util/datafix/fixes/DataConverterFlatten.java -+++ b/net/minecraft/util/datafix/fixes/DataConverterFlatten.java -@@ -376,7 +376,7 @@ - Typed typed2 = typed.getOrCreateTyped(opticfinder1); - Dynamic dynamic1 = (Dynamic) typed2.get(DSL.remainderFinder()); - -- dynamic1 = dynamic1.set("Damage", dynamic1.createInt(i)); -+ if (i != 0) dynamic1 = dynamic1.set("Damage", dynamic1.createInt(i)); // CraftBukkit - typed1 = typed1.set(opticfinder1, typed2.set(DSL.remainderFinder(), dynamic1)); - } - diff --git a/nms-patches/net/minecraft/util/datafix/fixes/DataConverterMap.patch b/nms-patches/net/minecraft/util/datafix/fixes/DataConverterMap.patch deleted file mode 100644 index 41b8ab11..00000000 --- a/nms-patches/net/minecraft/util/datafix/fixes/DataConverterMap.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/util/datafix/fixes/DataConverterMap.java -+++ b/net/minecraft/util/datafix/fixes/DataConverterMap.java -@@ -32,7 +32,7 @@ - Typed typed1 = typed.getOrCreateTyped(opticfinder1); - Dynamic dynamic1 = (Dynamic) typed1.get(DSL.remainderFinder()); - -- dynamic1 = dynamic1.set("map", dynamic1.createInt(dynamic.get("Damage").asInt(0))); -+ if (!dynamic1.getElement("map").result().isPresent()) dynamic1 = dynamic1.set("map", dynamic1.createInt(dynamic.get("Damage").asInt(0))); // CraftBukkit - return typed.set(opticfinder1, typed1.set(DSL.remainderFinder(), dynamic1)); - } else { - return typed; diff --git a/nms-patches/net/minecraft/util/worldupdate/WorldUpgrader.patch b/nms-patches/net/minecraft/util/worldupdate/WorldUpgrader.patch deleted file mode 100644 index 05b7105f..00000000 --- a/nms-patches/net/minecraft/util/worldupdate/WorldUpgrader.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/net/minecraft/util/worldupdate/WorldUpgrader.java -+++ b/net/minecraft/util/worldupdate/WorldUpgrader.java -@@ -81,7 +81,7 @@ - - public WorldUpgrader(Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, IRegistryCustom iregistrycustom, boolean flag, boolean flag1) { - this.dimensions = iregistrycustom.registryOrThrow(Registries.LEVEL_STEM); -- this.levels = (Set) this.dimensions.registryKeySet().stream().map(Registries::levelStemToLevel).collect(Collectors.toUnmodifiableSet()); -+ this.levels = (Set) java.util.stream.Stream.of(convertable_conversionsession.dimensionType).map(Registries::levelStemToLevel).collect(Collectors.toUnmodifiableSet()); // CraftBukkit - this.eraseCache = flag; - this.dataFixer = datafixer; - this.levelStorage = convertable_conversionsession; -@@ -194,9 +194,9 @@ - if (nbttagcompound != null) { - int i = IChunkLoader.getVersion(nbttagcompound); - ChunkGenerator chunkgenerator = ((WorldDimension) WorldUpgrader.this.dimensions.getOrThrow(Registries.levelToLevelStem(resourcekey))).generator(); -- NBTTagCompound nbttagcompound1 = ichunkloader.upgradeChunkTag(resourcekey, () -> { -+ NBTTagCompound nbttagcompound1 = ichunkloader.upgradeChunkTag(Registries.levelToLevelStem(resourcekey), () -> { // CraftBukkit - return WorldUpgrader.this.overworldDataStorage; -- }, nbttagcompound, chunkgenerator.getTypeNameForDataFixer()); -+ }, nbttagcompound, chunkgenerator.getTypeNameForDataFixer(), chunkcoordintpair, null); // CraftBukkit - ChunkCoordIntPair chunkcoordintpair1 = new ChunkCoordIntPair(nbttagcompound1.getInt("xPos"), nbttagcompound1.getInt("zPos")); - - if (!chunkcoordintpair1.equals(chunkcoordintpair)) { -@@ -316,7 +316,7 @@ - WorldUpgrader.c worldupgrader_c = (WorldUpgrader.c) iterator.next(); - ResourceKey resourcekey = worldupgrader_c.dimensionKey; - ListIterator listiterator = worldupgrader_c.files; -- T t0 = (AutoCloseable) worldupgrader_c.storage; -+ T t0 = (T) worldupgrader_c.storage; // CraftBukkit - decompile error - - if (listiterator.hasNext()) { - WorldUpgrader.e worldupgrader_e = (WorldUpgrader.e) listiterator.next(); diff --git a/patches/net/minecraft/CrashReport.java.patch b/patches/net/minecraft/CrashReport.java.patch index 05a189e6..3d7f107a 100644 --- a/patches/net/minecraft/CrashReport.java.patch +++ b/patches/net/minecraft/CrashReport.java.patch @@ -1,5 +1,13 @@ --- a/net/minecraft/CrashReport.java +++ b/net/minecraft/CrashReport.java +@@ -34,6 +_,7 @@ + public CrashReport(String p_127509_, Throwable p_127510_) { + this.title = p_127509_; + this.exception = p_127510_; ++ this.systemReport.setDetail("CraftBukkit Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit + } + + public String getTitle() { @@ -58,14 +_,8 @@ if (this.uncategorizedStackTrace != null && this.uncategorizedStackTrace.length > 0) { p_127520_.append("-- Head --\n"); diff --git a/patches/net/minecraft/server/bossevents/CustomBossEvent.java.patch b/patches/net/minecraft/server/bossevents/CustomBossEvent.java.patch index 9e58c4f3..f767b34d 100644 --- a/patches/net/minecraft/server/bossevents/CustomBossEvent.java.patch +++ b/patches/net/minecraft/server/bossevents/CustomBossEvent.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/bossevents/CustomBossEvent.java +++ b/net/minecraft/server/bossevents/CustomBossEvent.java -@@ -18,12 +_,22 @@ +@@ -18,12 +_,24 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.util.Mth; import net.minecraft.world.BossEvent; @@ -12,6 +12,7 @@ private final Set players = Sets.newHashSet(); private int value; private int max = 100; ++ // CraftBukkit start + private KeyedBossBar bossBar; + + public KeyedBossBar getBukkitEntity() { @@ -20,6 +21,7 @@ + } + return bossBar; + } ++ // CraftBukkit end public CustomBossEvent(ResourceLocation p_136261_, Component p_136262_) { super(p_136262_, BossEvent.BossBarColor.WHITE, BossEvent.BossBarOverlay.PROGRESS); diff --git a/patches/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch b/patches/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch index 863601c8..62bee553 100644 --- a/patches/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch +++ b/patches/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch @@ -1,6 +1,11 @@ --- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -24,6 +_,7 @@ +@@ -20,10 +_,12 @@ + import net.minecraft.DefaultUncaughtExceptionHandler; + import net.minecraft.core.UUIDUtil; + import net.minecraft.network.Connection; ++import net.minecraft.network.ConnectionProtocol; + import net.minecraft.network.DisconnectionDetails; import net.minecraft.network.PacketSendListener; import net.minecraft.network.TickablePacketListener; import net.minecraft.network.chat.Component;