Updated Upstream (Bukkit/CraftBukkit) (#8714)

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:
aef9b6d2 PR-800: Add support for NoteBlock sounds in Skulls

CraftBukkit Changes:
ae8f5fc02 PR-1125: Add support for NoteBlock sounds in Skulls
0a1c89e4b SPIGOT-7212: Allow negative firework power
909a246af SPIGOT-7211: generateTree() with Consumer or Predicate is broken
c810c3ed8 Increase outdated build delay
This commit is contained in:
Jake Potrebic 2022-12-26 09:53:35 -08:00
parent d4d31bb847
commit 7c42959fb0
11 changed files with 150 additions and 60 deletions

View file

@ -87,4 +87,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Deprecated // Paper
void setOwnerProfile(@Nullable PlayerProfile profile);
@Override
/**

View file

@ -348,6 +348,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+@org.jetbrains.annotations.ApiStatus.Experimental // Paper
public interface HangingSign extends Sign {
}
diff --git a/src/main/java/org/bukkit/block/Skull.java b/src/main/java/org/bukkit/block/Skull.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/block/Skull.java
+++ b/src/main/java/org/bukkit/block/Skull.java
@@ -0,0 +0,0 @@ public interface Skull extends TileState {
*
* @return the key of the sound, or null
*/
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper
@Nullable
public NamespacedKey getNoteBlockSound();
@@ -0,0 +0,0 @@ public interface Skull extends TileState {
*
* @param noteBlockSound the key of the sound to be played, or null
*/
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper
public void setNoteBlockSound(@Nullable NamespacedKey noteBlockSound);
/**
diff --git a/src/main/java/org/bukkit/block/data/type/ChiseledBookshelf.java b/src/main/java/org/bukkit/block/data/type/ChiseledBookshelf.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/block/data/type/ChiseledBookshelf.java
@ -454,3 +474,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public interface BundleMeta extends ItemMeta {
/**
diff --git a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
@@ -0,0 +0,0 @@ public interface SkullMeta extends ItemMeta {
*
* @param noteBlockSound the key of the sound to be played, or null
*/
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper
void setNoteBlockSound(@Nullable NamespacedKey noteBlockSound);
/**
@@ -0,0 +0,0 @@ public interface SkullMeta extends ItemMeta {
*
* @return the key of the sound, or null
*/
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper
@Nullable
NamespacedKey getNoteBlockSound();

View file

@ -30,50 +30,80 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
STICKS(0x3),
@@ -0,0 +0,0 @@ public enum Instrument {
/**
* Pling is normally played when a note block is on top of a glowstone block.
* Zombie is normally played when a Zombie Head is on top of the note block.
*/
- PLING(0xF);
+ // Paper start
+ PLING(0xF),
+ /**
+ * Zombie is normally played when a zombie head is on top of a note block.
+ */
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ ZOMBIE(0x10),
+ /**
+ * Skeleton is normally played when a skeleton skull is on top of a note block.
+ */
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ SKELETON(0x11),
+ /**
+ * Creeper is normally played when a creeper head is on top of a note block.
+ */
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ CREEPER(0x12),
+ /**
+ * Dragon is normally played when an Ender Dragon head is on top of a note block.
+ */
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ DRAGON(0x13),
+ /**
+ * Wither skeleton is normally played when a wither skeleton skull head is on top of a note block.
+ */
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ WITHER_SKELETON(0x14),
+ /**
+ * Piglin is normally played when a piglin head is on top of a note block.
+ */
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ PIGLIN(0x15),
+ /**
+ * Custom head is normally played when a player head is on top of a note block.
+ */
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ CUSTOM_HEAD(0x16);
+ // Paper end
- ZOMBIE,
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper
+ ZOMBIE(0x10), // Paper
/**
* Skeleton is normally played when a Skeleton Head is on top of the note block.
*/
- SKELETON,
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper
+ SKELETON(0x11), // Paper
/**
* Creeper is normally played when a Creeper Head is on top of the note block.
*/
- CREEPER,
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper
+ CREEPER(0x12), // Paper
/**
* Dragon is normally played when a Dragon Head is on top of the note block.
*/
- DRAGON,
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper
+ DRAGON(0x13), // Paper
/**
* Wither Skeleton is normally played when a Wither Skeleton Head is on top of the note block.
*/
- WITHER_SKELETON,
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper
+ WITHER_SKELETON(0x14), // Paper
/**
* Piglin is normally played when a Piglin Head is on top of the note block.
*/
- PIGLIN,
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper
+ PIGLIN(0x15), // Paper
/**
* Custom Sound is normally played when a Player Head with the required data is on top of the note block.
*/
- CUSTOM_HEAD;
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper
+ CUSTOM_HEAD(0x16); // Paper
private final byte type;
private static final Map<Byte, Instrument> BY_DATA = Maps.newHashMap();
- private Instrument() {
- this(-1);
- }
+ // Paper - remove ctor (the server still uses the byte magic value)
private Instrument(final int type) {
this.type = (byte) type;
@@ -0,0 +0,0 @@ public enum Instrument {
/**
* @return The type ID of this instrument.
- * @deprecated Magic value
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public byte getType() {
return this.type;
}
@@ -0,0 +0,0 @@ public enum Instrument {
*
* @param type The type ID
* @return The instrument
- * @deprecated Magic value
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable
public static Instrument getByType(final byte type) {
return BY_DATA.get(type);
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Player.java
@ -89,3 +119,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
*
* @param loc The location of a note block
* @param instrument The instrument
diff --git a/src/test/java/org/bukkit/InstrumentTest.java b/src/test/java/org/bukkit/InstrumentTest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/InstrumentTest.java
+++ b/src/test/java/org/bukkit/InstrumentTest.java
@@ -0,0 +0,0 @@ public class InstrumentTest {
@Test
public void getByType() {
for (Instrument instrument : Instrument.values()) {
- if (instrument.getType() < 0) {
- continue;
- }
+ // Paper - byte magic values are still used
assertThat(Instrument.getByType(instrument.getType()), is(instrument));
}

View file

@ -10,15 +10,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java
@@ -0,0 +0,0 @@ public class BlockStateListPopulator extends DummyGeneratorAccess {
public DimensionType dimensionType() {
return this.world.dimensionType();
@Override
public boolean isFluidAtPosition(BlockPos pos, Predicate<FluidState> state) {
- return this.world.isFluidAtPosition(pos, state);
+ return state.test(this.getFluidState(pos)); // Paper - fix
}
@Override
@@ -0,0 +0,0 @@ public class BlockStateListPopulator extends DummyGeneratorAccess {
public RegistryAccess registryAccess() {
return this.world.registryAccess();
}
+ // Paper start
+ @Override
+ public boolean isFluidAtPosition(BlockPos pos, Predicate<FluidState> state) {
+ return state.test(this.getFluidState(pos));
+ }
+
+ // Paper start
+ @Override
+ public <T extends BlockEntity> java.util.Optional<T> getBlockEntity(BlockPos pos, net.minecraft.world.level.block.entity.BlockEntityType<T> type) {
+ BlockEntity tileentity = this.getBlockEntity(pos);

View file

@ -100,5 +100,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- return builder.put(SKULL_OWNER.BUKKIT, new CraftPlayerProfile(this.profile));
+ return builder.put(SKULL_OWNER.BUKKIT, new com.destroystokyo.paper.profile.CraftPlayerProfile(this.profile)); // Paper
}
return builder;
}
NamespacedKey namespacedKeyNB = this.getNoteBlockSound();
if (namespacedKeyNB != null) {

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, -7);
deadline.add(Calendar.DAY_OF_YEAR, -14);
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

@ -55,13 +55,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
@@ -0,0 +0,0 @@ public class SkullBlockEntity extends BlockEntity {
public static void updateGameprofile(@Nullable GameProfile owner, Consumer<GameProfile> callback) {
if (owner != null && !StringUtil.isNullOrEmpty(owner.getName()) && (!owner.isComplete() || !owner.getProperties().containsKey("textures")) && profileCache != null && sessionService != null) {
profileCache.getAsync(owner.getName(), (profile) -> {
if (owner != null && !StringUtil.isNullOrEmpty(owner.getName()) && (!owner.isComplete() || !owner.getProperties().containsKey("textures")) && SkullBlockEntity.profileCache != null && SkullBlockEntity.sessionService != null) {
SkullBlockEntity.profileCache.getAsync(owner.getName(), (optional) -> {
- Util.backgroundExecutor().execute(() -> {
+ Util.PROFILE_EXECUTOR.execute(() -> { // Paper - not a good idea to use BLOCKING OPERATIONS on the worldgen executor
Util.ifElse(profile, (profilex) -> {
Property property = Iterables.getFirst(profilex.getProperties().get("textures"), (Property)null);
if (property == null) {
Util.ifElse(optional, (gameprofile1) -> {
Property property = (Property) Iterables.getFirst(gameprofile1.getProperties().get("textures"), (Object) null);
diff --git a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java b/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java

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, -7);
deadline.add(Calendar.DAY_OF_YEAR, -14);
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, -7);
deadline.add(Calendar.DAY_OF_YEAR, -14);
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 f50ad1f8b307cda71968d3f53921ab29d1e5835a
Subproject commit aef9b6d2051e45d924d2e2b294fdb700b357bd3c

@ -1 +1 @@
Subproject commit 2ed3e3e6e50cb606709522d4476f98e9edc5e79c
Subproject commit ae8f5fc02595a9a70dab28ad1835c9cd44ddc60d