mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
4e38844029
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 85b16b8a Update to Minecraft 1.16.5 CraftBukkit Changes: f3f30947 Update to Minecraft 1.16.5 Spigot Changes: 018b9a0d Update to Minecraft 1.16.5
83 lines
3.9 KiB
Diff
83 lines
3.9 KiB
Diff
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..0000000000000000000000000000000000000000
|
|
--- /dev/null
|
|
+++ b/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java
|
|
@@ -0,0 +0,0 @@
|
|
+package com.destroystokyo.paper.block;
|
|
+
|
|
+import net.minecraft.server.SoundEffectType;
|
|
+import org.bukkit.Sound;
|
|
+import org.bukkit.craftbukkit.CraftSound;
|
|
+
|
|
+public class CraftBlockSoundGroup implements BlockSoundGroup {
|
|
+ private final SoundEffectType soundEffectType;
|
|
+
|
|
+ public CraftBlockSoundGroup(SoundEffectType 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/net/minecraft/server/SoundEffectType.java b/src/main/java/net/minecraft/server/SoundEffectType.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/SoundEffectType.java
|
|
+++ b/src/main/java/net/minecraft/server/SoundEffectType.java
|
|
@@ -0,0 +0,0 @@ public class SoundEffectType {
|
|
public static final SoundEffectType U = new SoundEffectType(1.0F, 1.0F, SoundEffects.BLOCK_GILDED_BLACKSTONE_BREAK, SoundEffects.BLOCK_GILDED_BLACKSTONE_STEP, SoundEffects.BLOCK_GILDED_BLACKSTONE_PLACE, SoundEffects.BLOCK_GILDED_BLACKSTONE_HIT, SoundEffects.BLOCK_GILDED_BLACKSTONE_FALL);
|
|
public final float volume;
|
|
public final float pitch;
|
|
- public final SoundEffect breakSound;
|
|
+ public final SoundEffect breakSound; public final SoundEffect getBreakSound() { return this.breakSound; } // Paper - OBFHELPER // PAIL private -> public, rename breakSound
|
|
private final SoundEffect stepSound;
|
|
private final SoundEffect placeSound;
|
|
- public final SoundEffect hitSound;
|
|
+ public final SoundEffect hitSound; public final SoundEffect getHitSound() { return this.hitSound; } // Paper - OBFHELPER // PAIL private -> public, rename hitSound
|
|
private final SoundEffect fallSound;
|
|
|
|
public SoundEffectType(float f, float f1, SoundEffect soundeffect, SoundEffect soundeffect1, SoundEffect soundeffect2, SoundEffect soundeffect3, SoundEffect soundeffect4) {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- 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 {
|
|
AxisAlignedBB aabb = shape.getBoundingBox();
|
|
return new BoundingBox(getX() + aabb.minX, getY() + aabb.minY, getZ() + aabb.minZ, getX() + aabb.maxX, getY() + aabb.maxY, getZ() + aabb.maxZ);
|
|
}
|
|
+
|
|
+ // Paper start
|
|
+ @Override
|
|
+ public com.destroystokyo.paper.block.BlockSoundGroup getSoundGroup() {
|
|
+ return new com.destroystokyo.paper.block.CraftBlockSoundGroup(getNMSBlock().getBlockData().getStepSound());
|
|
+ }
|
|
+ // Paper end
|
|
}
|