fix sound issues with axe actionables

This commit is contained in:
granny
2023-12-14 22:26:15 -08:00
parent 24bfb3b303
commit 92a6325cb0

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Tool actionable options
diff --git a/src/main/java/net/minecraft/world/item/AxeItem.java b/src/main/java/net/minecraft/world/item/AxeItem.java
index 2e75fd06e9e379eb95ebfe55086ffc327706ab2f..d491ff163e9da7ddacf1a68e0557cd61169f35f3 100644
index 2e75fd06e9e379eb95ebfe55086ffc327706ab2f..2918b1aca8fae6a319881a631dc727b6d375a33c 100644
--- a/src/main/java/net/minecraft/world/item/AxeItem.java
+++ b/src/main/java/net/minecraft/world/item/AxeItem.java
@@ -33,13 +33,15 @@ public class AxeItem extends DiggerItem {
@@ -58,14 +58,14 @@ index 2e75fd06e9e379eb95ebfe55086ffc327706ab2f..d491ff163e9da7ddacf1a68e0557cd61
+ Optional<org.purpurmc.purpur.tool.Actionable> optional = Optional.ofNullable(world.purpurConfig.axeStrippables.get(state.getBlock())); // Purpur
if (optional.isPresent()) {
- world.playSound(player, pos, SoundEvents.AXE_STRIP, SoundSource.BLOCKS, 1.0F, 1.0F);
+ if (!STRIPPABLES.containsKey(state.getBlock())) world.playSound(null, pos, SoundEvents.AXE_STRIP, SoundSource.BLOCKS, 1.0F, 1.0F); // Purpur - force sound
+ world.playSound(STRIPPABLES.containsKey(state.getBlock()) ? player : null, pos, SoundEvents.AXE_STRIP, SoundSource.BLOCKS, 1.0F, 1.0F); // Purpur - force sound
return optional;
} else {
- Optional<BlockState> optional2 = WeatheringCopper.getPrevious(state);
+ Optional<org.purpurmc.purpur.tool.Actionable> optional2 = Optional.ofNullable(world.purpurConfig.axeWeatherables.get(state.getBlock())); // Purpur
if (optional2.isPresent()) {
- world.playSound(player, pos, SoundEvents.AXE_SCRAPE, SoundSource.BLOCKS, 1.0F, 1.0F);
+ if (!HoneycombItem.WAXABLES.get().containsKey(state.getBlock())) world.playSound(null, pos, SoundEvents.AXE_SCRAPE, SoundSource.BLOCKS, 1.0F, 1.0F); // Purpur - force sound
+ world.playSound(WeatheringCopper.getPrevious(state).isPresent() ? player : null, pos, SoundEvents.AXE_SCRAPE, SoundSource.BLOCKS, 1.0F, 1.0F); // Purpur - force sound
world.levelEvent(player, 3005, pos, 0);
return optional2;
} else {
@@ -75,7 +75,7 @@ index 2e75fd06e9e379eb95ebfe55086ffc327706ab2f..d491ff163e9da7ddacf1a68e0557cd61
+ Optional<org.purpurmc.purpur.tool.Actionable> optional3 = Optional.ofNullable(world.purpurConfig.axeWaxables.get(state.getBlock())); // Purpur
if (optional3.isPresent()) {
- world.playSound(player, pos, SoundEvents.AXE_WAX_OFF, SoundSource.BLOCKS, 1.0F, 1.0F);
+ if (!HoneycombItem.WAX_OFF_BY_BLOCK.get().containsKey(state.getBlock())) world.playSound(player, pos, SoundEvents.AXE_WAX_OFF, SoundSource.BLOCKS, 1.0F, 1.0F); // Purpur - force sound
+ world.playSound(HoneycombItem.WAX_OFF_BY_BLOCK.get().containsKey(state.getBlock()) ? player : null, pos, SoundEvents.AXE_WAX_OFF, SoundSource.BLOCKS, 1.0F, 1.0F); // Purpur - force sound
world.levelEvent(player, 3004, pos, 0);
return optional3;
} else {