Update some stuffs

This commit is contained in:
Ran
2021-12-22 22:16:08 +06:00
parent 71c72e26e7
commit ba81f31027
6 changed files with 73 additions and 12 deletions
+8 -8
View File
@@ -28,6 +28,11 @@ https://fabricmc.net/wiki/tutorial:setup
* A Java Development Kit (JDK) for Java 17 (recommended) or newer. Visit https://www.oracle.com/java/technologies/downloads/ for installers.
* Git or someway to clone git projects. Visit https://git-scm.com/ for installers.
* Any Java IDE, for example Intellij IDEA and Eclipse. You may also use any other code editors, such as Visual Studio Code. (Optional)
It's better to use IntelliJ IDEA since Eclipse is not supported by Architectury, but it still works.
**If using IntelliJ:**
1. open IDEA and import the build.gradle
2. refresh the Gradle project in IDEA if required
**If using Ecplise:**
1. run the command: `./gradlew geneclipseruns`
@@ -35,11 +40,6 @@ https://fabricmc.net/wiki/tutorial:setup
3. Make sure eclipse has the JDK 17 installed. (This is needed so that eclipse can run minecraft)
4. Import the project into eclipse
**If using IntelliJ:**
1. open IDEA and import the build.gradle
2. run the command: `./gradlew genIntellijRuns`
3. refresh the Gradle project in IDEA if required
## Compiling
**Using GUI**
@@ -50,7 +50,7 @@ https://fabricmc.net/wiki/tutorial:setup
**If in terminal:**
1. `git clone -b 1.18.X --recurse-submodules https://gitlab.com/jeseibel/minecraft-lod-mod.git`
2. `cd minecraft-lod-mod`
3. `./gradlew build`
3. `./gradlew assemble` or `./gradlew build`
4. The build should be in `fabric/build/libs/` and `forge/build/libs/`
@@ -69,8 +69,8 @@ Source code uses Mojang mappings.
## Useful commands
Build only Fabric: `./gradlew fabric:build`\
Build only Forge: `./gradlew forge:build`\
Build only Fabric: `./gradlew fabric:assemble` or `./gradlew fabric:build`\
Build only Forge: `./gradlew fabric:assemble` or `./gradlew forge:build`\
Run the Fabric client (for debugging): `./gradlew fabric:runClient`\
Run the Forge client (for debugging): `./gradlew forge:runClient`
@@ -25,3 +25,6 @@ accessible field net/minecraft/client/renderer/texture/TextureAtlasSprite mainIm
accessible method net/minecraft/client/renderer/texture/TextureAtlasSprite$AnimatedTexture getFrameX (I)I
accessible method net/minecraft/client/renderer/texture/TextureAtlasSprite$AnimatedTexture getFrameY (I)I
extendable class com/mojang/math/Matrix4f
# hacky stuff
mutable field net/minecraft/util/ThreadingDetector lock Ljava/util/concurrent/Semaphore;
@@ -0,0 +1,26 @@
package com.seibel.lod.fabric.mixins.unsafe;
import net.minecraft.util.ThreadingDetector;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.concurrent.Semaphore;
/**
* Why does this exist? But okay! (Will be probably removed when the experimental generator is done)
*/
@Mixin(ThreadingDetector.class)
public class MixinThreadingDectector {
@Mutable
@Shadow @Final private Semaphore lock;
@Inject(method = "<init>", at = @At("RETURN"))
private void setSemaphore(CallbackInfo ci) {
this.lock = new Semaphore(2);
}
}
+5 -3
View File
@@ -3,14 +3,16 @@
"minVersion": "0.8",
"package": "com.seibel.lod.fabric.mixins",
"compatibilityLevel": "JAVA_17",
"mixins": [],
"mixins": [
"unsafe.MixinThreadingDectector",
"events.MixinServerLevel"
],
"client": [
"MixinMinecraft",
"MixinOptionsScreen",
"MixinWorldRenderer",
"events.MixinClientLevel",
"events.MixinMinecraft",
"events.MixinServerLevel"
"events.MixinMinecraft"
],
"server": [],
"injectors": {
@@ -0,0 +1,27 @@
package com.seibel.lod.forge.mixins.unsafe;
import net.minecraft.util.ThreadingDetector;
import net.minecraft.world.level.chunk.PalettedContainer;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.concurrent.Semaphore;
/**
* Why does this exist? But okay! (Will be probably removed when the experimental generator is done)
*/
@Mixin(ThreadingDetector.class)
public class MixinThreadingDectector {
@Mutable
@Shadow @Final private Semaphore lock;
@Inject(method = "<init>", at = @At("RETURN"))
private void setSemaphore(CallbackInfo ci) {
this.lock = new Semaphore(2);
}
}
+4 -1
View File
@@ -3,9 +3,12 @@
"package": "com.seibel.lod.forge.mixins",
"compatibilityLevel": "JAVA_17",
"refmap": "lod.refmap.json",
"mixins": [
"client": [
"MixinWorldRenderer",
"MixinOptionsScreen"
],
"mixins": [
"unsafe.MixinThreadingDectector"
],
"minVersion": "0.8"
}