From 0446e5adb3730ee4faf06cc624c59412d237c682 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Wed, 28 Aug 2024 18:10:43 +0700 Subject: [PATCH] Update js coremods signatures --- src/main/resources/coremods/chest_menus.js | 11 ++++------- src/main/resources/coremods/code_injector.js | 12 ++++++------ src/main/resources/coremods/limb_brush_overclock.js | 6 +++--- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/main/resources/coremods/chest_menus.js b/src/main/resources/coremods/chest_menus.js index e09bfb4d1..bd0c38f3b 100644 --- a/src/main/resources/coremods/chest_menus.js +++ b/src/main/resources/coremods/chest_menus.js @@ -23,13 +23,10 @@ var isOwnPatches = [ function patchMethod(node) { if (node.desc.endsWith('AbstractContainerMenu;')) { - var threeRows = ASMAPI.mapMethod('m_39237_') - var sixRows = ASMAPI.mapMethod('m_39246_') - for (var i = 0; i < node.instructions.size(); i++) { var instr = node.instructions.get(i) - if (instr.getOpcode() == Opcodes.INVOKESTATIC && instr.name == threeRows && instr.owner == 'net/minecraft/world/inventory/ChestMenu') { + if (instr.getOpcode() == Opcodes.INVOKESTATIC && instr.name == 'threeRows' && instr.owner == 'net/minecraft/world/inventory/ChestMenu') { node.instructions.set(instr, new MethodInsnNode( Opcodes.INVOKESTATIC, 'ru/dbotthepony/mc/otm/compat/vanilla/MatteryChestMenu', @@ -38,7 +35,7 @@ function patchMethod(node) { )) break - } else if (instr.getOpcode() == Opcodes.INVOKESTATIC && instr.name == sixRows && instr.owner == 'net/minecraft/world/inventory/ChestMenu') { + } else if (instr.getOpcode() == Opcodes.INVOKESTATIC && instr.name == 'sixRows' && instr.owner == 'net/minecraft/world/inventory/ChestMenu') { node.instructions.set(instr, new MethodInsnNode( Opcodes.INVOKESTATIC, 'ru/dbotthepony/mc/otm/compat/vanilla/MatteryChestMenu', @@ -80,7 +77,7 @@ function initializeCoreMod() { 'target': { 'type': 'METHOD', 'class': clazz, - 'methodName': ASMAPI.mapMethod('m_142718_'), + 'methodName': 'isOwnContainer', 'methodDesc': '(Lnet/minecraft/world/entity/player/Player;)Z' }, 'transformer': function(node) { @@ -89,7 +86,7 @@ function initializeCoreMod() { if ((instr.getOpcode() == Opcodes.INSTANCEOF || instr.getOpcode() == Opcodes.CHECKCAST) && instr.desc == 'net/minecraft/world/inventory/ChestMenu') { instr.desc = 'ru/dbotthepony/mc/otm/compat/vanilla/MatteryChestMenu' - } else if (instr.getOpcode() == Opcodes.INVOKEVIRTUAL && instr.owner == 'net/minecraft/world/inventory/ChestMenu' && instr.name == ASMAPI.mapMethod('m_39261_')) { + } else if (instr.getOpcode() == Opcodes.INVOKEVIRTUAL && instr.owner == 'net/minecraft/world/inventory/ChestMenu' && instr.name == 'getContainer') { instr.owner = 'ru/dbotthepony/mc/otm/compat/vanilla/MatteryChestMenu' instr.name = 'getContainer' } diff --git a/src/main/resources/coremods/code_injector.js b/src/main/resources/coremods/code_injector.js index ac489454b..7c9f48882 100644 --- a/src/main/resources/coremods/code_injector.js +++ b/src/main/resources/coremods/code_injector.js @@ -626,7 +626,7 @@ function initializeCoreMod() { 'target': { 'type': 'METHOD', 'class': 'com.mojang.blaze3d.systems.RenderSystem', - 'methodName': ASMAPI.mapMethod('m_69478_'), // enableBlend + 'methodName': 'enableBlend', 'methodDesc': '()V' }, 'transformer': patchBlendFunc @@ -636,7 +636,7 @@ function initializeCoreMod() { 'target': { 'type': 'METHOD', 'class': 'com.mojang.blaze3d.systems.RenderSystem', - 'methodName': ASMAPI.mapMethod('m_69461_'), // disableBlend + 'methodName': 'disableBlend', 'methodDesc': '()V' }, 'transformer': patchBlendFunc @@ -646,7 +646,7 @@ function initializeCoreMod() { 'target': { 'type': 'METHOD', 'class': 'com.mojang.blaze3d.systems.RenderSystem', - 'methodName': ASMAPI.mapMethod('m_69405_'), // blendFunc + 'methodName': 'blendFunc', 'methodDesc': '(II)V' }, 'transformer': patchBlendFunc @@ -656,7 +656,7 @@ function initializeCoreMod() { 'target': { 'type': 'METHOD', 'class': 'com.mojang.blaze3d.systems.RenderSystem', - 'methodName': ASMAPI.mapMethod('m_69411_'), // blendFuncSeparate + 'methodName': 'blendFuncSeparate', 'methodDesc': '(IIII)V' }, 'transformer': patchBlendFunc @@ -666,7 +666,7 @@ function initializeCoreMod() { 'target': { 'type': 'METHOD', 'class': 'com.mojang.blaze3d.systems.RenderSystem', - 'methodName': ASMAPI.mapMethod('m_69416_'), // blendFuncSeparate + 'methodName': 'blendFuncSeparate', 'methodDesc': '(Lcom/mojang/blaze3d/platform/GlStateManager$SourceFactor;Lcom/mojang/blaze3d/platform/GlStateManager$DestFactor;Lcom/mojang/blaze3d/platform/GlStateManager$SourceFactor;Lcom/mojang/blaze3d/platform/GlStateManager$DestFactor;)V' }, 'transformer': patchBlendFunc @@ -676,7 +676,7 @@ function initializeCoreMod() { 'target': { 'type': 'METHOD', 'class': 'com.mojang.blaze3d.systems.RenderSystem', - 'methodName': ASMAPI.mapMethod('m_69408_'), // blendFunc + 'methodName': 'blendFunc', 'methodDesc': '(Lcom/mojang/blaze3d/platform/GlStateManager$SourceFactor;Lcom/mojang/blaze3d/platform/GlStateManager$DestFactor;)V' }, 'transformer': patchBlendFunc diff --git a/src/main/resources/coremods/limb_brush_overclock.js b/src/main/resources/coremods/limb_brush_overclock.js index 344fa1a7d..88e51b8e4 100644 --- a/src/main/resources/coremods/limb_brush_overclock.js +++ b/src/main/resources/coremods/limb_brush_overclock.js @@ -8,7 +8,7 @@ function initializeCoreMod() { 'target': { "type":"METHOD", "class":"net.minecraft.world.item.BrushItem", - "methodName":"m_5929_", + "methodName":"onUseTick", "methodDesc":"(Lnet/minecraft/world/level/Level;Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/item/ItemStack;I)V" }, 'transformer': function(node) { @@ -49,7 +49,7 @@ function initializeCoreMod() { 'target': { "type":"METHOD", "class":"net.minecraft.world.level.block.entity.BrushableBlockEntity", - "methodName":"m_276923_", + "methodName":"brush", "methodDesc":"(JLnet/minecraft/world/entity/player/Player;Lnet/minecraft/core/Direction;)Z" }, 'transformer': function(node) { @@ -73,4 +73,4 @@ function initializeCoreMod() { } }, } -} \ No newline at end of file +}