geforkt von Mirrors/Paper
Deprecate duplicate SoundGroup API (#7509)
Dieser Commit ist enthalten in:
Ursprung
bce57808da
Commit
dfa6307b48
@ -21,46 +21,58 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * Represents the sounds that a {@link Block} makes in certain situations
|
||||
+ * <p>
|
||||
+ * The sound group includes break, step, place, hit, and fall sounds.
|
||||
+ * @deprecated use {@link org.bukkit.SoundGroup}
|
||||
+ */
|
||||
+@Deprecated(forRemoval = true)
|
||||
+public interface BlockSoundGroup {
|
||||
+ /**
|
||||
+ * Gets the sound that plays when breaking this block
|
||||
+ *
|
||||
+ * @return The break sound
|
||||
+ * @deprecated use {@link org.bukkit.SoundGroup#getBreakSound()}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ Sound getBreakSound();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the sound that plays when stepping on this block
|
||||
+ *
|
||||
+ * @return The step sound
|
||||
+ * @deprecated use {@link org.bukkit.SoundGroup#getStepSound()}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ Sound getStepSound();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the sound that plays when placing this block
|
||||
+ *
|
||||
+ * @return The place sound
|
||||
+ * @deprecated use {@link org.bukkit.SoundGroup#getPlaceSound()}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ Sound getPlaceSound();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the sound that plays when hitting this block
|
||||
+ *
|
||||
+ * @return The hit sound
|
||||
+ * @deprecated use {@link org.bukkit.SoundGroup#getHitSound()}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ Sound getHitSound();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the sound that plays when this block falls
|
||||
+ *
|
||||
+ * @return The fall sound
|
||||
+ * @deprecated use {@link org.bukkit.SoundGroup#getFallSound()}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ Sound getFallSound();
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||
@ -79,8 +91,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * This object contains the block, step, place, hit, and fall sounds.
|
||||
+ *
|
||||
+ * @return the sound group for this block
|
||||
+ * @deprecated use {@link #getBlockSoundGroup()}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ com.destroystokyo.paper.block.BlockSoundGroup getSoundGroup();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the {@link org.bukkit.SoundGroup} for this block.
|
||||
+ *
|
||||
+ * @return the sound group for this block
|
||||
+ */
|
||||
+ @NotNull org.bukkit.SoundGroup getBlockSoundGroup();
|
||||
+ // Paper end
|
||||
}
|
||||
|
@ -225,9 +225,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
/**
|
||||
* Gets the metadata for this block
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable {
|
||||
* @return the sound group for this block
|
||||
*/
|
||||
@NotNull
|
||||
com.destroystokyo.paper.block.BlockSoundGroup getSoundGroup();
|
||||
@NotNull org.bukkit.SoundGroup getBlockSoundGroup();
|
||||
+
|
||||
+ /**
|
||||
+ * Return the translation key for the Block, so the client can translate it into the active
|
||||
|
@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
@@ -0,0 +0,0 @@ public class CraftBlock implements Block {
|
||||
public com.destroystokyo.paper.block.BlockSoundGroup getSoundGroup() {
|
||||
return new com.destroystokyo.paper.block.CraftBlockSoundGroup(getNMS().getBlock().defaultBlockState().getSoundType());
|
||||
public org.bukkit.SoundGroup getBlockSoundGroup() {
|
||||
return org.bukkit.craftbukkit.CraftSoundGroup.getSoundGroup(this.getNMS().getSoundType());
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
|
@ -16,6 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import org.bukkit.Sound;
|
||||
+import org.bukkit.craftbukkit.CraftSound;
|
||||
+
|
||||
+@Deprecated(forRemoval = true)
|
||||
+public class CraftBlockSoundGroup implements BlockSoundGroup {
|
||||
+ private final SoundType soundEffectType;
|
||||
+
|
||||
@ -62,5 +63,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ public com.destroystokyo.paper.block.BlockSoundGroup getSoundGroup() {
|
||||
+ return new com.destroystokyo.paper.block.CraftBlockSoundGroup(getNMS().getBlock().defaultBlockState().getSoundType());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public org.bukkit.SoundGroup getBlockSoundGroup() {
|
||||
+ return org.bukkit.craftbukkit.CraftSoundGroup.getSoundGroup(this.getNMS().getSoundType());
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren