-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust getPrecipitationAt approach for better mod compatibility
- Loading branch information
Showing
4 changed files
with
33 additions
and
63 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
common/src/main/java/sereneseasons/mixin/client/MixinBiomeClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/******************************************************************************* | ||
* Copyright 2024, the Glitchfiend Team. | ||
* All rights reserved. | ||
******************************************************************************/ | ||
package sereneseasons.mixin.client; | ||
|
||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.biome.Biome; | ||
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.callback.CallbackInfoReturnable; | ||
import sereneseasons.season.SeasonHooks; | ||
|
||
@Mixin(Biome.class) | ||
public class MixinBiomeClient | ||
{ | ||
@Inject(method="getPrecipitationAt", at=@At("HEAD"), cancellable = true) | ||
public void onGetPrecipitationAt(BlockPos pos, CallbackInfoReturnable<Biome.Precipitation> cir) | ||
{ | ||
Minecraft minecraft = Minecraft.getInstance(); | ||
Level level = minecraft.level; | ||
|
||
if (level != null) | ||
{ | ||
cir.setReturnValue(SeasonHooks.getPrecipitationAtSeasonal(level, level.getBiome(pos), pos)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
common/src/main/java/sereneseasons/season/SeasonHooksClient.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters