2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: simpleauthority <jacob@algorithmjunkie.com>
|
|
|
|
Date: Tue, 28 May 2019 03:48:51 -0700
|
|
|
|
Subject: [PATCH] Implement CraftBlockSoundGroup
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java b/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000000000000000000000000000000000000..9a516520d975f52169e346adc4ec6d9db843db2f
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java
|
|
|
|
@@ -0,0 +1,38 @@
|
|
|
|
+package com.destroystokyo.paper.block;
|
|
|
|
+
|
|
|
|
+import net.minecraft.world.level.block.SoundType;
|
|
|
|
+import org.bukkit.Sound;
|
|
|
|
+import org.bukkit.craftbukkit.CraftSound;
|
|
|
|
+
|
|
|
|
+public class CraftBlockSoundGroup implements BlockSoundGroup {
|
|
|
|
+ private final SoundType soundEffectType;
|
|
|
|
+
|
|
|
|
+ public CraftBlockSoundGroup(SoundType soundEffectType) {
|
|
|
|
+ this.soundEffectType = soundEffectType;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Sound getBreakSound() {
|
|
|
|
+ return CraftSound.getBukkit(soundEffectType.getBreakSound());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Sound getStepSound() {
|
|
|
|
+ return CraftSound.getBukkit(soundEffectType.getStepSound());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Sound getPlaceSound() {
|
|
|
|
+ return CraftSound.getBukkit(soundEffectType.getPlaceSound());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Sound getHitSound() {
|
|
|
|
+ return CraftSound.getBukkit(soundEffectType.getHitSound());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Sound getFallSound() {
|
|
|
|
+ return CraftSound.getBukkit(soundEffectType.getFallSound());
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
2021-08-12 19:55:20 +02:00
|
|
|
index 00fb1407ad34de6353746b22eb0caac8386aeb26..29c5f752ec2df0be757a58392d9e33b72dc1a2ec 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
2021-07-22 20:11:56 +02:00
|
|
|
@@ -759,4 +759,10 @@ public class CraftBlock implements Block {
|
2021-06-14 03:06:38 +02:00
|
|
|
VoxelShape shape = this.getNMS().getCollisionShape(world, position);
|
|
|
|
return new CraftVoxelShape(shape);
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public com.destroystokyo.paper.block.BlockSoundGroup getSoundGroup() {
|
2021-07-22 20:11:56 +02:00
|
|
|
+ return new com.destroystokyo.paper.block.CraftBlockSoundGroup(getNMS().getBlock().defaultBlockState().getSoundType());
|
2021-06-11 14:02:28 +02:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|