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
This commit is contained in:
Jake Potrebic 2023-03-20 01:47:10 -07:00
parent 4015d08acf
commit edd270486c
11 changed files with 43 additions and 12 deletions

View file

@ -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
+ /**

View file

@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Pseudo jukebox inventory
+ */
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ JUKEBOX(1, "Jukebox");
+ JUKEBOX(1, "Jukebox", false);
+ // Paper end
;

View file

@ -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}
* </pre>
- * @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

View file

@ -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.
*

View file

@ -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() {

View file

@ -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

View file

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <nassim@njahnke.dev>
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);

View file

@ -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

View file

@ -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 ***");

@ -1 +1 @@
Subproject commit 2b4582fb6538a04313af12510624853d02250aba
Subproject commit 150a2861a7399537d077bb754438d12a8741fe36

@ -1 +1 @@
Subproject commit f7707086d107d825109234dd3020e22558dd1378
Subproject commit e5a7921f0597766fd92590317da11ffea85138a4