From 775a87e9cde3b4b144d74d999fed39dbbca82afa Mon Sep 17 00:00:00 2001 From: Maxx <53229958+MBatt1@users.noreply.github.com> Date: Sun, 15 Sep 2024 12:49:00 -0500 Subject: [PATCH] cloud tweaks, music bug --- .../mixin/client/MinecraftClientMixin.java | 28 ++++++++++++++++++ .../util/ParadiseLostSoundEvents.java | 4 +++ .../textures/block/blue_cloud.png | Bin 186 -> 379 bytes .../textures/block/cold_cloud.png | Bin 188 -> 378 bytes .../textures/block/golden_cloud.png | Bin 186 -> 392 bytes src/main/resources/paradise_lost.mixins.json | 1 + 6 files changed, 33 insertions(+) create mode 100644 src/main/java/net/id/paradiselost/mixin/client/MinecraftClientMixin.java diff --git a/src/main/java/net/id/paradiselost/mixin/client/MinecraftClientMixin.java b/src/main/java/net/id/paradiselost/mixin/client/MinecraftClientMixin.java new file mode 100644 index 000000000..c6db15d2f --- /dev/null +++ b/src/main/java/net/id/paradiselost/mixin/client/MinecraftClientMixin.java @@ -0,0 +1,28 @@ +package net.id.paradiselost.mixin.client; + +import net.id.paradiselost.util.ParadiseLostSoundEvents; +import net.id.paradiselost.world.dimension.ParadiseLostDimension; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.sound.MusicSound; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(MinecraftClient.class) +public class MinecraftClientMixin { + + @Shadow + @Nullable + ClientPlayerEntity player; + + @Inject(method = "getMusicType", at = @At(value = "RETURN"), cancellable = true) + void getMusicType(CallbackInfoReturnable cir) { + if (this.player != null && this.player.getWorld().getRegistryKey() == ParadiseLostDimension.PARADISE_LOST_WORLD_KEY) { + cir.setReturnValue(ParadiseLostSoundEvents.PARADISE_MUSIC_SOUND); + } + } +} diff --git a/src/main/java/net/id/paradiselost/util/ParadiseLostSoundEvents.java b/src/main/java/net/id/paradiselost/util/ParadiseLostSoundEvents.java index 09b5d05ef..f90df435a 100644 --- a/src/main/java/net/id/paradiselost/util/ParadiseLostSoundEvents.java +++ b/src/main/java/net/id/paradiselost/util/ParadiseLostSoundEvents.java @@ -2,7 +2,9 @@ import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; +import net.minecraft.sound.MusicSound; import net.minecraft.sound.SoundEvent; +import net.minecraft.sound.SoundEvents; import net.minecraft.util.Identifier; import static net.id.paradiselost.ParadiseLost.locate; @@ -38,6 +40,8 @@ public final class ParadiseLostSoundEvents { public static final SoundEvent MUSIC_PARADISE_LOST = register("music.paradise"); + public static final MusicSound PARADISE_MUSIC_SOUND = new MusicSound(Registries.SOUND_EVENT.getEntry(MUSIC_PARADISE_LOST), 6000, 24000, true); + public static void init() { } diff --git a/src/main/resources/assets/paradise_lost/textures/block/blue_cloud.png b/src/main/resources/assets/paradise_lost/textures/block/blue_cloud.png index 7fc999c40c1cb834488a65c6e39b210ee035057f..87d7a59127ce580ae310f3427819d5db979b1046 100644 GIT binary patch delta 363 zcmV-x0hIo_0s8`w8Gi-<001BJ|6u?C00DDSM?wIu&K&6g000DMK}|sb0I`n?{9y$E z000SaNLh0L01m?d01m?e$8V@)0003HNkldfPT3EdF2=53Rli()d`+L_#x!5c`G0gSm*b_Z_v^S}`?f95 zo2Q6>f9AO1@Vbe+@{u!sk4sW78HU~P@1|&t=mu52NzBPS7CN=#5I~WZUfy>Rlh`J= z*d57GN#rq#Z5830BXR%{4#lbuR0PGcH{zI3dk++&LiUC+-N533k8HE`K@mq4VhUGV zv5V|}J6Z8*@&}6B`7Zoq+!z1=002ov JPDHLkV1j;DocsU) delta 169 zcmey(w2N_qWIZzj1A~Sxe=v~Z3GfMVoqO|F&7KdLop+oM6{6UYrQuU4Pp~}l2j!9Lhd$f zjpg7f&`9Yuo|Lfa?b)RdE#?($Rk-{xF}8jF?X1Telw`}Sjmnz-Bz`}9O>&vt=3qvT U-4*2*fwnMsy85}Sb4q9e026FQ+yDRo diff --git a/src/main/resources/assets/paradise_lost/textures/block/cold_cloud.png b/src/main/resources/assets/paradise_lost/textures/block/cold_cloud.png index 1783a20cd7fbcfb4fa459acca5024419e7dbcd3c..65ce26a4f20c6b62164a13379aad22837ae59568 100644 GIT binary patch delta 363 zcmV-x0hIo{0r~=v7=H)`0000V^Z#K00004VQb$4nuFf3k00004XF*Lt006O%3;baP z00009a7bBm000id000id0mpBsWB>pG4@pEpR5(v{lEG@jFc3slK@KJ@>7`Hzx%K}K z`JUcFAdrhoTU_WN&6E7(wW$Y$r1j41?#K`Q&+V8-ocp>DpMOI=-0||-rLXUK40KOj ziRJO$@VKp{2ofQ<0C}97z{hV53Pq?+V*DnEwGrM=Q;QO=ml{KCw<*U0iisRA!g=2g zwTnoOpu0>JMW{?Qh>$SVnT19}2E_wgT>~VFu-hH`>=md)0A&*K#3T@((&})UfG#iH z*3kWPJ$q+N_GE0(WDSeS0ufd;b@n5f97$m92|;!)5EBtu3Pm#K@{C-fh=^jE%4=z$ zrnV6XSRs-n2uS2vv_5q5slmz(&Ujl+G zfk&Hx{Af=X#}JO|i~$Vm|1<*QUJM^3^j|S-;I@Cspt!d_m4R_@ zqyhs=fQTRi$AsKGhRCby|1m^8-M^1P`qjRj4BYQjCzLR-{R>cFko>naf#K`LB?6cC W%eTrnMRft~VeoYIb6Mw<&;$TO-a}*n diff --git a/src/main/resources/assets/paradise_lost/textures/block/golden_cloud.png b/src/main/resources/assets/paradise_lost/textures/block/golden_cloud.png index 2d3b375e6f871718ba640af6322d73e63e247065..fddcdfc290eb791b5e616c780686115a4206c029 100644 GIT binary patch delta 377 zcmV-<0fzp%0f+;T7=H)`0000V^Z#K00004VQb$4nuFf3k00004XF*Lt006O%3;baP z00009a7bBm000id000id0mpBsWB>pG9Z5t%R5(wClD%pIK@>*E4I~kjAfyf0*jd@- z1$+u1w~?q(4*o{UAgNVC9&mJ3u1-OmvuPi(rpv)sdRi@Kg3#6_AMxd-t+1{Zh_t*Z-L~X zTrrsQCV?>dzj83CGil9$tNIVrQP~@-lG$L U^?d>DKwB6*UHx3vIVCg!0G@wD5&!@I diff --git a/src/main/resources/paradise_lost.mixins.json b/src/main/resources/paradise_lost.mixins.json index 3f3e5456d..5a528577c 100644 --- a/src/main/resources/paradise_lost.mixins.json +++ b/src/main/resources/paradise_lost.mixins.json @@ -39,6 +39,7 @@ ], "client": [ "client.ClientWorldMixin", + "client.MinecraftClientMixin", "client.network.ClientPlayerEntityMixin", "client.render.BackgroundRendererMixin", "client.render.CloudRendererMixin",