diff options
author | Linnea Gräf <nea@nea.moe> | 2024-08-10 01:59:34 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-08-12 21:02:44 +0200 |
commit | 3c7e6b6177de6ef3cff8a46bb1726466a299cdde (patch) | |
tree | 2ebc75e705b5422a68d5d7f04d88e3d8934cf02d /src/main/java/moe/nea/firmament/init/Intermediary.java | |
parent | 1606188d9ad65c66e9d873497ea3271dbdadaf77 (diff) | |
download | Firmament-3c7e6b6177de6ef3cff8a46bb1726466a299cdde.tar.gz Firmament-3c7e6b6177de6ef3cff8a46bb1726466a299cdde.tar.bz2 Firmament-3c7e6b6177de6ef3cff8a46bb1726466a299cdde.zip |
Add indigo support to custom block textures
Diffstat (limited to 'src/main/java/moe/nea/firmament/init/Intermediary.java')
-rw-r--r-- | src/main/java/moe/nea/firmament/init/Intermediary.java | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/main/java/moe/nea/firmament/init/Intermediary.java b/src/main/java/moe/nea/firmament/init/Intermediary.java new file mode 100644 index 0000000..61494d7 --- /dev/null +++ b/src/main/java/moe/nea/firmament/init/Intermediary.java @@ -0,0 +1,63 @@ +package moe.nea.firmament.init; + +import net.fabricmc.loader.api.FabricLoader; +import net.fabricmc.loader.api.MappingResolver; +import org.objectweb.asm.Type; + +import java.util.List; + +public class Intermediary { + private static final MappingResolver RESOLVER = FabricLoader.getInstance().getMappingResolver(); + + static String methodName(Object object) { + throw new AssertionError("Cannot be called at runtime"); + } + + static <T> String className() { + throw new AssertionError("Cannot be called at runtime"); + } + + static String id(String source) { + return source; + } + +// public record Class( +// Type intermediaryClass +// ) { +// public Class(String intermediaryClass) { +// this(Type.getObjectType(intermediaryClass.replace('.', '/'))); +// } +// +// public String getMappedName() { +// return RESOLVER.mapClassName("intermediary", intermediaryClass.getInternalName() +// .replace('/', '.')); +// } +// } +// +// public record Method( +// Type intermediaryClassName, +// String intermediaryMethodName, +// Type intermediaryReturnType, +// List<Type> intermediaryArgumentTypes +// ) { +// public Method( +// String intermediaryClassName, +// String intermediaryMethodName, +// String intermediaryReturnType, +// String... intermediaryArgumentTypes +// ) { +// this(intermediaryClassName, intermediaryMethodName, intermediaryReturnType, List.of(intermediaryArgumentTypes)); +// } +// +// public String getMappedMethodName() { +// return RESOLVER.mapMethodName("intermediary", +// intermediaryClassName.getInternalName().replace('/', '.')); +// } +// +// public Type getIntermediaryDescriptor() { +// return Type.getMethodType(intermediaryReturnType, intermediaryArgumentTypes.toArray(Type[]::new)); +// } +// +// +// } +} |