Fix a bunch of compiler errors

This commit is contained in:
James Seibel
2024-05-18 20:31:15 -05:00
parent e7b60b7562
commit 45d4f390a9
8 changed files with 67 additions and 52 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ plugins {
id "com.github.johnrengelman.shadow" version '8.1.1' apply false
// Plugin to create merged jars
id "io.github.pacifistmc.forgix" version "1.2.6"
id "io.github.pacifistmc.forgix" version "1.2.9"
// Manifold preprocessor
id "systems.manifold.manifold-gradle-plugin" version "0.0.2-alpha"
@@ -325,7 +325,7 @@ subprojects { p ->
"fabric.mod.json",
"quilt.mod.json",
"META-INF/mods.toml",
"META-INF/NeoForge.mods.toml",
"META-INF/neoforge.mods.toml",
// The mixins for each of the loaders
"DistantHorizons."+ p.name +".fabricLike.mixins.json"
@@ -196,18 +196,18 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy
WorldRenderEvents.AFTER_SETUP.register((renderContext) ->
{
Matrix4f projectionMatrix = renderContext.projectionMatrix();
Mat4f projectionMatrix = McObjectConverter.Convert(renderContext.projectionMatrix());
Matrix4f modelViewMatrix;
#if MC_VER < MC_1_20_4
modelViewMatrix = matrixStack.last().pose();
Mat4f modelViewMatrix;
#if MC_VER < MC_1_20_6
modelViewMatrix = McObjectConverter.Convert(renderContext.matrixStack().last().pose());
#else
modelViewMatrix = renderContext.positionMatrix();
modelViewMatrix = McObjectConverter.Convert(renderContext.positionMatrix());
#endif
this.clientApi.renderLods(ClientLevelWrapper.getWrapper(renderContext.world()),
McObjectConverter.Convert(modelViewMatrix),
McObjectConverter.Convert(projectionMatrix),
modelViewMatrix,
projectionMatrix,
renderContext.tickDelta());
});
+13 -1
View File
@@ -4,7 +4,7 @@ plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
}
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21
architectury {
platformSetupLoomIde()
@@ -78,6 +78,18 @@ dependencies {
addMod("curse.maven:TerraFirmaCraft-302973:4616004", rootProject.enable_terrafirmacraft)
if ( // Only run on MC 1.20.6 or later
// FIXME: Add an environment variable for the Major, Minor, and Patch version number of Minecraft
minecraft_version.split("\\.")[1].toInteger() >= 20 &&
(
minecraft_version.split("\\.").length > 1 && // Incase there isn't a minor version
minecraft_version.split("\\.")[2].toInteger() >= 6
)
) {
// (potential) hack fix, force jopt-simple to be exactly 5.0.4 because Mojang ships that version, but some transitive dependencies request 6.0+
implementation('net.sf.jopt-simple:jopt-simple:5.0.4') //{ version { strictly '5.0.4' } }
}
}
task deleteResources(type: Delete) {
@@ -49,6 +49,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import javax.annotation.Nullable;
import java.nio.FloatBuffer;
#if MC_VER < MC_1_17_1
@@ -68,7 +69,8 @@ import org.lwjgl.opengl.GL15;
@Mixin(LevelRenderer.class)
public class MixinLevelRenderer
{
@Shadow
@Nullable
@Shadow //# if MC_VER >= MC_1_20_4 (remap = false) # endif
private ClientLevel level;
@Unique
private static float previousPartialTicks = 0;
@@ -38,7 +38,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(LightTexture.class)
public class MixinLightTexture
{
@Shadow
@Shadow //# if MC_VER >= MC_1_20_4 (remap = false) # endif
@Final
private NativeImage lightPixels;
@@ -24,41 +24,44 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Minecraft.class)
public class MixinMinecraft
{
#if MC_VER < MC_1_20_2
#if MC_VER == MC_1_20_1
@Redirect(
method = "Lnet/minecraft/client/Minecraft;setInitialScreen(Lcom/mojang/realmsclient/client/RealmsClient;Lnet/minecraft/server/packs/resources/ReloadInstance;Lnet/minecraft/client/main/GameConfig$QuickPlayData;)V",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;setScreen(Lnet/minecraft/client/gui/screens/Screen;)V")
)
public void onOpenScreen(Minecraft instance, Screen guiScreen)
{
#else
@Redirect(
method = "<init>(Lnet/minecraft/client/main/GameConfig;)V",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;setScreen(Lnet/minecraft/client/gui/screens/Screen;)V")
)
public void onOpenScreen(Minecraft instance, Screen guiScreen)
{
#endif
if (!Config.Client.Advanced.AutoUpdater.enableAutoUpdater.get()) // Don't do anything if the user doesn't want it
{
instance.setScreen(guiScreen); // Sets the screen back to the vanilla screen as if nothing ever happened
return;
}
if (SelfUpdater.onStart())
{
instance.setScreen(new UpdateModScreen(
new TitleScreen(false), // We don't want to use the vanilla title screen as it would fade the buttons
(Config.Client.Advanced.AutoUpdater.updateBranch.get() == EUpdateBranch.STABLE ? ModrinthGetter.getLatestIDForVersion(SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion()): GitlabGetter.INSTANCE.projectPipelines.get(0).get("sha"))
));
}
else
{
instance.setScreen(guiScreen); // Sets the screen back to the vanilla screen as if nothing ever happened
}
}
#endif
// commented out due to a bug with Manifold and having nested preprocessors
// and since neoforge doesn't work for anything before MC 1.20.6 anyway it doesn't need to be included
//#if MC_VER < MC_1_20_2
//#if MC_VER == MC_1_20_1
//@Redirect(
// method = "Lnet/minecraft/client/Minecraft;setInitialScreen(Lcom/mojang/realmsclient/client/RealmsClient;Lnet/minecraft/server/packs/resources/ReloadInstance;Lnet/minecraft/client/main/GameConfig$QuickPlayData;)V",
// at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;setScreen(Lnet/minecraft/client/gui/screens/Screen;)V")
//)
//public void onOpenScreen(Minecraft instance, Screen guiScreen)
//{
//#else
//@Redirect(
// method = "<init>(Lnet/minecraft/client/main/GameConfig;)V",
// at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;setScreen(Lnet/minecraft/client/gui/screens/Screen;)V")
//)
//public void onOpenScreen(Minecraft instance, Screen guiScreen)
//{
//#endif
// if (!Config.Client.Advanced.AutoUpdater.enableAutoUpdater.get()) // Don't do anything if the user doesn't want it
// {
// instance.setScreen(guiScreen); // Sets the screen back to the vanilla screen as if nothing ever happened
// return;
// }
//
// if (SelfUpdater.onStart())
// {
// instance.setScreen(new UpdateModScreen(
// new TitleScreen(false), // We don't want to use the vanilla title screen as it would fade the buttons
// (Config.Client.Advanced.AutoUpdater.updateBranch.get() == EUpdateBranch.STABLE ? ModrinthGetter.getLatestIDForVersion(SingletonInjector.INSTANCE.get(IVersionConstants.class).getMinecraftVersion()): GitlabGetter.INSTANCE.projectPipelines.get(0).get("sha"))
// ));
// }
// else
// {
// instance.setScreen(guiScreen); // Sets the screen back to the vanilla screen as if nothing ever happened
// }
//}
//#endif
#if MC_VER >= MC_1_20_2
@Redirect(
@@ -29,8 +29,7 @@ issueTrackerURL = "${issues}"
[[dependencies.distanthorizons]]
modId = "minecraft"
mandatory = true # Forge syntax
type = "required" # Neoforge syntax
type = "required"
versionRange = "${compatible_forgemc_versions}" # Where we set what version of mc it is avalible for
ordering = "NONE"
side = "BOTH"
+2 -3
View File
@@ -4,8 +4,7 @@ minecraft_version=1.20.6
parchment_version=1.20.6:2024.05.01
compatible_minecraft_versions=["1.20.6"]
accessWidenerVersion=1_20_2
builds_for=fabric,neoforge
# neoforge can be added once the issue with mixins has been resolved
builds_for=fabric,neoforge,forge
# Fabric loader
fabric_loader_version=0.15.10
@@ -38,7 +37,7 @@ fabric_api_version=0.97.8+1.20.6
enable_canvas=0
# (Neo)Forge loader
forge_version=50.0.0
forge_version=50.0.19
neoforge_version=20.6.70-beta
# (Neo)Forge mod versions
starlight_version_forge=