mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-28 21:47:55 +01:00
92 lines
3.4 KiB
Diff
92 lines
3.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
Date: Fri, 9 Dec 2022 01:34:03 -0800
|
|
Subject: [PATCH] fix Instruments
|
|
|
|
Add missing instrument enums
|
|
fix some wrong javadocs
|
|
|
|
diff --git a/src/main/java/org/bukkit/Instrument.java b/src/main/java/org/bukkit/Instrument.java
|
|
index 92194803bcdfbcfdb99567835906ce9219eabd04..ec36b0a685bbaf80ae563ad169a94a62298edd88 100644
|
|
--- a/src/main/java/org/bukkit/Instrument.java
|
|
+++ b/src/main/java/org/bukkit/Instrument.java
|
|
@@ -7,7 +7,7 @@ import org.jetbrains.annotations.Nullable;
|
|
public enum Instrument {
|
|
|
|
/**
|
|
- * Piano is the standard instrument for a note block.
|
|
+ * Piano (Harp) is the standard instrument for a note block.
|
|
*/
|
|
PIANO(0x0),
|
|
/**
|
|
@@ -21,7 +21,7 @@ public enum Instrument {
|
|
*/
|
|
SNARE_DRUM(0x2),
|
|
/**
|
|
- * Sticks are normally played when a note block is on top of a glass
|
|
+ * Sticks (Hat) are normally played when a note block is on top of a glass
|
|
* block.
|
|
*/
|
|
STICKS(0x3),
|
|
@@ -74,7 +74,44 @@ public enum Instrument {
|
|
/**
|
|
* Pling is normally played when a note block is on top of a glowstone 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
|
|
|
|
private final byte type;
|
|
private static final Map<Byte, Instrument> BY_DATA = Maps.newHashMap();
|
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
|
index 1e27b9de47f111b9c000243214e22890e323f7fc..19995314b01f19c312efa2a4584ccfba2d700c52 100644
|
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
|
@@ -393,9 +393,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
public void playNote(@NotNull Location loc, byte instrument, byte note);
|
|
|
|
/**
|
|
- * Play a note for a player at a location. This requires a note block
|
|
- * at the particular location (as far as the client is concerned). This
|
|
- * will not work without a note block. This will not work with cake.
|
|
+ * Play a note for a player at a location.
|
|
*
|
|
* @param loc The location of a note block
|
|
* @param instrument The instrument
|