From 8b00b9a52d378c4f25dc00dc4a6e74e9600e53dc Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Fri, 8 Mar 2024 15:52:00 -0800 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit) (#10301) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 7ca2b46c SPIGOT-7594: Fix typo and include missing MinecraftExperimental annotation in Loot Table enum CraftBukkit Changes: 176c0ad39 Fix copying BlockStates with fields (eg, Banner) ee685bd2a Fix Camel not standing up when hurt 619936d4b Increase outdated build delay --- .../api/add-missing-Experimental-annotations.patch | 11 +++++++++++ patches/server/Build-system-changes.patch | 2 +- patches/server/CB-fixes.patch | 14 ++++++++++---- .../Fix-several-issues-with-EntityBreedEvent.patch | 6 +++--- patches/server/Fix-this-stupid-bullshit.patch | 2 +- patches/server/MC-Dev-fixes.patch | 13 ------------- patches/server/Missing-eating-regain-reason.patch | 8 ++++---- ...in-client-crashes-server-lists-and-Mojang.patch | 2 +- work/Bukkit | 2 +- work/CraftBukkit | 2 +- 10 files changed, 33 insertions(+), 29 deletions(-) diff --git a/patches/api/add-missing-Experimental-annotations.patch b/patches/api/add-missing-Experimental-annotations.patch index c43e3f59fa..33244de038 100644 --- a/patches/api/add-missing-Experimental-annotations.patch +++ b/patches/api/add-missing-Experimental-annotations.patch @@ -651,3 +651,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 TRIAL_CHAMBERS_CORRIDOR_POT("pots/trial_chambers/corridor"), SHIPWRECK_MAP("chests/shipwreck_map"), SHIPWRECK_SUPPLY("chests/shipwreck_supply"), +@@ -0,0 +0,0 @@ public enum LootTables implements Keyed { + PIGLIN_BARTERING("gameplay/piglin_bartering"), + // Spawners + @MinecraftExperimental ++ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation + TRIAL_CHAMBER_KEY("spawners/trial_chamber/key"), + @MinecraftExperimental ++ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation + TRIAL_CHAMBER_CONSUMABLES("spawners/trial_chamber/consumables"), + // Archaeology + DESERT_WELL_ARCHAEOLOGY("archaeology/desert_well"), diff --git a/patches/server/Build-system-changes.patch b/patches/server/Build-system-changes.patch index 0ca0d65796..c5e59ed6fd 100644 --- a/patches/server/Build-system-changes.patch +++ b/patches/server/Build-system-changes.patch @@ -146,7 +146,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper Calendar deadline = Calendar.getInstance(); - deadline.add(Calendar.DAY_OF_YEAR, -7); + deadline.add(Calendar.DAY_OF_YEAR, -28); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java diff --git a/patches/server/CB-fixes.patch b/patches/server/CB-fixes.patch index 85dcd3d40f..c7146b5b41 100644 --- a/patches/server/CB-fixes.patch +++ b/patches/server/CB-fixes.patch @@ -37,11 +37,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @Override -- protected void actuallyHurt(DamageSource source, float amount) { -+ protected boolean actuallyHurt(DamageSource source, float amount) { // Paper - Fix CB... +- // CraftBukkit start - void -> boolean +- protected boolean actuallyHurt(DamageSource damagesource, float f) { +- boolean hurt = super.actuallyHurt(damagesource, f); +- if (!hurt) { +- return hurt; +- } +- // CraftBukkit end ++ protected boolean actuallyHurt(DamageSource damagesource, float f) { // Paper - change return type to boolean this.standUpInstantly(); -- super.actuallyHurt(source, amount); -+ return super.actuallyHurt(source, amount); // Paper - Fix CB... +- return hurt; // CraftBukkit ++ return super.actuallyHurt(damagesource, f); // Paper - change return type to boolean } @Override diff --git a/patches/server/Fix-several-issues-with-EntityBreedEvent.patch b/patches/server/Fix-several-issues-with-EntityBreedEvent.patch index 7e66945dd5..86aac87593 100644 --- a/patches/server/Fix-several-issues-with-EntityBreedEvent.patch +++ b/patches/server/Fix-several-issues-with-EntityBreedEvent.patch @@ -73,14 +73,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java @@ -0,0 +0,0 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl + boolean flag1 = this.isTamed() && this.getAge() == 0 && this.canFallInLove(); - boolean bl2 = this.isTamed() && this.getAge() == 0 && this.canFallInLove(); - if (bl2) { + if (flag1) { - this.setInLove(player); + this.setInLove(player, item.copy()); // Paper - Fix EntityBreedEvent copying } - boolean bl3 = this.isBaby(); + boolean flag2 = this.isBaby(); diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java diff --git a/patches/server/Fix-this-stupid-bullshit.patch b/patches/server/Fix-this-stupid-bullshit.patch index 85aca2d071..6286528519 100644 --- a/patches/server/Fix-this-stupid-bullshit.patch +++ b/patches/server/Fix-this-stupid-bullshit.patch @@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ public class Main { Calendar deadline = Calendar.getInstance(); - deadline.add(Calendar.DAY_OF_YEAR, -7); + deadline.add(Calendar.DAY_OF_YEAR, -28); if (buildDate.before(deadline.getTime())) { - System.err.println("*** Error, this build is outdated ***"); + // Paper start - This is some stupid bullshit diff --git a/patches/server/MC-Dev-fixes.patch b/patches/server/MC-Dev-fixes.patch index cfc893631e..3e9c9a43a1 100644 --- a/patches/server/MC-Dev-fixes.patch +++ b/patches/server/MC-Dev-fixes.patch @@ -141,19 +141,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public static SortedArraySet create(Comparator comparator) { -diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -@@ -0,0 +0,0 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl - @Override - protected void customServerAiStep() { - this.level().getProfiler().push("camelBrain"); -- Brain brain = this.getBrain(); -+ Brain brain = (Brain) this.getBrain(); // Paper - decompile fix - brain.tick((ServerLevel)this.level(), this); - this.level().getProfiler().pop(); - this.level().getProfiler().push("camelActivityUpdate"); diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java diff --git a/patches/server/Missing-eating-regain-reason.patch b/patches/server/Missing-eating-regain-reason.patch index 54ac805bd0..21c2e6d51a 100644 --- a/patches/server/Missing-eating-regain-reason.patch +++ b/patches/server/Missing-eating-regain-reason.patch @@ -22,14 +22,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java @@ -0,0 +0,0 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl - } else { - boolean bl = this.getHealth() < this.getMaxHealth(); - if (bl) { + boolean flag = this.getHealth() < this.getMaxHealth(); + + if (flag) { - this.heal(2.0F); + this.heal(2.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // Paper - Add missing regain reason } - boolean bl2 = this.isTamed() && this.getAge() == 0 && this.canFallInLove(); + boolean flag1 = this.isTamed() && this.getAge() == 0 && this.canFallInLove(); diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java diff --git a/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index 490ee13e88..a0d0ae0e8e 100644 --- a/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ public class Main { - deadline.add(Calendar.DAY_OF_YEAR, -7); + deadline.add(Calendar.DAY_OF_YEAR, -28); if (buildDate.before(deadline.getTime())) { System.err.println("*** Error, this build is outdated ***"); - System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***"); diff --git a/work/Bukkit b/work/Bukkit index 9a80d38c00..7ca2b46c1a 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 9a80d38c002509a4849c5e5f735dca9f9b5731e4 +Subproject commit 7ca2b46c1a7d7479e45a79aa2db86de5c7fd20d8 diff --git a/work/CraftBukkit b/work/CraftBukkit index 98b6c1ac7d..176c0ad39f 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 98b6c1ac7d4698ded83d96217861b071e519b300 +Subproject commit 176c0ad39fffd8a6003e686b910fc02b669f1434