Skip to content

Commit

Permalink
Merge pull request #21 from anatawa12/use-accesstransformer
Browse files Browse the repository at this point in the history
Use accesstransformer
  • Loading branch information
anatawa12 authored Apr 17, 2020
2 parents 8fd8424 + 90bc1c2 commit ca2d77b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ jar {

manifest {
attributes("FMLCorePlugin" : "com.anatawa12.fixRtm.asm.FixRtmCorePlugin",
"FMLCorePluginContainsFMLMod": "*")
"FMLCorePluginContainsFMLMod": "*",
'FMLAT': 'fix-rtm_at.cfg',
)
}
}

Expand Down
4 changes: 3 additions & 1 deletion makePatch.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ task makeFixrtmJar(type: Jar) {

manifest {
attributes("FMLCorePlugin" : "com.anatawa12.fixRtm.asm.FixRtmCorePlugin",
"FMLCorePluginContainsFMLMod": "*")
"FMLCorePluginContainsFMLMod": "*",
'FMLAT': 'fix-rtm_at.cfg',
)
}
}
8 changes: 1 addition & 7 deletions src/main/java/com/anatawa12/fixRtm/FixRtm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,7 @@ object FixRtm {
@SubscribeEvent
fun registerModel(e: ModelRegistryEvent) {
ClientRegistry.registerTileEntity(TestTileEntity::class.java, "test", TestSPRenderer)
try {
@Suppress("UNCHECKED_CAST")
(Minecraft::class.java.getDeclaredField("field_110449_ao").apply { isAccessible = true }.get(Minecraft.getMinecraft()) as MutableList<IResourcePack>).add(ButtonResourcePack)
} catch (ex: NoSuchFieldException) {
@Suppress("UNCHECKED_CAST")
(Minecraft::class.java.getDeclaredField("defaultResourcePacks").apply { isAccessible = true }.get(Minecraft.getMinecraft()) as MutableList<IResourcePack>).add(ButtonResourcePack)
}
Minecraft.getMinecraft().defaultResourcePacks.add(ButtonResourcePack)
DummyModelObject.init()
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/META-INF/fix-rtm_at.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public net.minecraft.client.Minecraft field_110449_ao

0 comments on commit ca2d77b

Please sign in to comment.