aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinPlayerControllerMP.java
diff options
context:
space:
mode:
authorRoman / Nea <roman.graef@gmail.com>2022-01-16 01:03:04 +0100
committerGitHub <noreply@github.com>2022-01-15 19:03:04 -0500
commitc81b6a34ae7bbb70a11f23f49422f2fceffa689c (patch)
tree44d2f2ba99a7e1746293489ee9b00dc9c307735b /src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinPlayerControllerMP.java
parent2aa911fa84399a5a8cc9f36715246c7f3eee7133 (diff)
downloadnotenoughupdates-c81b6a34ae7bbb70a11f23f49422f2fceffa689c.tar.gz
notenoughupdates-c81b6a34ae7bbb70a11f23f49422f2fceffa689c.tar.bz2
notenoughupdates-c81b6a34ae7bbb70a11f23f49422f2fceffa689c.zip
Add sounds and rework the existing textures to custom Dwarven Mines /… (#51)
* Pre Work of custom biomes * Work on auto chunk update, Add Debug command * Added 6 new biomes that are used in crystal hollows * Made it so the biomes are registered in the main class so it loads properly * Add sounds and rework the existing textures to custom Dwarven Mines / CH blocks * Config fixups * make titanium sounds work * Added sounds per gemstone type * fix dwarven mines sounds * stop spamming sound effects with config * Changelog for CH custom blocks * add all the files * Update src/main/resources/assets/notenoughupdates/sounds/titaniumbreak.json * Update src/main/resources/assets/notenoughupdates/sounds/mithrilbreak.json * Update src/main/resources/assets/notenoughupdates/sounds/gemstonetopazbreak.json * Update src/main/resources/assets/notenoughupdates/sounds/gemstonerubybreak.json * Update src/main/resources/assets/notenoughupdates/sounds/gemstonesapphirebreak.json * Update src/main/resources/assets/notenoughupdates/sounds/gemstonejasperbreak.json * Update src/main/resources/assets/notenoughupdates/sounds/gemstoneamethystbreak.json * Update src/main/resources/assets/notenoughupdates/sounds/gemstonejadebreak.json * Update src/main/resources/assets/notenoughupdates/sounds/gemstoneamberbreak.json * Update src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java * Update src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java * Update src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java * Update src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java * Update src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java * Update src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java Co-authored-by: DoKM <mcazzyman@gmail.com> Co-authored-by: nopothegamer <40329022+nopothegamer@users.noreply.github.com> Co-authored-by: IRONM00N <64110067+IRONM00N@users.noreply.github.com>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinPlayerControllerMP.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinPlayerControllerMP.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinPlayerControllerMP.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinPlayerControllerMP.java
index 78130cb4..969b5b88 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinPlayerControllerMP.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinPlayerControllerMP.java
@@ -1,12 +1,17 @@
package io.github.moulberry.notenoughupdates.mixins;
+import io.github.moulberry.notenoughupdates.events.OnBlockBreakSoundEffect;
import io.github.moulberry.notenoughupdates.miscfeatures.ItemCooldowns;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.audio.ISound;
+import net.minecraft.client.audio.SoundHandler;
import net.minecraft.client.multiplayer.PlayerControllerMP;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(PlayerControllerMP.class)
@@ -19,4 +24,13 @@ public class MixinPlayerControllerMP {
((PlayerControllerMP)(Object)this).resetBlockRemoving();
}*/
}
+
+ @Redirect(method = "onPlayerDamageBlock", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/audio/SoundHandler;playSound(Lnet/minecraft/client/audio/ISound;)V"))
+ public void onPlayerDamageBlock(SoundHandler instance, ISound p_playSound_1_, BlockPos p_onPlayerDamageBlock_1_, EnumFacing p_onPlayerDamageBlock_2_) {
+ OnBlockBreakSoundEffect onBlockBreakSoundEffect = new OnBlockBreakSoundEffect(p_playSound_1_, p_onPlayerDamageBlock_1_, Minecraft.getMinecraft().theWorld.getBlockState(p_onPlayerDamageBlock_1_));
+ if (!onBlockBreakSoundEffect.post()) {
+ instance.playSound(onBlockBreakSoundEffect.getSound());
+ }
+ }
+
}