mirror of
https://github.com/JonasunderscoreJones/nicer-skies.git
synced 2025-10-22 19:29:18 +02:00
new: finish update to 1.19.3
This commit is contained in:
parent
1b9480e47e
commit
e48d12819b
6 changed files with 21 additions and 16 deletions
|
@ -128,7 +128,7 @@ public class ConfigScreen extends Screen {
|
|||
addRenderableWidget(new Button(this.width / 2 + (this.width / 2 - 150) / 2, 156, 74, 20, Component.literal("Apply"), (button) -> {
|
||||
NicerSkies.skyManager.generateSky(NebulaSeedManager.getSeed());
|
||||
invalidated = false;
|
||||
}) {
|
||||
}, null) {
|
||||
@Override
|
||||
public void render(@NotNull PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
|
||||
this.active = invalidated && NebulaSeedManager.canGetSeed();
|
||||
|
@ -142,7 +142,7 @@ public class ConfigScreen extends Screen {
|
|||
this.clearWidgets();
|
||||
this.init();
|
||||
invalidated = true;
|
||||
}) {
|
||||
}, null) {
|
||||
@Override
|
||||
public void render(@NotNull PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
|
||||
this.active = !isDefaultNebulaSettings();
|
||||
|
@ -150,10 +150,12 @@ public class ConfigScreen extends Screen {
|
|||
}
|
||||
});
|
||||
|
||||
addRenderableWidget(Button.builder(Component.literal("Back"), (button) -> this.onClose())
|
||||
.pos(this.width / 2 - 100, this.height - 30)
|
||||
.size(200, 20)
|
||||
.build());
|
||||
super.init();
|
||||
|
||||
addRenderableWidget(new Button(this.width / 2 - 100, this.height - 30, 200, 20, Component.literal("Back"), (button) -> {
|
||||
this.onClose();
|
||||
}));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,10 +2,10 @@ package codes.ztereohype.nicerskies.gui.widget;
|
|||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.gui.GuiComponent;
|
||||
import net.minecraft.client.gui.components.Widget;
|
||||
import net.minecraft.client.gui.components.Renderable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class Separator extends GuiComponent implements Widget {
|
||||
public class Separator extends GuiComponent implements Renderable {
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int height;
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package codes.ztereohype.nicerskies.mixin;
|
||||
|
||||
import codes.ztereohype.nicerskies.NicerSkies;
|
||||
import com.mojang.math.Vector3f;
|
||||
import lombok.SneakyThrows;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
import org.joml.Vector3f;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
|
@ -14,10 +15,11 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
|||
public abstract class MixinLightTexutre {
|
||||
@Inject(
|
||||
method = "updateLightTexture",
|
||||
at = @At(value = "INVOKE", target = "Lcom/mojang/math/Vector3f;clamp(FF)V", shift = At.Shift.BEFORE, ordinal = 2),
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/LightTexture;clampColor(Lorg/joml/Vector3f;)V", shift = At.Shift.BEFORE, ordinal = 2),
|
||||
locals = LocalCapture.CAPTURE_FAILHARD
|
||||
)
|
||||
private void injectWarmLight(float partialTicks, CallbackInfo ci, ClientLevel clientLevel, float f, float g, float h, float i, float j, float l, float k, Vector3f vector3f, float m, Vector3f vector3f2, int n, int o, float p, float q, float r, float s, float t, boolean bl, float v, Vector3f vector3f5) {
|
||||
@SneakyThrows
|
||||
private void injectWarmLight(float partialTicks, CallbackInfo ci, ClientLevel clientLevel, float f, float g, float h, float i, float j, float l, float k, Vector3f vector3f, float m, Vector3f vector3f2, int n, int o, float p, float q, float r, float s, float t, boolean bl, float v, Vector3f vector3f5) {
|
||||
if (!NicerSkies.config.getLightmapTweaked()) return;
|
||||
Vector3f warmTint = new Vector3f(0.36F, 0.13F, -0.15F);
|
||||
|
||||
|
@ -28,7 +30,7 @@ public abstract class MixinLightTexutre {
|
|||
warmTint.mul(warmness);
|
||||
warmTint.add(1f, 1f, 1f);
|
||||
|
||||
Vector3f dramaticFactor = vector3f2.copy();
|
||||
Vector3f dramaticFactor = (Vector3f) vector3f2.clone();
|
||||
dramaticFactor.mul(0.20f);
|
||||
dramaticFactor.add(0.80f, 0.80f, 0.81f);
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package codes.ztereohype.nicerskies.mixin;
|
|||
|
||||
import codes.ztereohype.nicerskies.NicerSkies;
|
||||
import com.mojang.blaze3d.vertex.*;
|
||||
import com.mojang.math.Matrix4f;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
|
@ -10,6 +9,7 @@ import net.minecraft.client.renderer.LevelRenderer;
|
|||
import net.minecraft.client.renderer.ShaderInstance;
|
||||
import net.minecraft.world.level.material.FogType;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import org.joml.Matrix4f;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
@ -46,7 +46,7 @@ public abstract class MixinStarRendering {
|
|||
|
||||
@ModifyArg(
|
||||
method = "renderSky",
|
||||
at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/VertexBuffer;drawWithShader(Lcom/mojang/math/Matrix4f;Lcom/mojang/math/Matrix4f;Lnet/minecraft/client/renderer/ShaderInstance;)V", ordinal = 1),
|
||||
at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/VertexBuffer;drawWithShader(Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lnet/minecraft/client/renderer/ShaderInstance;)V", ordinal = 1),
|
||||
index = 2
|
||||
)
|
||||
private ShaderInstance injectStarColour(ShaderInstance shaderInstance) {
|
||||
|
@ -58,8 +58,8 @@ public abstract class MixinStarRendering {
|
|||
at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;disableTexture()V", ordinal = 2, shift = At.Shift.AFTER),
|
||||
locals = LocalCapture.CAPTURE_FAILHARD
|
||||
)
|
||||
private void drawSkybox(PoseStack poseStack, Matrix4f projectionMatrix, float partialTick, Camera camera, boolean bl, Runnable skyFogSetup, CallbackInfo ci, FogType fogType, Vec3 vec3, float f, float g, float h, BufferBuilder bufferBuilder, ShaderInstance shaderInstance, float[] fs, float i, Matrix4f matrix4f2, float k, int r, int s, int m, float t, float o, float p, float q) {
|
||||
private void drawSkybox(PoseStack poseStack, Matrix4f matrix4f, float f, Camera camera, boolean bl, Runnable runnable, CallbackInfo ci, FogType fogType, Vec3 vec3, float g, float h, float i, BufferBuilder bufferBuilder, ShaderInstance shaderInstance, float[] fs, float j, Matrix4f matrix4f3, float l, int s, int t, int n, float u, float p, float q, float r) {
|
||||
if (!NicerSkies.config.getNebulas() || !NicerSkies.skyManager.isInitialized()) return;
|
||||
NicerSkies.skyManager.getSkybox().render(poseStack, projectionMatrix);
|
||||
NicerSkies.skyManager.getSkybox().render(poseStack, matrix4f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,13 +4,13 @@ import codes.ztereohype.nicerskies.NicerSkies;
|
|||
import com.mojang.blaze3d.platform.NativeImage;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.*;
|
||||
import com.mojang.math.Matrix4f;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||
import net.minecraft.util.Mth;
|
||||
import org.joml.Matrix4f;
|
||||
|
||||
public class Skybox {
|
||||
public static final int RESOLUTION = 512;
|
||||
|
|
|
@ -25,6 +25,7 @@ public class Starbox {
|
|||
generateStars(randomSource);
|
||||
}
|
||||
|
||||
// not good practice: decrementing iteration variable
|
||||
private void generateStars(RandomSource randomSource) {
|
||||
ImprovedNoise noise = new ImprovedNoise(randomSource);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue