I tried to add a recipe in the iOS version of MinecraftPE, but I got this error. What should I do?
error: reference to type 'const ItemInstance' could not bind to an rvalue of type 'void' ..._inst->iteminstance(_inst, Item::mItems[432], 0), "###", "#S#", "###", d... note: passing argument to parameter 'inst' here void Recipes::addShapedRecipe(Recipes* res, const ItemInstance& inst, co...
The source code is here:
Tweak.xm
#import "../substrate.h"
#import <UIKit/UIKit.h>
#import <mach-o/dyld.h>
#import <initializer_list>
#import <vector>
#import <map>
#import <mach-o/dyld.h>
#import <string>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <initializer_list>
#import <vector>
#import <mach-o/dyld.h>
#import <UIKit/UIKit.h>
#import <iostream>
#import <stdio.h>
#include <sstream>
#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <string.h>
#include <algorithm>
#include <fstream>
#include <ifaddrs.h>
#include <stdint.h>
#include <dlfcn.h>
#include "Item.h"
#include "ItemInstance.h"
#include "Recipes.h"
ItemInstance* _inst = NULL;
void (*ItemInstance::iteminstance_)(ItemInstance*, Item const*, int);
void ItemInstance::iteminstance(ItemInstance* inst, Item const* item, int meta) {
_inst = inst;
iteminstance_(inst, item, meta);
}
void (*Recipes::addShapedRecipe_)(Recipes* res, const ItemInstance& inst, const std::string& s1, const std::string& s2, const std::string& s3, const std::vector<Recipes::Type, std::allocator<Recipes::Type>>& ress);
void Recipes::addShapedRecipe(Recipes* res, const ItemInstance& inst, const std::string& s1, const std::string& s2, const std::string& s3, const std::vector<Recipes::Type, std::allocator<Recipes::Type>>& ress) {
addShapedRecipe_(res, inst, s1, s2, s3, ress);
}
void (*Recipes::_init_)(Recipes* res);
void Recipes::_init(Recipes* res) {
Recipes::_init_(res);
const std::vector<Recipes::Type, std::allocator<Recipes::Type>>& def = definition<Item*, Item*>('#', Item::mItems[296], 'S', Item::mItems[368]);
res->addShapedRecipe(res, _inst->iteminstance(_inst, Item::mItems[432], 0), "###", "#S#", "###", def);
}
%ctor {
MSHookFunction((void*)(0x1007569a4 + _dyld_get_image_vmaddr_slide(0)), (void*)&ItemInstance::iteminstance, (void**)&ItemInstance::iteminstance_);
MSHookFunction((void*)(0x100781d74 + _dyld_get_image_vmaddr_slide(0)), (void*)&Recipes::addShapedRecipe, (void**)&Recipes::addShapedRecipe_);
MSHookFunction((void*)(0x100774f40 + _dyld_get_image_vmaddr_slide(0)), (void*)&Recipes::_init, (void**)&Recipes::_init_);
MSHookFunction((void*)(0x1012ae238 + _dyld_get_image_vmaddr_slide(0)), (void*)&Item::mItems, NULL);
}
Recipes.h
#pragma once
#include <memory>
#include <string>
#include <vector>
#include <stdint.h>
#include "ItemInstance.h"
class Recipes {
public:
class Type {
public:
Item* item;
uintptr_t* block;
ItemInstance inst;
char c;
};
public:
static void (*_init_)(Recipes* res);
static void _init(Recipes* res);
static void (*addShapedRecipe_)(Recipes* res, const ItemInstance& inst, const std::string& s1, const std::string& s2, const std::string& s3, const std::vector<Recipes::Type, std::allocator<Recipes::Type>>& ress);
static void addShapedRecipe(Recipes* res, const ItemInstance& inst, const std::string& s1, const std::string& s2, const std::string& s3, const std::vector<Recipes::Type, std::allocator<Recipes::Type>>& ress);
};
ItemInstance.h
#pragma once
#include <memory>
#include "Item.h"
class ItemInstance {
public:
static void (*iteminstance_)(ItemInstance*, Item const*, int);
static void iteminstance(ItemInstance* inst, Item const* item, int meta);
};
Item.h
#pragma once
#include <string>
#include <memory>
#include <vector>
#include <unordered_map>
class Item {
public:
char filler[200];
public:
static Item* mItems[512];
};
Aucun commentaire:
Enregistrer un commentaire