forked from mirrors/kolyah35-minecraft-pe-0.6.1
FIX: The end of item cheating
This commit is contained in:
parent
4beb5cb0f9
commit
41c5bdf243
8 changed files with 182 additions and 29 deletions
|
|
@ -357,3 +357,12 @@ bool Inventory::removeItem( const ItemInstance* samePtr ) {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Inventory::print() {
|
||||
LOGI("%s's Inventory:\n", player->name.c_str());
|
||||
|
||||
for (int i = 0; i < numTotalSlots; i++) {
|
||||
auto item = getItem(i);
|
||||
if (item) LOGI("\t %i: %s (%i) %s\n", i, item->getName().c_str(), item->count, (player->inventory->getLinked(i))? "(Linked)" : "");
|
||||
}
|
||||
}
|
||||
|
|
@ -45,6 +45,8 @@ public:
|
|||
int getAttackDamage(Entity* entity);
|
||||
float getDestroySpeed(Tile* tile);
|
||||
bool canDestroy(Tile* tile);
|
||||
|
||||
void print();
|
||||
private:
|
||||
void setupDefault();
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -290,3 +290,7 @@ bool ItemInstance::isArmorItem( const ItemInstance* instance ) {
|
|||
|
||||
return item->isArmor();
|
||||
}
|
||||
|
||||
bool ItemInstance::isBlock(const ItemInstance* instance) {
|
||||
return instance->id < 256;
|
||||
}
|
||||
|
|
@ -81,6 +81,8 @@ public:
|
|||
|
||||
static bool isArmorItem(const ItemInstance* instance);
|
||||
|
||||
static bool isBlock(const ItemInstance* instance);
|
||||
|
||||
/**
|
||||
* Checks if this item is the same item as the other one, disregarding the
|
||||
* 'count' value.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue