LiteLoaderBDS-1.16.40/LiteLoader/include/llapi/mc/Block.hpp
2023-03-03 10:18:21 -08:00

93 lines
3.0 KiB
C++

// This Header is auto generated by BDSLiteLoader Toolchain
#pragma once
#define AUTO_GENERATED
#include "llapi/Global.h"
#define BEFORE_EXTRA
// Add include headers & pre-declares
#include "CompoundTag.hpp"
#include "BlockLegacy.hpp"
#undef BEFORE_EXTRA
class Block {
#define AFTER_EXTRA
// Add new members to class
public:
const unsigned short mData;
WeakPtr<BlockLegacy> mLegacyBlock;
CompoundTag mSerializationId;
unsigned int mRuntimeId;
bool mHasRuntimeId;
LIAPI static Block* create(const string& str, unsigned short tileData);
LIAPI static Block* create(CompoundTag* nbt);
LIAPI string getTypeName() const;
LIAPI int getId() const;
LIAPI unsigned short getTileData();
LIAPI std::unique_ptr<CompoundTag> getNbt();
LIAPI bool setNbt(CompoundTag* nbt);
LIAPI unsigned int const & getRuntimeId() const;
inline bool hasBlockEntity(){
return getLegacyBlock().hasBlockEntity();
}
inline enum BlockActorType getBlockEntityType() const{
return getLegacyBlock().getBlockEntityType();
};
inline bool operator==(class Block const& a2) const {
// __int64 v2; // r8
// __int64 v3; // rax
// v2 = *(__int64*)(this + 16);
// if (!v2 || (v3 = *(__int64*)(&a2 + 16)) == 0)
// return false;
// return v2 == v3 && *(unsigned short*)(this + 8) == *(unsigned short*)(&a2 + 8);
return !(*this != a2);
}
inline bool operator!=(class Block const& a2) const {
// __int64 v2; // r8
// __int64 v3; // rax
//
// v2 = *(__int64*)(this + 16);
// if (!v2 || (v3 = *(__int64*)(&a2 + 16)) == 0)
// return false;
// return v2 != v3 || *(unsigned short*)(this + 8) != *(unsigned short*)(&a2 + 8);
auto& rhs = a2.getLegacyBlock();
if(this->getLegacyBlock() == rhs)
return this->mData != a2.mData;
return true;
}
#undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_BLOCK
public:
class Block& operator=(class Block const &) = delete;
Block(class Block const &) = delete;
Block() = delete;
#endif
public:
/*0*/ virtual ~Block();
/*1*/ virtual enum BlockRenderLayer getRenderLayer() const;
#ifdef ENABLE_VIRTUAL_FAKESYMBOL_BLOCK
#endif
MCAPI class Block const & copyState(class Block const &, class ItemState const &) const;
MCAPI enum CreativeItemCategory getCreativeCategory() const;
MCAPI class BlockLegacy const & getLegacyBlock() const;
MCAPI bool hasState(class ItemState const &) const;
MCAPI bool isSolidBlockingBlock() const;
MCAPI bool isSolidBlockingBlockAndNotSignalSource() const;
MCAPI class Block const & keepState(class ItemState const &) const;
MCAPI void spawnResources(class BlockSource &, class BlockPos const &, std::vector<class Item const *> *, float, int, bool) const;
MCAPI std::string toDebugString() const;
MCAPI static std::string const BLOCK_DESCRIPTION_PREFIX;
//protected:
MCAPI void buildSerializationId(unsigned int);
protected:
};