Skip to content

Commit

Permalink
Fix connected textures for 1.19.3+
Browse files Browse the repository at this point in the history
Turns out part of the old mixin was useful after all
Closes #1224
Fixes #1218
Fixes #1164
Fixes #1149
Fixes #1107
Fixes #1089
Fixes #1036
Fixes #1011
Fixes #980
  • Loading branch information
Chocohead committed Jan 11, 2024
1 parent fa1dcf5 commit 9d0ee2e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ fabric_version=0.42.0+1.16
tiny_remapper_version=0.8.11
fabric_asm_version=v2.3

mod_version = 1.14.1
mod_version = 1.14.2
maven_group = me.modmuss50
archives_base_name = optifabric
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package me.modmuss50.optifabric.mixin;

import java.io.IOException;
import java.io.InputStream;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

import net.minecraft.resource.DefaultResourcePack;

import me.modmuss50.optifabric.mod.OptifineResources;

@Mixin(value = DefaultResourcePack.class, priority = 400)
abstract class DefaultResourcePackMixin {
@Redirect(method = "getResourceOF", remap = false,
at = @At(value = "INVOKE", target = "Lnet/optifine/reflect/ReflectorForge;getOptiFineResourceStream(Ljava/lang/String;)Ljava/io/InputStream;"))
private InputStream onFindInputStream(String path) throws IOException {
return OptifineResources.INSTANCE.getResource(path);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ protected boolean isPresent() {
Mixins.addConfiguration("optifabric.optifine.mixins.json");
if (OptifabricSetup.isPresent("minecraft", "<=1.19.2")) {
Mixins.addConfiguration("optifabric.optifine.old-mixins.json");
} else {
Mixins.addConfiguration("optifabric.optifine.new-mixins.json");
}

if (isPresent("fabricloader", ">=0.13.0") && (isPresent("cloth-client-events-v0", ">=3.1.58") || isPresent("cloth-client-events-v0", ">=2.1.60 <3.0") || isPresent("cloth-client-events-v0", ">=1.6.59 <2.0"))) {
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/optifabric.optifine.new-mixins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "optifabric.optifine.mixins.json",
"package": "me.modmuss50.optifabric.mixin",
"mixins": [
"DefaultResourcePackMixin"
]
}

0 comments on commit 9d0ee2e

Please sign in to comment.