From 86ffdd103bb425df2e9273a26383b1ce00362860 Mon Sep 17 00:00:00 2001 From: IzzelAliz Date: Mon, 7 Feb 2022 11:56:59 +0800 Subject: [PATCH] Restore patch to vanilla command node (#464) --- .../java/io/izzel/arclight/boot/AbstractBootstrap.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arclight-forge/src/main/java/io/izzel/arclight/boot/AbstractBootstrap.java b/arclight-forge/src/main/java/io/izzel/arclight/boot/AbstractBootstrap.java index 77c7e2bc..3e87ca63 100644 --- a/arclight-forge/src/main/java/io/izzel/arclight/boot/AbstractBootstrap.java +++ b/arclight-forge/src/main/java/io/izzel/arclight/boot/AbstractBootstrap.java @@ -68,17 +68,18 @@ public class AbstractBootstrap { removeCommand.name = "removeCommand"; removeCommand.desc = Type.getMethodDescriptor(Type.VOID_TYPE, Type.getType(String.class)); removeCommand.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0)); - removeCommand.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1)); removeCommand.instructions.add(new FieldInsnNode(Opcodes.GETFIELD, "com/mojang/brigadier/tree/CommandNode", "children", Type.getDescriptor(Map.class))); + removeCommand.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1)); removeCommand.instructions.add(new MethodInsnNode(Opcodes.INVOKEINTERFACE, Type.getInternalName(Map.class), "remove", "(Ljava/lang/Object;)Ljava/lang/Object;", true)); removeCommand.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0)); - removeCommand.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1)); removeCommand.instructions.add(new FieldInsnNode(Opcodes.GETFIELD, "com/mojang/brigadier/tree/CommandNode", "literals", Type.getDescriptor(Map.class))); + removeCommand.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1)); removeCommand.instructions.add(new MethodInsnNode(Opcodes.INVOKEINTERFACE, Type.getInternalName(Map.class), "remove", "(Ljava/lang/Object;)Ljava/lang/Object;", true)); removeCommand.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0)); - removeCommand.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1)); removeCommand.instructions.add(new FieldInsnNode(Opcodes.GETFIELD, "com/mojang/brigadier/tree/CommandNode", "arguments", Type.getDescriptor(Map.class))); + removeCommand.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1)); removeCommand.instructions.add(new MethodInsnNode(Opcodes.INVOKEINTERFACE, Type.getInternalName(Map.class), "remove", "(Ljava/lang/Object;)Ljava/lang/Object;", true)); + removeCommand.instructions.add(new InsnNode(Opcodes.RETURN)); node.methods.add(removeCommand); } var cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);