diff options
author | Spottedleaf <[email protected]> | 2024-07-17 10:24:53 -0700 |
---|---|---|
committer | Spottedleaf <[email protected]> | 2024-07-17 10:28:32 -0700 |
commit | 00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6 (patch) | |
tree | 82639515bc5e9ae00c1e639e72137ed51e1ac688 /patches/server/0291-Implement-CraftBlockSoundGroup.patch | |
parent | 967f98aa81da851740aeb429778e46159fd188df (diff) | |
download | Paper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.tar.gz Paper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.zip |
Remove Moonrise utils to MCUtils, remove duplicated/unused utils
Diffstat (limited to 'patches/server/0291-Implement-CraftBlockSoundGroup.patch')
-rw-r--r-- | patches/server/0291-Implement-CraftBlockSoundGroup.patch | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/patches/server/0291-Implement-CraftBlockSoundGroup.patch b/patches/server/0291-Implement-CraftBlockSoundGroup.patch new file mode 100644 index 0000000000..9bf16806b3 --- /dev/null +++ b/patches/server/0291-Implement-CraftBlockSoundGroup.patch @@ -0,0 +1,72 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: simpleauthority <[email protected]> +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..3913c407a3bfa7dfa4a5e374a5e792962fcdafe6 +--- /dev/null ++++ b/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java +@@ -0,0 +1,39 @@ ++package com.destroystokyo.paper.block; ++ ++import net.minecraft.world.level.block.SoundType; ++import org.bukkit.Sound; ++import org.bukkit.craftbukkit.CraftSound; ++ ++@Deprecated(forRemoval = true) ++public class CraftBlockSoundGroup implements BlockSoundGroup { ++ private final SoundType soundEffectType; ++ ++ public CraftBlockSoundGroup(SoundType soundEffectType) { ++ this.soundEffectType = soundEffectType; ++ } ++ ++ @Override ++ public Sound getBreakSound() { ++ return CraftSound.minecraftToBukkit(soundEffectType.getBreakSound()); ++ } ++ ++ @Override ++ public Sound getStepSound() { ++ return CraftSound.minecraftToBukkit(soundEffectType.getStepSound()); ++ } ++ ++ @Override ++ public Sound getPlaceSound() { ++ return CraftSound.minecraftToBukkit(soundEffectType.getPlaceSound()); ++ } ++ ++ @Override ++ public Sound getHitSound() { ++ return CraftSound.minecraftToBukkit(soundEffectType.getHitSound()); ++ } ++ ++ @Override ++ public Sound getFallSound() { ++ return CraftSound.minecraftToBukkit(soundEffectType.getFallSound()); ++ } ++} +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +index 013298c424025cd88f15d61e50d196f70fa4c58b..d4e14ac1514e2d8b87b4667a91c90eded3ba6636 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +@@ -622,4 +622,16 @@ public class CraftBlock implements Block { + public String getTranslationKey() { + return this.getNMS().getBlock().getDescriptionId(); + } ++ ++ // Paper start ++ @Override ++ 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 + } |