Skip to content

Commit

Permalink
Fixes fixes and more fixes!
Browse files Browse the repository at this point in the history
  • Loading branch information
XyperCode committed May 4, 2024
1 parent 2c53847 commit 8c4362b
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 54 deletions.
5 changes: 4 additions & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"

implementation api("space.earlygrey:shapedrawer:$shapedrawer_version")
implementation api("com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdx_version")
implementation api("com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdx_version", {
exclude group: "org.lwjgl.lwjgl"
exclude group: "org.lwjgl"
})
implementation api("com.badlogicgames.gdx:gdx:$gdx_version")
implementation api("com.badlogicgames.gdx:gdx-platform:$gdx_version:natives-desktop")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.badlogic.gdx.ApplicationLogger;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Version;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3NativesLoader;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3WindowListener;
import com.badlogic.gdx.graphics.Pixmap;
Expand All @@ -20,8 +19,7 @@
import io.github.ultreon.gdxminecraft.impl.MinecraftApplication;
import io.github.ultreon.gdxminecraft.impl.MinecraftGdxLogger;
import io.github.ultreon.gdxminecraft.impl.MinecraftWindow;
import io.github.ultreon.gdxminecraft.mixin.Lwjgl3ApplicationAccessor;
import io.github.ultreon.gdxminecraft.mixin.Lwjgl3GraphicsAccessor;
import io.github.ultreon.gdxminecraft.mixin.accessors.Lwjgl3GraphicsAccessor;
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
import net.minecraft.client.Minecraft;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
import com.badlogic.gdx.utils.Array;
import io.github.ultreon.gdxminecraft.GdxMinecraft;
import io.github.ultreon.gdxminecraft.api.ModLoader;
import io.github.ultreon.gdxminecraft.mixin.Lwjgl3ApplicationAccessor;
import io.github.ultreon.gdxminecraft.mixin.Lwjgl3GraphicsAccessor;
import io.github.ultreon.gdxminecraft.mixin.Lwjgl3WindowAccessor;
import io.github.ultreon.gdxminecraft.mixin.Lwjgl3WindowMixin;
import io.github.ultreon.gdxminecraft.mixin.accessors.Lwjgl3ApplicationAccessor;
import io.github.ultreon.gdxminecraft.mixin.accessors.Lwjgl3WindowAccessor;
import net.minecraft.client.Minecraft;
import org.jetbrains.annotations.NotNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.badlogic.gdx.utils.Disposable;
import io.github.ultreon.gdxminecraft.GdxMinecraft;
import io.github.ultreon.gdxminecraft.impl.MinecraftGdxLogger;
import io.github.ultreon.gdxminecraft.mixin.accessors.Lwjgl3WindowAccessor;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Mixin;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(Main.class)
public class MainMixin {
public abstract class MainMixin {
@Inject(method = "main", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;beginInitialization()V", shift = At.Shift.AFTER), remap = false)
private static void gdx_minecraft$injectMain(String[] args, CallbackInfo ci) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

@SuppressWarnings("DataFlowIssue")
@Mixin(Window.class)
public class McWindowMixin {
public abstract class McWindowMixin {

@Redirect(method = "<init>", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL;createCapabilities()Lorg/lwjgl/opengl/GLCapabilities;"), remap = false)
private GLCapabilities gdx_minecraft$injectInit() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.mojang.blaze3d.platform.Window;
import io.github.ultreon.gdxminecraft.GdxMinecraft;
import io.github.ultreon.gdxminecraft.impl.MinecraftApplication;
import io.github.ultreon.gdxminecraft.mixin.accessors.MinecraftAccessor;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Overlay;
import net.minecraft.client.gui.screens.Screen;
Expand All @@ -18,7 +18,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(Minecraft.class)
public class MinecraftMixin {
public abstract class MinecraftMixin {
@Shadow @Nullable
public ClientLevel level;
@Shadow @Nullable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
package io.github.ultreon.gdxminecraft.mixin;
package io.github.ultreon.gdxminecraft.mixin.accessors;

import com.badlogic.gdx.InputEventQueue;
import com.badlogic.gdx.backends.lwjgl3.DefaultLwjgl3Input;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window;
import com.badlogic.gdx.utils.Disposable;
import org.lwjgl.glfw.*;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(DefaultLwjgl3Input.class)
public interface DefaultLwjgl3InputAccessor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.ultreon.gdxminecraft.mixin;
package io.github.ultreon.gdxminecraft.mixin.accessors;

import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Graphics;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.github.ultreon.gdxminecraft.mixin.accessors;

import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Graphics;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(Lwjgl3Graphics.class)
public interface Lwjgl3GraphicsAccessor {
@Invoker
void invokeRenderWindow(long windowHandle, final int width, final int height);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.ultreon.gdxminecraft.mixin;
package io.github.ultreon.gdxminecraft.mixin.accessors;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationBase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.ultreon.gdxminecraft.mixin;
package io.github.ultreon.gdxminecraft.mixin.accessors;

import net.minecraft.client.Minecraft;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package io.github.ultreon.gdxminecraft.test;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.*;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g3d.Renderable;
import com.badlogic.gdx.graphics.g3d.shaders.DefaultShader;
import com.badlogic.gdx.graphics.g3d.utils.MeshBuilder;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Vector3;
import io.github.ultreon.gdxminecraft.GdxMinecraft;
import io.github.ultreon.gdxminecraft.api.GdxScreen;
Expand Down
11 changes: 5 additions & 6 deletions common/src/main/resources/gdx_minecraft-common.mixins.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
{
"required": true,
"refmap": "gdx-minecraft-common-refmap.json",
"minVersion": "0.8",
"package": "io.github.ultreon.gdxminecraft.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"DefaultLwjgl3InputAccessor",
"accessors.DefaultLwjgl3InputAccessor",
"DefaultLwjgl3InputMixin",
"Lwjgl3ApplicationAccessor",
"accessors.Lwjgl3ApplicationAccessor",
"Lwjgl3ApplicationMixin",
"Lwjgl3GraphicsAccessor",
"accessors.Lwjgl3GraphicsAccessor",
"Lwjgl3GraphicsMixin",
"Lwjgl3WindowAccessor",
"accessors.Lwjgl3WindowAccessor",
"Lwjgl3WindowMixin"
],
"client": [
"MainMixin",
"McWindowMixin",
"MinecraftAccessor",
"accessors.MinecraftAccessor",
"MinecraftMixin"
],
"injectors": {
Expand Down
5 changes: 4 additions & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ dependencies {
modImplementation("com.terraformersmc:modmenu:8.0.0")

include implementation(api("space.earlygrey:shapedrawer:$shapedrawer_version"))
include implementation(api("com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdx_version"))
include implementation(api("com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdx_version", {
exclude group: "org.lwjgl.lwjgl"
exclude group: "org.lwjgl"
}))
include implementation(api("com.badlogicgames.gdx:gdx:$gdx_version"))
include implementation(api("com.badlogicgames.gdx:gdx-platform:$gdx_version:natives-desktop"))
include implementation(api("com.badlogicgames.gdx:gdx-jnigen-loader:2.3.1"))
Expand Down
5 changes: 4 additions & 1 deletion forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ dependencies {
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false }

include forgeRuntimeLibrary(api("space.earlygrey:shapedrawer:$shapedrawer_version"))
include forgeRuntimeLibrary(api("com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdx_version"))
include forgeRuntimeLibrary(api("com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdx_version", {
exclude group: "org.lwjgl.lwjgl"
exclude group: "org.lwjgl"
}))
include forgeRuntimeLibrary(api("com.badlogicgames.gdx:gdx:$gdx_version"))
include forgeRuntimeLibrary(api("com.badlogicgames.gdx:gdx-platform:$gdx_version:natives-desktop"))
}
Expand Down

0 comments on commit 8c4362b

Please sign in to comment.