Skip to content

Commit

Permalink
fix: port to 1.8.9
Browse files Browse the repository at this point in the history
  • Loading branch information
ViRb3 committed Feb 3, 2022
1 parent b16350c commit dd11666
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 89 deletions.
21 changes: 15 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
plugins {
id 'fabric-loom' version '0.10-SNAPSHOT'
id 'fabric-loom' version '0.8-SNAPSHOT'
}

version = "${minecraft_version}-fabric-${mod_version}"
group = mod_id

repositories {
maven {
name = "legacy-fabric"
url = "https://maven.legacyfabric.net"
}
}

minecraft {
intermediaryUrl = {
return "https://maven.legacyfabric.net/net/fabricmc/intermediary/" + it + "/intermediary-" + it + "-v2.jar";
}
}

dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings minecraft.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings "net.fabricmc:yarn:${yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// Legacy-Fabric API
modImplementation "net.legacyfabric.legacy-fabric-api:legacy-fabric-api:${fabric_version}"
}

processResources {
Expand Down
8 changes: 5 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
org.gradle.jvmargs=-Xmx1G
org.gradle.daemon=false

minecraft_version=1.16.5
loader_version=0.12.9
fabric_version=0.42.0+1.16
minecraft_version=1.8.9
yarn_mappings=1.8.9+build.202202022355
loader_version=0.13.0
# Legacy-Fabric API
fabric_version=1.2.2+1.8.9

mod_name=mcmouser
mod_id=me.virb3.mcmouser
Expand Down
37 changes: 37 additions & 0 deletions src/main/java/me/virb3/mcmouser/CoreMod.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package me.virb3.mcmouser;

import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.File;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.Locale;

public class CoreMod implements PreLaunchEntrypoint {
private static final Logger LOGGER = LogManager.getLogger();

@Override
public void onPreLaunch() {
if (!System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("mac")) {
LOGGER.info("Not running on macOS, disabling");
return;
}
try {
File tempDir = Files.createTempDirectory("mcmouser").toFile();
tempDir.deleteOnExit();
Path tempFile = tempDir.toPath().resolve("liblwjgl.dylib");
try (InputStream is = CoreMod.class.getResourceAsStream("/liblwjgl.dylib")) {
Files.copy(is, tempFile, StandardCopyOption.REPLACE_EXISTING);
}
System.setProperty("org.lwjgl.librarypath", tempDir.getAbsolutePath());
LOGGER.info("Everything loaded");
} catch (Exception e) {
LOGGER.error("Failed to load patched liblwjgl.dylib, throwing exception");
throw new RuntimeException(e);
}
}
}
10 changes: 0 additions & 10 deletions src/main/java/me/virb3/mcmouser/McMouser.java

This file was deleted.

13 changes: 0 additions & 13 deletions src/main/java/me/virb3/mcmouser/client/McMouserClient.java

This file was deleted.

33 changes: 0 additions & 33 deletions src/main/java/me/virb3/mcmouser/client/mixin/MixinMouse.java

This file was deleted.

13 changes: 3 additions & 10 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,11 @@
"icon": "assets/mcmouser/icon.png",
"environment": "client",
"entrypoints": {
"client": [
"me.virb3.mcmouser.client.McMouserClient"
],
"main": [
"me.virb3.mcmouser.McMouser"
"preLaunch": [
"me.virb3.mcmouser.CoreMod"
]
},
"mixins": [
"mcmouser.mixins.json"
],
"depends": {
"fabricloader": ">=0.12.9",
"minecraft": ">=1.16"
"minecraft": "1.8.9"
}
}
Binary file added src/main/resources/liblwjgl.dylib
Binary file not shown.
14 changes: 0 additions & 14 deletions src/main/resources/mcmouser.mixins.json

This file was deleted.

0 comments on commit dd11666

Please sign in to comment.