Merge branch 'main-upstream'
# Conflicts: # coreSubProjects # fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLevelRenderer.java
This commit is contained in:
+2
-1
@@ -16,6 +16,7 @@ import java.util.regex.Pattern;
|
||||
// Logger (for debug stuff)
|
||||
|
||||
import com.seibel.distanthorizons.api.enums.config.DisallowSelectingViaConfigGui;
|
||||
import com.seibel.distanthorizons.api.enums.config.EUpdateBranch;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.core.config.ConfigBase;
|
||||
import com.seibel.distanthorizons.core.config.types.*;
|
||||
@@ -245,7 +246,7 @@ public class ClassicConfigGUI
|
||||
}
|
||||
|
||||
// Changelog button
|
||||
if (Config.Client.Advanced.AutoUpdater.enableAutoUpdater.get())
|
||||
if (Config.Client.Advanced.AutoUpdater.enableAutoUpdater.get() && Config.Client.Advanced.AutoUpdater.updateBranch.get() == EUpdateBranch.STABLE)
|
||||
{
|
||||
this.addBtn(new TexturedButtonWidget(
|
||||
// Where the button is on the screen
|
||||
|
||||
+37
-16
@@ -2,8 +2,11 @@ package com.seibel.distanthorizons.common.wrappers.gui.updater;
|
||||
|
||||
import com.mojang.blaze3d.platform.NativeImage;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.seibel.distanthorizons.api.enums.config.EUpdateBranch;
|
||||
import com.seibel.distanthorizons.common.wrappers.gui.DhScreen;
|
||||
import com.seibel.distanthorizons.common.wrappers.gui.TexturedButtonWidget;
|
||||
import com.seibel.distanthorizons.core.jar.ModGitInfo;
|
||||
import com.seibel.distanthorizons.core.jar.installer.GitlabGetter;
|
||||
import com.seibel.distanthorizons.coreapi.ModInfo;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.core.jar.JarUtils;
|
||||
@@ -34,12 +37,26 @@ public class UpdateModScreen extends DhScreen
|
||||
private Screen parent;
|
||||
private String newVersionID;
|
||||
|
||||
private String currentVer;
|
||||
private String nextVer;
|
||||
|
||||
|
||||
public UpdateModScreen(Screen parent, String newVersionID)
|
||||
{
|
||||
super(Translatable(ModInfo.ID + ".updater.title"));
|
||||
this.parent = parent;
|
||||
this.newVersionID = newVersionID;
|
||||
|
||||
switch (Config.Client.Advanced.AutoUpdater.updateBranch.get()) {
|
||||
case STABLE:
|
||||
currentVer = ModInfo.VERSION;
|
||||
nextVer = ModrinthGetter.releaseNames.get(this.newVersionID);
|
||||
break;
|
||||
case NIGHTLY:
|
||||
currentVer = ModGitInfo.Git_Main_Commit.substring(0,7);
|
||||
nextVer = this.newVersionID.substring(0,7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -81,21 +98,23 @@ public class UpdateModScreen extends DhScreen
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
this.addBtn(new TexturedButtonWidget(
|
||||
// Where the button is on the screen
|
||||
this.width / 2 - 97, this.height / 2 + 8,
|
||||
// Width and height of the button
|
||||
20, 20,
|
||||
// Offset
|
||||
0, 0,
|
||||
// Some textuary stuff
|
||||
0, new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"), 20, 20,
|
||||
// Create the button and tell it where to go
|
||||
(buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(new ChangelogScreen(this, this.newVersionID)), // TODO: Add a proper easter egg to pressing the logo (maybe with confetti)
|
||||
// Add a title to the button
|
||||
Translatable(ModInfo.ID + ".updater.title")
|
||||
));
|
||||
if (Config.Client.Advanced.AutoUpdater.updateBranch.get() == EUpdateBranch.STABLE)
|
||||
{
|
||||
this.addBtn(new TexturedButtonWidget(
|
||||
// Where the button is on the screen
|
||||
this.width / 2 - 97, this.height / 2 + 8,
|
||||
// Width and height of the button
|
||||
20, 20,
|
||||
// Offset
|
||||
0, 0,
|
||||
// Some textuary stuff
|
||||
0, new ResourceLocation(ModInfo.ID, "textures/gui/changelog.png"), 20, 20,
|
||||
// Create the button and tell it where to go
|
||||
(buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(new ChangelogScreen(this, this.newVersionID)), // TODO: Add a proper easter egg to pressing the logo (maybe with confetti)
|
||||
// Add a title to the button
|
||||
Translatable(ModInfo.ID + ".updater.title")
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
this.addBtn( // Update
|
||||
@@ -137,7 +156,9 @@ public class UpdateModScreen extends DhScreen
|
||||
|
||||
// Render the text's
|
||||
DhDrawCenteredString(matrices, this.font, Translatable(ModInfo.ID + ".updater.text1"), this.width / 2, this.height / 2 - 35, 0xFFFFFF);
|
||||
DhDrawCenteredString(matrices, this.font, Translatable(ModInfo.ID + ".updater.text2", ModInfo.VERSION, ModrinthGetter.releaseNames.get(this.newVersionID)), this.width / 2, this.height / 2 - 20, 0x52FD52);
|
||||
DhDrawCenteredString(matrices, this.font,
|
||||
Translatable(ModInfo.ID + ".updater.text2", currentVer, nextVer),
|
||||
this.width / 2, this.height / 2 - 20, 0x52FD52);
|
||||
|
||||
// TODO: add the tooltips for the buttons
|
||||
super.render(matrices, mouseX, mouseY, delta); // Render the buttons
|
||||
|
||||
+1
-1
Submodule coreSubProjects updated: cc8b97f2fe...532f3adba8
+22
-36
@@ -23,12 +23,18 @@ import com.mojang.blaze3d.vertex.PoseStack;
|
||||
#if PRE_MC_1_19_4
|
||||
import com.mojang.math.Matrix4f;
|
||||
#else
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
import org.joml.Matrix4f;
|
||||
#endif
|
||||
import com.seibel.distanthorizons.common.wrappers.chunk.ChunkWrapper;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.world.level.lighting.LevelLightEngine;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -36,7 +42,6 @@ import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
/**
|
||||
@@ -102,39 +107,20 @@ public class MixinLevelRenderer
|
||||
callback.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method =
|
||||
"Lnet/minecraft/client/renderer/LevelRenderer;" +
|
||||
"renderLevel(Lcom/mojang/blaze3d/vertex/PoseStack;" +
|
||||
"FJZLnet/minecraft/client/Camera;" +
|
||||
"Lnet/minecraft/client/renderer/GameRenderer;" +
|
||||
"Lnet/minecraft/client/renderer/LightTexture;" +
|
||||
#if PRE_MC_1_19_4
|
||||
"Lcom/mojang/math/Matrix4f;)V"
|
||||
#else
|
||||
"Lorg/joml/Matrix4f;)V"
|
||||
#endif
|
||||
,
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
#if PRE_MC_1_20_1
|
||||
target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"
|
||||
#else
|
||||
target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"
|
||||
#endif
|
||||
))
|
||||
private int callAfterRunUpdates(LevelLightEngine light #if PRE_MC_1_20_1 , int pos, boolean isQueueEmpty, boolean updateBlockLight #endif)
|
||||
{
|
||||
#if PRE_MC_1_20_1
|
||||
int r = light.runUpdates(pos, isQueueEmpty, updateBlockLight);
|
||||
#else
|
||||
int r = light.runLightUpdates();
|
||||
#endif
|
||||
ChunkWrapper.syncedUpdateClientLightStatus();
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRE_MC_1_19_4
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
|
||||
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#elif PRE_MC_1_20_1
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
|
||||
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#else
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"), method = "renderLevel")
|
||||
private void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#endif
|
||||
{
|
||||
ChunkWrapper.syncedUpdateClientLightStatus();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,8 +1,10 @@
|
||||
package com.seibel.distanthorizons.fabric.mixins.client;
|
||||
|
||||
import com.seibel.distanthorizons.api.enums.config.EUpdateBranch;
|
||||
import com.seibel.distanthorizons.common.wrappers.gui.updater.UpdateModScreen;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
|
||||
import com.seibel.distanthorizons.core.jar.installer.GitlabGetter;
|
||||
import com.seibel.distanthorizons.core.jar.installer.ModrinthGetter;
|
||||
import com.seibel.distanthorizons.core.jar.updater.SelfUpdater;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.IVersionConstants;
|
||||
@@ -48,7 +50,7 @@ public class MixinMinecraft
|
||||
{
|
||||
instance.setScreen(new UpdateModScreen(
|
||||
new TitleScreen(false), // We don't want to use the vanilla title screen as it would fade the buttons
|
||||
ModrinthGetter.getLatestIDForVersion(SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion())
|
||||
(Config.Client.Advanced.AutoUpdater.updateBranch.get() == EUpdateBranch.STABLE ? ModrinthGetter.getLatestIDForVersion(SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion()): GitlabGetter.INSTANCE.projectPipelines.get(0).get("sha"))
|
||||
));
|
||||
}
|
||||
else
|
||||
|
||||
+16
-27
@@ -23,6 +23,9 @@ import com.mojang.blaze3d.vertex.PoseStack;
|
||||
#if PRE_MC_1_19_4
|
||||
import com.mojang.math.Matrix4f;
|
||||
#else
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
import org.joml.Matrix4f;
|
||||
#endif
|
||||
import com.seibel.distanthorizons.common.rendering.SeamlessOverdraw;
|
||||
@@ -32,8 +35,11 @@ import com.seibel.distanthorizons.common.wrappers.world.ClientLevelWrapper;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.core.api.internal.ClientApi;
|
||||
import com.seibel.distanthorizons.coreapi.util.math.Mat4f;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
import net.minecraft.client.renderer.LightTexture;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.world.level.lighting.LevelLightEngine;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -154,35 +160,18 @@ public class MixinLevelRenderer
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method =
|
||||
"Lnet/minecraft/client/renderer/LevelRenderer;" +
|
||||
"renderLevel(Lcom/mojang/blaze3d/vertex/PoseStack;" +
|
||||
"FJZLnet/minecraft/client/Camera;" +
|
||||
"Lnet/minecraft/client/renderer/GameRenderer;" +
|
||||
"Lnet/minecraft/client/renderer/LightTexture;" +
|
||||
#if PRE_MC_1_19_4
|
||||
"Lcom/mojang/math/Matrix4f;)V"
|
||||
#else
|
||||
"Lorg/joml/Matrix4f;)V"
|
||||
#endif
|
||||
,
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
#if PRE_MC_1_20_1
|
||||
target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"
|
||||
#else
|
||||
target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"
|
||||
#endif
|
||||
))
|
||||
private int callAfterRunUpdates(LevelLightEngine light #if PRE_MC_1_20_1 , int pos, boolean isQueueEmpty, boolean updateBlockLight #endif )
|
||||
#if PRE_MC_1_19_4
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
|
||||
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#elif PRE_MC_1_20_1
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
|
||||
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#else
|
||||
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"), method = "renderLevel")
|
||||
private void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
|
||||
#endif
|
||||
{
|
||||
#if PRE_MC_1_20_1
|
||||
int r = light.runUpdates(pos, isQueueEmpty, updateBlockLight);
|
||||
#else
|
||||
int r = light.runLightUpdates();
|
||||
#endif
|
||||
ChunkWrapper.syncedUpdateClientLightStatus();
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,8 +1,10 @@
|
||||
package com.seibel.distanthorizons.forge.mixins.client;
|
||||
|
||||
import com.seibel.distanthorizons.api.enums.config.EUpdateBranch;
|
||||
import com.seibel.distanthorizons.common.wrappers.gui.updater.UpdateModScreen;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
|
||||
import com.seibel.distanthorizons.core.jar.installer.GitlabGetter;
|
||||
import com.seibel.distanthorizons.core.jar.installer.ModrinthGetter;
|
||||
import com.seibel.distanthorizons.core.jar.updater.SelfUpdater;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.IVersionConstants;
|
||||
@@ -48,7 +50,7 @@ public class MixinMinecraft
|
||||
{
|
||||
instance.setScreen(new UpdateModScreen(
|
||||
new TitleScreen(false), // We don't want to use the vanilla title screen as it would fade the buttons
|
||||
ModrinthGetter.getLatestIDForVersion(SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion())
|
||||
(Config.Client.Advanced.AutoUpdater.updateBranch.get() == EUpdateBranch.STABLE ? ModrinthGetter.getLatestIDForVersion(SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion()): GitlabGetter.INSTANCE.projectPipelines.get(0).get("sha"))
|
||||
));
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user