Fix note block sound property on player heads (#9158)

This commit is contained in:
Lulu13022002
2023-05-15 19:32:26 +02:00
parent 41ea1348fd
commit be21be4029
3 changed files with 21 additions and 19 deletions

View File

@@ -194,14 +194,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * recipes.
*
- * This includes it's name, description and other visible tags.
+ * This includes its name, description and other visible tags.
*
- * @return a AdvancementDisplay object, or null if not set.
+ * @return the display info
*/
- @Nullable
- AdvancementDisplay getDisplay();
+ @org.jetbrains.annotations.Nullable
+ */
+ @Nullable
+ io.papermc.paper.advancement.AdvancementDisplay getDisplay();
+
+ /**
@@ -210,7 +205,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * completes the advancement. Will return the same as
+ * {@link io.papermc.paper.advancement.AdvancementDisplay#displayName()} when an
+ * {@link io.papermc.paper.advancement.AdvancementDisplay} is present.
+ *
*
- * @return a AdvancementDisplay object, or null if not set.
+ * @return the display name
+ * @see io.papermc.paper.advancement.AdvancementDisplay#displayName()
+ */
@@ -220,8 +216,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Gets the parent advancement, if any.
+ *
+ * @return the parent advancement
+ */
+ @org.jetbrains.annotations.Nullable
*/
@Nullable
- AdvancementDisplay getDisplay();
+ Advancement getParent();
+
+ /**

View File

@@ -9,7 +9,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/event/block/NotePlayEvent.java
+++ b/src/main/java/org/bukkit/event/block/NotePlayEvent.java
@@ -0,0 +0,0 @@ public class NotePlayEvent extends BlockEvent implements Cancellable {
/**
* Overrides the {@link Instrument} to be used.
+ * <p>
+ * Only works when the note block isn't under a player head.
+ * For this specific case the 'note_block_sound' property of the
+ * player head state takes the priority.
*
* @param instrument the Instrument. Has no effect if null.
- * @deprecated no effect on newer Minecraft versions