aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0769-fix-Instruments.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0769-fix-Instruments.patch')
-rw-r--r--patches/server/0769-fix-Instruments.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/patches/server/0769-fix-Instruments.patch b/patches/server/0769-fix-Instruments.patch
index b04e954595..a3ba7ec083 100644
--- a/patches/server/0769-fix-Instruments.patch
+++ b/patches/server/0769-fix-Instruments.patch
@@ -55,3 +55,29 @@ index 0000000000000000000000000000000000000000..cd718ed01ba5d448cdf0a2b6a39dc7ef
+ assertEquals(nms.getSoundEvent(), CraftSound.bukkitToMinecraftHolder(bukkit.getSound()));
+ }
+}
+diff --git a/src/test/java/org/bukkit/InstrumentTest.java b/src/test/java/org/bukkit/InstrumentTest.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..5da6b5c996c9a4077f309e923731e3f148e91c19
+--- /dev/null
++++ b/src/test/java/org/bukkit/InstrumentTest.java
+@@ -0,0 +1,20 @@
++package org.bukkit;
++
++import org.bukkit.support.environment.AllFeatures;
++import org.junit.jupiter.api.Test;
++
++import static org.bukkit.support.MatcherAssert.assertThat;
++import static org.hamcrest.CoreMatchers.is;
++
++@AllFeatures
++public class InstrumentTest { // Paper - moved to internals as this test now access the sound registry.
++
++ @Test
++ public void getByType() {
++ for (Instrument instrument : Instrument.values()) {
++ // Paper - byte magic values are still used
++
++ assertThat(Instrument.getByType(instrument.getType()), is(instrument));
++ }
++ }
++}