Skip to content

Commit

Permalink
mc1.16.5同步更新新版bug修复
Browse files Browse the repository at this point in the history
  • Loading branch information
reserveword committed Jul 23, 2023
1 parent 4a12cb1 commit 5cdedaa
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
//apply plugin: 'maven-publish'

version = '3.1.2'
version = '3.1.2+patch4.0.5'
group = 'io.github.reserveword' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
//noinspection GroovyUnusedAssignment
archivesBaseName = 'imblocker-1.16.5'
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/META-INF/coremods.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"text_field_asm": "coremod/text_field_asm.js",
"chat_screen_asm": "coremod/chat_screen_asm.js"
"chat_screen_asm": "coremod/chat_screen_asm.js",
"window_focus_asm": "coremod/window_focus_asm.js"
}
29 changes: 29 additions & 0 deletions src/main/resources/coremod/window_focus_asm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
var ASMAPI = Java.type('net.minecraftforge.coremod.api.ASMAPI');
var InsnList = Java.type('org.objectweb.asm.tree.InsnList');
var MethodInsnNode = Java.type('org.objectweb.asm.tree.MethodInsnNode');
var Opcodes = Java.type('org.objectweb.asm.Opcodes');

function initializeCoreMod() {
return {
'window_focus_asm': {
'target': {
'type': 'METHOD',
'class': 'net.minecraft.client.Minecraft',
'methodName': 'func_213228_a',
'methodDesc': '(Z)V'
},
'transformer': function (method) {
il = new InsnList()
il.add(new MethodInsnNode(
Opcodes.INVOKESTATIC,
'io/github/reserveword/imblocker/IMManager',
'syncState',
'()V',
false
))
method.instructions.insert(il)
return method
}
}
};
}

0 comments on commit 5cdedaa

Please sign in to comment.