mirror of
https://github.com/celisej567/mcpe.git
synced 2026-01-03 05:49:04 +03:00
* * Turn survival back on for now. * * Add TP command. * * Fix fall damage reset. * * Mob hitting works. I've disabled entity shading though. Will get back to it at some point, promise! * * Knockback * * Mobs now rotate when they die. * * Fire fix
75 lines
1.7 KiB
C++
75 lines
1.7 KiB
C++
/********************************************************************
|
|
Minecraft: Pocket Edition - Decompilation Project
|
|
Copyright (C) 2023 iProgramInCpp
|
|
|
|
The following code is licensed under the BSD 1 clause license.
|
|
SPDX-License-Identifier: BSD-1-Clause
|
|
********************************************************************/
|
|
|
|
#pragma once
|
|
|
|
#include "common/Utils.hpp"
|
|
#include "Item.hpp"
|
|
|
|
class Item; // in case we're included from Item.hpp
|
|
class Tile;
|
|
class Level;
|
|
class Entity;
|
|
class Mob;
|
|
class Player;
|
|
|
|
class ItemInstance
|
|
{
|
|
public:
|
|
ItemInstance();
|
|
ItemInstance(Item*);
|
|
ItemInstance(Item*, int amount);
|
|
ItemInstance(Item*, int amount, int auxValue);
|
|
ItemInstance(Tile*);
|
|
ItemInstance(Tile*, int amount);
|
|
ItemInstance(Tile*, int amount, int auxValue);
|
|
ItemInstance(int itemID, int amount, int auxValue);
|
|
|
|
void init(int itemID, int amount, int auxValue);
|
|
|
|
int getAuxValue();
|
|
int getDamageValue();
|
|
|
|
bool canDestroySpecial(Tile*);
|
|
std::string getDescriptionId();
|
|
float getDestroySpeed(Tile*);
|
|
int getIcon();
|
|
int getMaxDamage();
|
|
int getMaxStackSize();
|
|
void hurt(int by);
|
|
void hurtEnemy(Mob*);
|
|
void interactEnemy(Mob*);
|
|
bool isDamageableItem();
|
|
bool isDamaged();
|
|
bool isStackable();
|
|
bool isStackedByData();
|
|
bool matches(ItemInstance*) const;
|
|
void mineBlock(int, int, int, int);
|
|
ItemInstance remove(int amt);
|
|
void setDescriptionId(const std::string&);
|
|
void snap(Player*);
|
|
std::string toString();
|
|
ItemInstance* use(Level*, Player*);
|
|
bool useOn(Player*, Level*, int x, int y, int z, int dir);
|
|
|
|
Item* getItem();
|
|
ItemInstance* copy();
|
|
|
|
static bool matches(ItemInstance*, ItemInstance*);
|
|
|
|
// v0.2.0
|
|
int getAttackDamage(Entity *pEnt);
|
|
|
|
public:
|
|
int m_auxValue;
|
|
int m_amount;
|
|
int m_field_8;
|
|
int m_itemID;
|
|
};
|
|
|