mirror of
https://github.com/JonasunderscoreJones/nicer-skies.git
synced 2025-10-22 19:29:18 +02:00
change: name consisntency + better fallback seed
This commit is contained in:
parent
ec9bb947de
commit
7a968b6229
4 changed files with 4 additions and 7 deletions
|
@ -5,15 +5,13 @@ import net.minecraft.client.Minecraft;
|
|||
|
||||
public class NebulaSeedManager {
|
||||
public static long getSeed() {
|
||||
|
||||
// Use hashed seed. This is available in
|
||||
if (Minecraft.getInstance().level != null) {
|
||||
return ((IClientLevelAccessor) Minecraft.getInstance().level).nicerSkies_getHashedSeed();
|
||||
}
|
||||
return 0;
|
||||
return 321L; // handpicked decent default ;)
|
||||
}
|
||||
|
||||
public static boolean canGetSeed() {
|
||||
public static boolean canGenerateSky() {
|
||||
return Minecraft.getInstance().hasSingleplayerServer() || Minecraft.getInstance().getCurrentServer() != null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ import java.util.function.Supplier;
|
|||
|
||||
@Mixin(ClientLevel.class)
|
||||
public class ClientLevelMixin implements IClientLevelAccessor {
|
||||
|
||||
@Unique
|
||||
private long hashedSeed;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||
|
||||
@Mixin(LightTexture.class)
|
||||
public abstract class MixinLightTexutre {
|
||||
public abstract class LightTextureMixin {
|
||||
@Inject(
|
||||
method = "updateLightTexture",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/LightTexture;clampColor(Lorg/joml/Vector3f;)V", shift = At.Shift.BEFORE, ordinal = 2),
|
|
@ -12,6 +12,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
public class MinecraftMixin {
|
||||
@Inject(at = @At("TAIL"), method = "setLevel")
|
||||
private void onWorldLoad(CallbackInfo ci) {
|
||||
NicerSkies.skyManager.generateSky(NebulaSeedManager.getSeed());
|
||||
NicerSkies.skyManager.generateSky(NebulaSeedManager.getSeed(), NicerSkies.config.getTwinklingStars(), NicerSkies.config.getNebulas());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue