}
public static void initCommandHandlerPatches()
{
ClassPatch commandHandler = new ClassPatch("net.minecraft.command.CommandHandler");
commandHandler.methodMappings.add(new MethodMapping("func_71558_b", "getPossibleCommands", "(Lnet/minecraft/command/ICommandSender;Ljava/lang/String;)Ljava/util/List;", "Permissions patch 1, CommandHandler") {
@Override
public void defineMethod(ClassWriter classWriter) {
MethodVisitor mv = classWriter.visitMethod(ACC_PUBLIC, getName(), desc, null, null);
mv.visitCode();
Label l0 = new Label();
mv.visitLabel(l0);
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD, "net/minecraft/command/CommandHandler", getCommandMapFieldName(), "Ljava/util/Map;");
mv.visitVarInsn(ALOAD, 1);
mv.visitVarInsn(ALOAD, 2);
mv.visitMethodInsn(INVOKESTATIC, "com/forgeessentials/core/preloader/forge/command_CommandHandler", mcpName, "(Ljava/util/Map;Lnet/minecraft/command/ICommandSender;Ljava/lang/String;)Ljava/util/List;", false);
mv.visitInsn(ARETURN);
Label l1 = new Label();
mv.visitLabel(l1);
mv.visitLocalVariable("this", "Lnet/minecraft/command/CommandHandler;", null, l0, l1, 0);
mv.visitLocalVariable("sender", "Lnet/minecraft/command/ICommandSender;", null, l0, l1, 1);
mv.visitLocalVariable("raw", "Ljava/lang/String;", null, l0, l1, 2);
mv.visitMaxs(3, 3);
mv.visitEnd();
}
});
commandHandler.methodMappings.add(new MethodMapping("func_71557_a", "getPossibleCommands", "(Lnet/minecraft/command/ICommandSender;)Ljava/util/List;", "Permissions patch 2, CommandHandler") {
@Override
public void defineMethod(ClassWriter classWriter) {
MethodVisitor mv = classWriter.visitMethod(ACC_PUBLIC, getName(), "(Lnet/minecraft/command/ICommandSender;)Ljava/util/List;", null, null);
mv.visitCode();
Label l0 = new Label();