From edd270486c663233e4c4027fe5111a1f4baca439 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Mon, 20 Mar 2023 01:47:10 -0700 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit) (#9013) * Updated Upstream (Bukkit/CraftBukkit) 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: 150a2861 PR-827: Add BlockData#getPlacementMaterial 58c9c8ce SPIGOT-7301: Prevent creating non-openable inventories 3741079b PR-824: Expand upon PotionEffect API to better accommodate infinite durations CraftBukkit Changes: e5a7921f0 PR-1149: Add BlockData#getPlacementMaterial 58504fa61 SPIGOT-7302: Fix more issues with EntityDamageByEntity - Fix Projectile damage by dispenser - Fix cases where only exists a direct entity damager 48394703d Increase outdated build delay * Improve docs for BlockData#getPlacementMaterial --- patches/api/Block-Ticking-API.patch | 4 ++-- patches/api/Fix-Jukeboxes.patch | 2 +- patches/api/Fix-upstream-javadocs.patch | 13 +++++++++++++ .../api/Mark-experimental-api-as-such.patch | 2 +- patches/server/Block-Ticking-API.patch | 5 +++-- patches/server/Build-system-changes.patch | 2 +- ...kshelf-and-jukebox-setItem-with-air.patch} | 19 ++++++++++++++++++- patches/server/Fix-this-stupid-bullshit.patch | 2 +- ...ient-crashes-server-lists-and-Mojang.patch | 2 +- work/Bukkit | 2 +- work/CraftBukkit | 2 +- 11 files changed, 43 insertions(+), 12 deletions(-) rename patches/server/{Fix-chiseled-bookshelf-setItem-with-air.patch => Fix-chiseled-bookshelf-and-jukebox-setItem-with-air.patch} (50%) diff --git a/patches/api/Block-Ticking-API.patch b/patches/api/Block-Ticking-API.patch index 160c0230b6..6b18f16a5b 100644 --- a/patches/api/Block-Ticking-API.patch +++ b/patches/api/Block-Ticking-API.patch @@ -35,9 +35,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/block/data/BlockData.java +++ b/src/main/java/org/bukkit/block/data/BlockData.java @@ -0,0 +0,0 @@ public interface BlockData extends Cloneable { - * @return true if the face is sturdy and can support a block, false otherwise */ - boolean isFaceSturdy(@NotNull BlockFace face, @NotNull BlockSupport support); + @NotNull + Material getPlacementMaterial(); + + // Paper start - Tick API + /** diff --git a/patches/api/Fix-Jukeboxes.patch b/patches/api/Fix-Jukeboxes.patch index 0b3358e5ad..4135ed985e 100644 --- a/patches/api/Fix-Jukeboxes.patch +++ b/patches/api/Fix-Jukeboxes.patch @@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * Pseudo jukebox inventory + */ + @org.jetbrains.annotations.ApiStatus.Experimental -+ JUKEBOX(1, "Jukebox"); ++ JUKEBOX(1, "Jukebox", false); + // Paper end ; diff --git a/patches/api/Fix-upstream-javadocs.patch b/patches/api/Fix-upstream-javadocs.patch index a1ef3bb4b8..427b9caa9a 100644 --- a/patches/api/Fix-upstream-javadocs.patch +++ b/patches/api/Fix-upstream-javadocs.patch @@ -89,6 +89,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + void setColor(@org.bukkit.UndefinedNullability("not supported") org.bukkit.DyeColor color); +// Paper end +} +diff --git a/src/main/java/org/bukkit/block/data/BlockData.java b/src/main/java/org/bukkit/block/data/BlockData.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/block/data/BlockData.java ++++ b/src/main/java/org/bukkit/block/data/BlockData.java +@@ -0,0 +0,0 @@ public interface BlockData extends Cloneable { + * {@link Material#REDSTONE_WIRE} -> {@link Material#REDSTONE} + * {@link Material#CARROTS} -> {@link Material#CARROT} + * +- * @return placement material ++ * @return placement material or {@link Material#AIR} if it doesn't have one + */ + @NotNull + Material getPlacementMaterial(); diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java diff --git a/patches/api/Mark-experimental-api-as-such.patch b/patches/api/Mark-experimental-api-as-such.patch index 51d8695205..e1e1862691 100644 --- a/patches/api/Mark-experimental-api-as-such.patch +++ b/patches/api/Mark-experimental-api-as-such.patch @@ -1198,7 +1198,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 * Pseudo chiseled bookshelf inventory, with 6 slots of undefined type. */ + @org.jetbrains.annotations.ApiStatus.Experimental // Paper - 1.20 - CHISELED_BOOKSHELF(6, "Chiseled Bookshelf"), + CHISELED_BOOKSHELF(6, "Chiseled Bookshelf", false), /** * The new smithing inventory, with 3 CRAFTING slots and 1 RESULT slot. * diff --git a/patches/server/Block-Ticking-API.patch b/patches/server/Block-Ticking-API.patch index 247f7b6aa1..56d00ff1d2 100644 --- a/patches/server/Block-Ticking-API.patch +++ b/patches/server/Block-Ticking-API.patch @@ -35,9 +35,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java @@ -0,0 +0,0 @@ public class CraftBlockData implements BlockData { - - return this.state.isFaceSturdy(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CraftBlock.blockFaceToNotch(face), CraftBlockSupport.toNMS(support)); + public Material getPlacementMaterial() { + return CraftMagicNumbers.getMaterial(this.state.getBlock().asItem()); } ++ + // Paper start - Block tick API + @Override + public boolean isRandomlyTicked() { diff --git a/patches/server/Build-system-changes.patch b/patches/server/Build-system-changes.patch index 616274d5f0..ed6743db7a 100644 --- a/patches/server/Build-system-changes.patch +++ b/patches/server/Build-system-changes.patch @@ -78,7 +78,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, -3); + deadline.add(Calendar.DAY_OF_YEAR, -7); 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/Fix-chiseled-bookshelf-setItem-with-air.patch b/patches/server/Fix-chiseled-bookshelf-and-jukebox-setItem-with-air.patch similarity index 50% rename from patches/server/Fix-chiseled-bookshelf-setItem-with-air.patch rename to patches/server/Fix-chiseled-bookshelf-and-jukebox-setItem-with-air.patch index e3b76ae33c..627115dce1 100644 --- a/patches/server/Fix-chiseled-bookshelf-setItem-with-air.patch +++ b/patches/server/Fix-chiseled-bookshelf-and-jukebox-setItem-with-air.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 18 Mar 2023 18:51:33 +0100 -Subject: [PATCH] Fix chiseled bookshelf setItem with air +Subject: [PATCH] Fix chiseled bookshelf and jukebox setItem with air diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java @@ -17,3 +17,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.items.set(slot, stack); this.updateState(slot); } +diff --git a/src/main/java/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/JukeboxBlockEntity.java +@@ -0,0 +0,0 @@ public class JukeboxBlockEntity extends BlockEntity implements Clearable, Contai + + @Override + public void setItem(int slot, ItemStack stack) { ++ // Paper start ++ if (stack.isEmpty()) { ++ this.removeItem(slot, 0); ++ return; ++ } ++ // Paper end + if (stack.is(ItemTags.MUSIC_DISCS) && this.level != null) { + this.items.set(slot, stack); + this.setHasRecordBlockState((Entity) null, true); diff --git a/patches/server/Fix-this-stupid-bullshit.patch b/patches/server/Fix-this-stupid-bullshit.patch index 97d468a1d9..b0622a8f53 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, -3); + deadline.add(Calendar.DAY_OF_YEAR, -7); 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/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index f8d0466902..4f4f1a2f1e 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, -3); + deadline.add(Calendar.DAY_OF_YEAR, -7); 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 2b4582fb65..150a2861a7 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 2b4582fb6538a04313af12510624853d02250aba +Subproject commit 150a2861a7399537d077bb754438d12a8741fe36 diff --git a/work/CraftBukkit b/work/CraftBukkit index f7707086d1..e5a7921f05 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit f7707086d107d825109234dd3020e22558dd1378 +Subproject commit e5a7921f0597766fd92590317da11ffea85138a4