Updated Upstream (Bukkit/CraftBukkit/Spigot) (#8124)

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:
607ce370 SPIGOT-7069: Material.BARREL has Directional data class, should also be Openable
f14cea82 SPIGOT-7070: Material.SCULK_VEIN has Waterlogged data class, should also be MultipleFacing
8e43b278 PR-767: Add support checking/survivability methods for BlockData
b3dee151 SPIGOT-7083: Add Boat.WoodenType, Boat.Status; deprecate TreeSpecies

CraftBukkit Changes:
9a8e08010 SPIGOT-7069: Material.BARREL has Directional data class, should also be Openable
26bd88ccd SPIGOT-7070: Material.SCULK_VEIN has Waterlogged data class, should also be MultipleFacing
7ba06e15b SPIGOT-7095: StructureGrowEvent doesn't fire for mangrove propagules growing to a tree
163e35c91 PR-1079: Add support checking/survivability methods for BlockData
4230f8f0e SPIGOT-7083: Add Boat.WoodenType, Boat.Status; deprecate TreeSpecies

Spigot Changes:
14a2382f Rebuild patches
This commit is contained in:
Jake Potrebic 2022-07-12 10:16:05 -07:00 committed by GitHub
parent e294802977
commit b58063a949
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 40 additions and 84 deletions

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Material API additions
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 2f53bb42dc6a09ed35ec1335d23adf07289575fa..e40766c56fea6daae9f84fbdeb0b3f533e28d0b7 100644
index 8314acc3cacb9a0da91097f1615868e663baceb2..e995480855e113d1f5a6f6b4972795005b9d9ed0 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -106,6 +106,7 @@ import org.jetbrains.annotations.Nullable;
@@ -108,6 +108,7 @@ import org.jetbrains.annotations.Nullable;
/**
* An enum of all material IDs accepted by the official server and client
*/
@ -16,7 +16,7 @@ index 2f53bb42dc6a09ed35ec1335d23adf07289575fa..e40766c56fea6daae9f84fbdeb0b3f53
public enum Material implements Keyed {
//<editor-fold desc="Materials" defaultstate="collapsed">
AIR(9648, 0),
@@ -4110,6 +4111,22 @@ public enum Material implements Keyed {
@@ -4112,6 +4113,22 @@ public enum Material implements Keyed {
}
}

View File

@ -79,10 +79,10 @@ index 57cb548683f7b2972c998afd34176952426f8b47..d4c87bfed81b2d73919705912f59fab0
if (this.world == null) {
return null;
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index e40766c56fea6daae9f84fbdeb0b3f533e28d0b7..80b79ffa10ce7eba30d1df4ffa0e928be42f445f 100644
index e995480855e113d1f5a6f6b4972795005b9d9ed0..f3e50dee6cf453d6621dcdbef0047335147f4d0c 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -4140,11 +4140,11 @@ public enum Material implements Keyed {
@@ -4142,11 +4142,11 @@ public enum Material implements Keyed {
}
/**
@ -96,7 +96,7 @@ index e40766c56fea6daae9f84fbdeb0b3f533e28d0b7..80b79ffa10ce7eba30d1df4ffa0e928b
public boolean isLegacy() {
return legacy;
}
@@ -4215,8 +4215,10 @@ public enum Material implements Keyed {
@@ -4217,8 +4217,10 @@ public enum Material implements Keyed {
* Gets the MaterialData class associated with this Material
*
* @return MaterialData associated with this Material

View File

@ -144,10 +144,10 @@ index dddc450e1372409c513bbedc0acfc80d9f749333..38a1b02c006af766b0c10ee65e9fc28f
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 80b79ffa10ce7eba30d1df4ffa0e928be42f445f..04e07abc29ed1c4eae27529307c4fa11b6fbc3f6 100644
index f3e50dee6cf453d6621dcdbef0047335147f4d0c..f0042c25a19860645d0c869fad58625b6ecafb6e 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -107,7 +107,7 @@ import org.jetbrains.annotations.Nullable;
@@ -109,7 +109,7 @@ import org.jetbrains.annotations.Nullable;
* An enum of all material IDs accepted by the official server and client
*/
@SuppressWarnings({"DeprecatedIsStillUsed", "deprecation"}) // Paper
@ -156,7 +156,7 @@ index 80b79ffa10ce7eba30d1df4ffa0e928be42f445f..04e07abc29ed1c4eae27529307c4fa11
//<editor-fold desc="Materials" defaultstate="collapsed">
AIR(9648, 0),
STONE(22948),
@@ -4125,6 +4125,23 @@ public enum Material implements Keyed {
@@ -4127,6 +4127,23 @@ public enum Material implements Keyed {
}
return false;
}

View File

@ -5,27 +5,22 @@ Subject: [PATCH] Add API to get Material from Boats and Minecarts
diff --git a/src/main/java/org/bukkit/entity/Boat.java b/src/main/java/org/bukkit/entity/Boat.java
index 24751b5c4e3bc24bdfa85af8f6fcba37413aa002..e0d0537606d4f9a3fe588ebf7d02f314c0359335 100644
index e5d5d2c944df1e9a81b38d3854fbe70c166588d1..3f848572935a73f637c6a91a97fa70041b0c6361 100644
--- a/src/main/java/org/bukkit/entity/Boat.java
+++ b/src/main/java/org/bukkit/entity/Boat.java
@@ -1,5 +1,6 @@
package org.bukkit.entity;
+import org.bukkit.Material;
import org.bukkit.TreeSpecies;
import org.jetbrains.annotations.NotNull;
@@ -103,4 +104,14 @@ public interface Boat extends Vehicle {
*/
@Deprecated
public void setWorkOnLand(boolean workOnLand);
@@ -173,4 +173,16 @@ public interface Boat extends Vehicle {
ON_LAND,
IN_AIR;
}
+
+ // Paper start
+ /**
+ * Gets the {@link Material} that represents this Boat type.
+ *
+ * @return the boat material.
+ * @deprecated use {@link #getBoatType()} and {@link Type#getMaterial()}
+ */
+ @Deprecated
+ @NotNull
+ public Material getBoatMaterial();
+ // Paper end

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Cache the result of Material#isBlock
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 04e07abc29ed1c4eae27529307c4fa11b6fbc3f6..4c8c21982f825bb70ff5e14098836215bdb0cd17 100644
index f0042c25a19860645d0c869fad58625b6ecafb6e..1a718a69e97cabda6a1c78529110193c14899949 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -4069,6 +4069,7 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
@@ -4071,6 +4071,7 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
public final Class<?> data;
private final boolean legacy;
private final NamespacedKey key;
@ -16,7 +16,7 @@ index 04e07abc29ed1c4eae27529307c4fa11b6fbc3f6..4c8c21982f825bb70ff5e14098836215
private Material(final int id) {
this(id, 64);
@@ -4275,6 +4276,11 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
@@ -4277,6 +4278,11 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
* @return true if this material is a block
*/
public boolean isBlock() {
@ -28,7 +28,7 @@ index 04e07abc29ed1c4eae27529307c4fa11b6fbc3f6..4c8c21982f825bb70ff5e14098836215
switch (this) {
//<editor-fold defaultstate="collapsed" desc="isBlock">
case ACACIA_BUTTON:
@@ -5391,6 +5397,7 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
@@ -5393,6 +5399,7 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
static {
for (Material material : values()) {
BY_NAME.put(material.name(), material);

View File

@ -39,10 +39,10 @@ index 0000000000000000000000000000000000000000..74ef8395cc040ce488c2acaa416db202
+ }
+}
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 4c8c21982f825bb70ff5e14098836215bdb0cd17..663452b8009d2899f8a196a20b6337024ce3caf0 100644
index 1a718a69e97cabda6a1c78529110193c14899949..4e6273c609630be7c196d4eed54fbca097eaf7d4 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -4143,6 +4143,17 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
@@ -4145,6 +4145,17 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
public @NotNull String translationKey() {
return Bukkit.getUnsafe().getTranslationKey(this);
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Attributes API for item defaults
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 663452b8009d2899f8a196a20b6337024ce3caf0..12ed298cb585107370d4400902a651f43bd05d78 100644
index 4e6273c609630be7c196d4eed54fbca097eaf7d4..6eae173f589cb90eb6e41b5b75e13a3c02e7901d 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -4154,6 +4154,21 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
@@ -4156,6 +4156,21 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
public io.papermc.paper.inventory.ItemRarity getItemRarity() {
return Bukkit.getUnsafe().getItemRarity(this);
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add isCollidable methods to various places
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 12ed298cb585107370d4400902a651f43bd05d78..2d39ecea67cd033858eaa713e405260a87c718a3 100644
index 6eae173f589cb90eb6e41b5b75e13a3c02e7901d..1d6baee05643607baa40a07022576906ea61a92f 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -4169,6 +4169,16 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
@@ -4171,6 +4171,16 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) {
return Bukkit.getUnsafe().getItemAttributes(this, equipmentSlot);
}

View File

@ -26,10 +26,10 @@ index 06525d7687fec5b37cd6020ad1bac998b194e89f..942dae5116840a2e8a992f0830574ab2
// Paper start
protected boolean shapeExceedsCube = true;
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
index 15aff39d8d68430cc35ab134c0ab55cf50575cce..8ec78b26d6bfbcdad443c9649e35f79dd336b095 100644
index 8a4dcbbfdc4ef9f7fcd1eb04db010f93f5f06933..514e1ab74cd24cfcf1dd031e69a8ebfaddf9d3dc 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
@@ -533,7 +533,17 @@ public class CraftBlockData implements BlockData {
@@ -539,7 +539,17 @@ public class CraftBlockData implements BlockData {
return craft;
}

View File

@ -17,10 +17,10 @@ index 9ce0c366b81ee8468cfcca1bd9fb8ed49ffea0ba..343eb9e6417f94bec66b4d9ef583e04d
if (this.isSameThread()) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
index 8ec78b26d6bfbcdad443c9649e35f79dd336b095..37a6d050ae46461ad4b9b6c0fc9b9c2879d9b6fb 100644
index 514e1ab74cd24cfcf1dd031e69a8ebfaddf9d3dc..d02a5e383190fc4713141d953efc111bb2f7f89c 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
@@ -500,9 +500,39 @@ public class CraftBlockData implements BlockData {
@@ -506,9 +506,39 @@ public class CraftBlockData implements BlockData {
Preconditions.checkState(CraftBlockData.MAP.put(nms, bukkit) == null, "Duplicate mapping %s->%s", nms, bukkit);
}

View File

@ -67,10 +67,10 @@ index 0a755f38fae9dc84440f43113920c5b4c6d8218b..7b9e943b391c061782fccd2b8d705cee
public void setFlag(int flag) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
index 37a6d050ae46461ad4b9b6c0fc9b9c2879d9b6fb..ba3c0437d416b45e6444d16fd631c94665873cbb 100644
index d02a5e383190fc4713141d953efc111bb2f7f89c..aae7f7ab4931db8f955c3055157fe01f99931ec7 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
@@ -44,7 +44,7 @@ public class CraftBlockData implements BlockData {
@@ -50,7 +50,7 @@ public class CraftBlockData implements BlockData {
@Override
public Material getMaterial() {

View File

@ -5,23 +5,23 @@ Subject: [PATCH] Implement API to get Material from Boats and Minecarts
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
index 47f95fb26793fbf6c5c37187d4958ee5ba93f060..39e7aeb409a39bd8cd8200b18dd3da1e427519ab 100644
index 5871cd149fe07e97c5d68ffd83dae4d3fc6bcf03..40debf1130a8e6cc9510061976a01050cd8ddc05 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
@@ -65,6 +65,13 @@ public class CraftBoat extends CraftVehicle implements Boat {
@@ -80,6 +80,13 @@ public class CraftBoat extends CraftVehicle implements Boat {
this.getHandle().landBoats = workOnLand;
}
+ // Paper start
+ @Override
+ public org.bukkit.Material getBoatMaterial() {
+ return org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(getHandle().getDropItem());
+ return this.getBoatType().getMaterial();
+ }
+ // Paper end
+
@Override
public net.minecraft.world.entity.vehicle.Boat getHandle() {
return (net.minecraft.world.entity.vehicle.Boat) entity;
public Status getStatus() {
return CraftBoat.boatStatusFromNms(this.getHandle().status);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java
index 053112d7411caa6f439bd344e74aff8c844d93ac..067fcc1f44d59dd675a9cc5485234c87366ffe10 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecart.java

View File

@ -1,39 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Noah van der Aa <ndvdaa@gmail.com>
Date: Mon, 20 Jun 2022 15:46:46 +0200
Subject: [PATCH] Call StructureGrowEvent for mangrove propagule
diff --git a/src/main/java/net/minecraft/world/level/block/MangrovePropaguleBlock.java b/src/main/java/net/minecraft/world/level/block/MangrovePropaguleBlock.java
index 4eaf75ef7362ee781762f5e8def6bc4d986e9db7..0a60918ec9b2374cd9ae375a8d36ed1a212c19ae 100644
--- a/src/main/java/net/minecraft/world/level/block/MangrovePropaguleBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/MangrovePropaguleBlock.java
@@ -90,7 +90,28 @@ public class MangrovePropaguleBlock extends SaplingBlock implements SimpleWaterl
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
if (!isHanging(state)) {
if (random.nextInt(7) == 0) {
+ world.captureTreeGeneration = true; // Paper
this.advanceTree(world, pos, state, random);
+ // Paper start
+ world.captureTreeGeneration = false;
+ if (world.capturedBlockStates.size() > 0) {
+ org.bukkit.TreeType treeType = SaplingBlock.treeType;
+ SaplingBlock.treeType = null;
+ org.bukkit.Location location = new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ());
+ java.util.List<org.bukkit.block.BlockState> blocks = new java.util.ArrayList<>(world.capturedBlockStates.values());
+ world.capturedBlockStates.clear();
+ org.bukkit.event.world.StructureGrowEvent event = null;
+ if (treeType != null) {
+ event = new org.bukkit.event.world.StructureGrowEvent(location, treeType, false, null, blocks);
+ org.bukkit.Bukkit.getPluginManager().callEvent(event);
+ }
+ if (event == null || !event.isCancelled()) {
+ for (org.bukkit.block.BlockState blockstate : blocks) {
+ blockstate.update(true);
+ }
+ }
+ }
+ // Paper end
}
} else {

@ -1 +1 @@
Subproject commit d41796deb5e14fd69558db71324e8feb12a1effa
Subproject commit 607ce370a5e526985c050c9cec6abfc5fb2f475d

@ -1 +1 @@
Subproject commit 991aeda1218e72e9237942071e7ea55cc77b541c
Subproject commit 9a8e080108222cf09aed735a3b5089d3da6350c6

@ -1 +1 @@
Subproject commit 475f600885a8f58aee83aa7473f37dfe6b8ac3b5
Subproject commit 14a2382f7da41c880fdbf64536fb222df98dc111