forked from RedLime/OptiFabric-Pre1.14
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a936bc3
commit 61083bd
Showing
50 changed files
with
769 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
plugins { | ||
id "loom" | ||
id "legacy-looming" | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:$minecraft_version" | ||
mappings(legacy.yarn(minecraft_version, yarn_build)) | ||
implementation project(path: ":", configuration: "namedElements") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minecraft_version=1.13.2 | ||
yarn_build=533 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
1.13.2/src/main/java/me/modmuss50/optifabric/mixin/ReflectorClassMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package me.modmuss50.optifabric.mixin; | ||
|
||
import org.spongepowered.asm.mixin.*; | ||
import org.spongepowered.asm.mixin.injection.*; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
// suppresses some warnings in the log | ||
@Pseudo | ||
@Mixin(targets = "ReflectorClass") | ||
public class ReflectorClassMixin { | ||
@Shadow | ||
private String targetClassName; | ||
|
||
@Shadow | ||
private boolean checked; | ||
|
||
@SuppressWarnings("UnresolvedMixinReference") | ||
@Inject(method = "getTargetClass", at = @At("HEAD"), remap = false) | ||
private void getTargetClass(CallbackInfoReturnable<Class<?>> infoReturnable) { | ||
if (!checked) { // only check the target if it hasn't been done yet | ||
String name = targetClassName.replaceAll("/", "."); | ||
if (name.startsWith("net.minecraft.launchwrapper") || name.startsWith("net.minecraftforge") || "optifine.OptiFineClassTransformer".equals(name)) { | ||
checked = true; | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"schemaVersion": 1, | ||
"id": "optifabric-mixin", | ||
"version": "${version}", | ||
"name": "Optifabric Mixin", | ||
"description": "Optifabric is a mod that loads Optifine into Fabric", | ||
"authors": [ | ||
"Modmuss50", | ||
"Chocohead", | ||
"Hydos", | ||
"RedLime", | ||
"tildejustin" | ||
], | ||
"contact": { | ||
"homepage": "https://modrinth.com/mod/legacy-optifabric", | ||
"sources": "https://github.com/tildejustin/optifabric", | ||
"issues": "https://github.com/tildejustin/optifabric/issues" | ||
}, | ||
"mixins": [ | ||
"optifabric.mixins.json" | ||
], | ||
"license": "MPL-2.0", | ||
"environment": "client", | ||
"depends": { | ||
"fabricloader": ">=0.14", | ||
"minecraft": ">=1.13 <=1.13.2" | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"required": true, | ||
"package": "me.modmuss50.optifabric.mixin", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": [ | ||
"PatcherMixin", | ||
"ReflectorClassMixin" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
plugins { | ||
id "loom" | ||
id "legacy-looming" | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:$minecraft_version" | ||
mappings(legacy.yarn(minecraft_version, yarn_build)) | ||
implementation project(path: ":", configuration: "namedElements") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minecraft_version=1.3.2 | ||
yarn_build=533 |
25 changes: 25 additions & 0 deletions
25
1.3-1.5.2/src/main/java/me/modmuss50/optifabric/mixin/TitleScreenMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package me.modmuss50.optifabric.mixin; | ||
|
||
import me.modmuss50.optifabric.mod.*; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.screen.*; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.*; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(TitleScreen.class) | ||
public abstract class TitleScreenMixin extends Screen { | ||
@Inject(method = "init", at = @At("RETURN")) | ||
private void init(CallbackInfo info) { | ||
if (Optifabric.hasError()) { | ||
System.out.println("an optifabric error has occurred"); | ||
} | ||
} | ||
|
||
@Inject(method = "render", at = @At("RETURN")) | ||
private void render(CallbackInfo ci) { | ||
if (!Optifabric.hasError()) { | ||
this.drawWithShadow(Minecraft.getMinecraft().textRenderer, OptifineVersion.version, 2, this.height - 20, 0xFFFFFFFF); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"schemaVersion": 1, | ||
"id": "optifabric-mixin", | ||
"version": "${version}", | ||
"name": "Optifabric Mixin", | ||
"description": "Optifabric is a mod that loads Optifine into Fabric", | ||
"authors": [ | ||
"Modmuss50", | ||
"Chocohead", | ||
"Hydos", | ||
"RedLime", | ||
"tildejustin" | ||
], | ||
"contact": { | ||
"homepage": "https://modrinth.com/mod/legacy-optifabric", | ||
"sources": "https://github.com/tildejustin/optifabric", | ||
"issues": "https://github.com/tildejustin/optifabric/issues" | ||
}, | ||
"mixins": [ | ||
"optifabric.mixins.json" | ||
], | ||
"license": "MPL-2.0", | ||
"environment": "client", | ||
"depends": { | ||
"fabricloader": ">=0.14", | ||
"minecraft": ">=1.3 <=1.5.2" | ||
}, | ||
"accessWidener": "optifabric.accesswidener" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
accessWidener v2 named | ||
accessible field net/minecraft/client/gui/widget/ButtonWidget width I | ||
accessible field net/minecraft/client/gui/widget/ButtonWidget height I | ||
accessible field net/minecraft/client/option/GameOptions field_946 Lnet/minecraft/client/Minecraft; | ||
accessible field net/minecraft/client/particle/Particle red F | ||
accessible field net/minecraft/client/particle/Particle green F | ||
accessible field net/minecraft/client/particle/Particle blue F | ||
accessible field net/minecraft/world/World levelProperties Lnet/minecraft/world/level/LevelProperties; | ||
accessible field net/minecraft/client/render/GameRenderer lightmapFlicker F |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"required": true, | ||
"package": "me.modmuss50.optifabric.mixin", | ||
"compatibilityLevel": "JAVA_8", | ||
"client": [ | ||
"TitleScreenMixin" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
plugins { | ||
id "loom" | ||
id "legacy-looming" | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:$minecraft_version" | ||
mappings(legacy.yarn(minecraft_version, yarn_build)) | ||
implementation project(path: ":", configuration: "namedElements") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minecraft_version=1.7.10 | ||
yarn_build=533 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
1.6-1.7.10/src/main/java/me/modmuss50/optifabric/mixin/TitleScreenMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package me.modmuss50.optifabric.mixin; | ||
|
||
import me.modmuss50.optifabric.mod.*; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.gui.screen.*; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.*; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(TitleScreen.class) | ||
public abstract class TitleScreenMixin extends Screen { | ||
@Inject(method = "init", at = @At("RETURN")) | ||
private void init(CallbackInfo info) { | ||
if (Optifabric.hasError()) { | ||
System.out.println("an optifabric error has occurred"); | ||
} | ||
} | ||
|
||
@Inject(method = "render", at = @At("RETURN")) | ||
private void render(CallbackInfo ci) { | ||
if (!Optifabric.hasError()) { | ||
this.drawWithShadow(MinecraftClient.getInstance().textRenderer, OptifineVersion.version, 2, this.height - 20, 0xFFFFFFFF); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"schemaVersion": 1, | ||
"id": "optifabric-mixin", | ||
"version": "${version}", | ||
"name": "Optifabric Mixin", | ||
"description": "Optifabric is a mod that loads Optifine into Fabric", | ||
"authors": [ | ||
"Modmuss50", | ||
"Chocohead", | ||
"Hydos", | ||
"RedLime", | ||
"tildejustin" | ||
], | ||
"contact": { | ||
"homepage": "https://modrinth.com/mod/legacy-optifabric", | ||
"sources": "https://github.com/tildejustin/optifabric", | ||
"issues": "https://github.com/tildejustin/optifabric/issues" | ||
}, | ||
"mixins": [ | ||
"optifabric.mixins.json" | ||
], | ||
"license": "MPL-2.0", | ||
"environment": "client", | ||
"depends": { | ||
"fabricloader": ">=0.14", | ||
"minecraft": ">=1.6 <=1.7.10" | ||
}, | ||
"accessWidener": "optifabric.accesswidener" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
accessWidener v2 named | ||
accessible method net/minecraft/block/Block setOpacity (I)Lnet/minecraft/block/Block; | ||
accessible field net/minecraft/resource/AbstractFileResourcePack base Ljava/io/File; | ||
accessible field net/minecraft/entity/LivingEntity despawnCounter I | ||
accessible method net/minecraft/entity/mob/MobEntity checkDespawn ()V | ||
accessible method net/minecraft/util/Language getInstance ()Lnet/minecraft/util/Language; | ||
accessible field net/minecraft/client/particle/Particle red F | ||
accessible field net/minecraft/client/particle/Particle green F | ||
accessible field net/minecraft/client/particle/Particle blue F | ||
accessible field net/minecraft/client/gui/widget/ButtonWidget width I | ||
accessible field net/minecraft/client/gui/widget/ButtonWidget height I | ||
accessible method net/minecraft/client/texture/TextureUtil bindTexture (I)V | ||
accessible field net/minecraft/client/render/GameRenderer lightmapFlicker F | ||
accessible method net/minecraft/block/Block method_462 (I)Lnet/minecraft/block/Block; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"required": true, | ||
"package": "me.modmuss50.optifabric.mixin", | ||
"compatibilityLevel": "JAVA_8", | ||
"client": [ | ||
"TitleScreenMixin" | ||
] | ||
} |
8 changes: 8 additions & 0 deletions
8
1.6-1.7.10/src/main/resources/optifabric.optifine.mixins.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"required": true, | ||
"package": "me.modmuss50.optifabric.mixin", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": [ | ||
"ReflectorClassMixin" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
plugins { | ||
id "loom" | ||
id "legacy-looming" | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:$minecraft_version" | ||
mappings(legacy.yarn(minecraft_version, yarn_build)) | ||
implementation project(path: ":", configuration: "namedElements") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minecraft_version=1.12.2 | ||
yarn_build=533 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
1.8-1.12.2/src/main/java/me/modmuss50/optifabric/mixin/PatcherMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package me.modmuss50.optifabric.mixin; | ||
|
||
import org.spongepowered.asm.mixin.*; | ||
import org.spongepowered.asm.mixin.injection.*; | ||
|
||
@Pseudo | ||
@Mixin(targets = "optifine.Patcher") | ||
public abstract class PatcherMixin { | ||
@SuppressWarnings("UnresolvedMixinReference") | ||
@Redirect(method = "process", at = @At(value = "INVOKE", target = "Ljava/lang/String;equals(Ljava/lang/Object;)Z")) | ||
private static boolean ignoreHashFailure(String instance, Object o) { | ||
return true; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
1.8-1.12.2/src/main/java/me/modmuss50/optifabric/mixin/ReflectorClassMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package me.modmuss50.optifabric.mixin; | ||
|
||
import org.spongepowered.asm.mixin.*; | ||
import org.spongepowered.asm.mixin.injection.*; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
// suppresses some warnings in the logs | ||
@Pseudo | ||
@Mixin(targets = "net.optifine.reflect.ReflectorClass") | ||
public class ReflectorClassMixin { | ||
@Shadow | ||
private String targetClassName; | ||
|
||
@Shadow | ||
private boolean checked; | ||
|
||
@SuppressWarnings("UnresolvedMixinReference") | ||
@Inject(method = "getTargetClass", at = @At("HEAD"), remap = false) | ||
private void getTargetClass(CallbackInfoReturnable<Class<?>> infoReturnable) { | ||
if (!this.checked) { // only check the target if it hasn't been done yet | ||
String name = this.targetClassName.replaceAll("/", "."); | ||
if (name.startsWith("net.minecraft.launchwrapper") || name.startsWith("net.minecraftforge") || "optifine.OptiFineClassTransformer".equals(name)) { | ||
this.checked = true; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.