Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Missing rain sounds #689

Open
wants to merge 2 commits into
base: 1.18.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
- fixed guidebook not opening #256
- fixed broken guis of some of the machine screens due to changed textures
- allow tech reborn and modern industrialization oil to be used in the fuel refinery #258
- fixed "Secrets Beneath" achievement #257
- fixed rain sounds not being produced in overworld (#628)
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,22 @@ public void adastra_processWorldEvent(PlayerEntity source, int eventId, BlockPos
// Venus rain.
@Inject(method = "tickRainSplashing", at = @At("HEAD"), cancellable = true)
public void adastra_tickRainSplashing(Camera camera, CallbackInfo info) {
if(!ModUtils.isPlanet(this.client.world)) {
info.cancel();
}
WorldRendererAccessor worldRenderer = (WorldRendererAccessor) (Object) this;



MinecraftClient client = MinecraftClient.getInstance();
RegistryKey<World> world = client.world.getRegistryKey();
boolean isVenus = false;
for (SkyRenderer skyRenderer : AdAstraClient.skyRenderers) {
if (world.equals(skyRenderer.dimension()) && skyRenderer.weatherEffects().equals(WeatherEffects.VENUS)) {

isVenus = true;
break;
}
}

if (!isVenus) {
return;
}

WorldRendererAccessor worldRenderer = (WorldRendererAccessor) (Object) this;

float f = client.world.getRainGradient(1.0f) / (MinecraftClient.isFancyGraphicsOrBetter() ? 1.0f : 2.0f);
if (f <= 0.0f) {
return;
Expand Down Expand Up @@ -115,10 +119,6 @@ public void adastra_tickRainSplashing(Camera camera, CallbackInfo info) {
client.world.playSound((BlockPos) blockPos2, SoundEvents.WEATHER_RAIN, SoundCategory.WEATHER, 0.2f, 1.0f, false);
}
}
info.cancel();
break;
}
}
return;
info.cancel();
}
}