File BlockLegacy.hpp

Enums

enum BlockSupportType

Values:

enum BlockProperty

Values:

enum FertilizerType

Values:

enumerator Bonemeal
enumerator Rapid
enum Flip

Values:

enum class FlameOdds : char

Values:

enumerator INSTANT
enumerator EASY
enumerator MEDIUM
enumerator HARD
enumerator NEVER
enum class BurnOdds : char

Values:

enumerator INSTANT
enumerator EASY
enumerator MEDIUM
enumerator HARD
enumerator NEVER
class BlockLegacy : public BlockComponentStorage

Subclassed by ActorBlock

Public Functions

virtual ~BlockLegacy()
virtual std::shared_ptr<BlockActor> newBlockEntity(const BlockPos &pos, const Block &block) const
virtual const Block *getNextBlockPermutation(const Block &currentBlock) const
virtual bool shouldConnectToRedstone(BlockSource&, const BlockPos&, Direction::Type) const
virtual HitResult clip(const Block&, const BlockSource&, const BlockPos&, const Vec3&, const Vec3&, ShapeType, optional_ref<const GetCollisionShapeInterface>) const
virtual AABB getCollisionShape(const Block&, const IConstBlockSource&, const BlockPos&, optional_ref<const GetCollisionShapeInterface>) const
virtual bool getCollisionShapeForCamera(AABB&, const Block&, const IConstBlockSource&, const BlockPos&) const
virtual bool addCollisionShapes(const Block&, const IConstBlockSource&, const BlockPos&, const AABB*, std::vector<AABB>&, optional_ref<const GetCollisionShapeInterface>) const
virtual void addAABBs(const Block&, const IConstBlockSource&, const BlockPos&, const AABB*, std::vector<AABB>&) const
virtual const AABB &getOutline(const Block&, const IConstBlockSource&, const BlockPos&, AABB&) const
virtual const AABB &getVisualShapeInWorld(const Block&, const IConstBlockSource&, const BlockPos&, AABB&) const
virtual const AABB &getVisualShape(const Block&, AABB&) const
virtual const AABB &getUIShape(const Block &block, AABB &bufferAABB) const
virtual bool getLiquidClipVolume(const Block&, BlockSource&, const BlockPos&, AABB&) const
virtual bool isObstructingChests(BlockSource &region, const BlockPos &pos, const Block &thisBlock) const
virtual Vec3 randomlyModifyPosition(const BlockPos &pos, int &seed) const
virtual Vec3 randomlyModifyPosition(const BlockPos &pos) const
virtual void onProjectileHit(BlockSource &region, const BlockPos &pos, const Actor &projectile) const
virtual void onLightningHit(BlockSource &region, const BlockPos &pos) const
virtual bool liquidCanFlowIntoFromDirection(unsigned char, std::function<const Block&>(const BlockPos&))
virtual void _unknown_20()
virtual void _unknown_21()
virtual void _unknown_22()
virtual bool canProvideSupport(const Block &block, unsigned char face, BlockSupportType type) const
virtual bool canProvideMultifaceSupport(const Block &block, unsigned char face) const
virtual bool canConnect(const Block &otherBlock, unsigned char toOther, const Block &thisBlock) const
virtual void _unknown_26()
virtual const CopperBehavior *tryGetCopperBehavior() const
virtual void _unknown_28()
virtual void _unknown_29()
virtual void _unknown_30()
virtual bool isContainerBlock() const
virtual void _unknown_32()
virtual bool isWaterBlocking() const
virtual void _unknown_34()
virtual void _unknown_35()
virtual void _unknown_36()
virtual void _unknown_37()
virtual bool isStairBlock() const
virtual bool isSlabBlock() const
virtual bool isDoubleSlabBlock() const
virtual void _unknown_41()
virtual void _unknown_42()
virtual void _unknown_43()
virtual void _unknown_44()
virtual void _unknown_45()
virtual void _unknown_46()
virtual bool isSignalSource() const
virtual bool canBeOriginalSurface() const
virtual void _unknown_49()
virtual bool isValidAuxValue(int value) const
virtual bool canFillAtPos(BlockSource &region, const BlockPos &pos, const Block &block) const
virtual const Block &sanitizeFillBlock(const Block&) const
virtual void onFillBlock(BlockSource &region, const BlockPos &pos, const Block &block) const
virtual int getDirectSignal(BlockSource &region, const BlockPos &pos, int dir) const
virtual void _unknown_55()
virtual void _unknown_56()
virtual bool canContainLiquid() const
virtual std::optional<HashedString> getRequiredMedium() const
virtual void _unknown_59()
virtual void handlePrecipitation(BlockSource &region, const BlockPos &pos, float downfallAmount, float temperature) const
virtual bool canBeUsedInCommands(const BaseGameVersion &baseGameVersion) const
virtual bool checkIsPathable(Actor &entity, const BlockPos &lastPathPos, const BlockPos &pathPos) const
virtual bool shouldDispense(BlockSource &region, Container &container) const
virtual bool dispense(BlockSource &region, Container &container, int slot, const Vec3 &pos, unsigned char face) const
virtual void transformOnFall(BlockSource &region, const BlockPos &pos, Actor *entity, float fallDistance) const
virtual void onRedstoneUpdate(BlockSource &region, const BlockPos &pos, int strength, bool isFirstTime) const
virtual void onMove(BlockSource &region, const BlockPos &from, const BlockPos &to) const
virtual bool detachesOnPistonMove(BlockSource&, BlockPos const&) const
virtual void movedByPiston(BlockSource &region, const BlockPos &pos) const
virtual void onStructureBlockPlace(BlockSource &region, const BlockPos &pos) const
virtual void onStructureNeighborBlockPlace(BlockSource &region, const BlockPos &pos) const
virtual void setupRedstoneComponent(BlockSource &region, const BlockPos &pos) const
virtual BlockProperty getRedstoneProperty(BlockSource &region, const BlockPos &pos) const
virtual void updateEntityAfterFallOn(const BlockPos &pos, UpdateEntityAfterFallOnInterface &entity) const
virtual void _unknown_75()
virtual bool isPreservingMediumWhenPlaced(const BlockLegacy *medium) const
virtual bool isFilteredOut(BlockRenderLayer heldItemRenderLayer) const
virtual bool canRenderSelectionOverlay(BlockRenderLayer) const
virtual bool ignoreEntitiesOnPistonMove(const Block &block) const
virtual bool onFertilized(BlockSource &region, const BlockPos &pos, Actor *actor, FertilizerType fType) const
virtual bool mayConsumeFertilizer(BlockSource &region) const
virtual bool canBeFertilized(BlockSource &region, const BlockPos &pos, const Block &aboveBlock) const
virtual bool mayPick() const
virtual bool mayPick(const BlockSource &region, const Block &block, bool liquid) const
virtual bool mayPlace(BlockSource &region, const BlockPos &pos, unsigned char face) const
virtual bool mayPlace(BlockSource &region, const BlockPos &pos) const
virtual bool mayPlaceOn(BlockSource &region, const BlockPos &pos) const
virtual bool tryToPlace(BlockSource &region, const BlockPos &pos, const Block &block, const ActorBlockSyncMessage *syncMsg) const
virtual bool tryToTill(BlockSource &region, const BlockPos &pos, Actor &entity, ItemStack &item) const
virtual bool breaksFallingBlocks(const Block &block, BaseGameVersion version) const
virtual void destroy(BlockSource &region, const BlockPos &pos, const Block &block, Actor *entitySource) const
virtual bool getIgnoresDestroyPermissions(Actor &entity, const BlockPos &pos) const
virtual void neighborChanged(BlockSource &region, const BlockPos &pos, const BlockPos &neighborPos) const
virtual bool getSecondPart(const IConstBlockSource&, const BlockPos&, BlockPos&) const
virtual const Block *playerWillDestroy(Player &player, const BlockPos &pos, const Block &block) const
virtual ItemInstance asItemInstance(const Block &block, const BlockActor *a4) const
virtual void spawnAfterBreak(BlockSource&, const Block&, const BlockPos&, const ResourceDropsContext&) const
virtual const Block &getPlacementBlock(const Actor&, const BlockPos&, unsigned char, const Vec3&, int) const
virtual int calcVariant(BlockSource &region, const BlockPos &pos, const mce::Color &baseColor) const
virtual bool isAttachedTo(BlockSource &region, const BlockPos &pos, BlockPos &outAttachedTo) const
virtual bool attack(Player *player, const BlockPos &pos) const
virtual bool shouldTriggerEntityInside(BlockSource &region, const BlockPos &pos, Actor &entity) const
virtual bool canBeBuiltOver(BlockSource &region, const BlockPos &pos, const BlockItem &newItem) const
virtual bool canBeBuiltOver(BlockSource &region, const BlockPos &pos) const
virtual void triggerEvent(BlockSource &region, const BlockPos &pos, int b0, int b1) const
virtual void executeEvent(BlockSource &region, const BlockPos &pos, const Block &block, const std::string &eventName, Actor &sourceEntity) const
virtual const MobSpawnerData *getMobToSpawn(const SpawnConditions &conditions, BlockSource &region) const
virtual bool shouldStopFalling(Actor &entity) const
virtual void _unknown_109()
virtual void _unknown_110()
virtual bool hasComparatorSignal() const
virtual int getComparatorSignal(BlockSource &region, const BlockPos &pos, const Block &block, unsigned char dir) const
virtual bool canSlide(BlockSource &region, const BlockPos &pos) const
virtual void _unknown_114()
virtual bool canSpawnAt(const BlockSource &region, const BlockPos &pos) const
virtual void notifySpawnedAt(BlockSource &region, const BlockPos &pos) const
virtual void _unknown_117()
virtual int getIconYOffset() const
virtual std::string buildDescriptionId(const Block&) const
virtual bool isAuxValueRelevantForPicking() const
virtual int getColor(const Block &block) const
virtual int getColor(BlockSource &region, const BlockPos &pos, const Block &block) const
virtual int getColorAtPos(BlockSource &region, const BlockPos &pos) const
virtual int getColorForParticle(BlockSource &region, const BlockPos &pos, const Block &block) const
virtual bool isSeasonTinted(const Block &block, BlockSource &region, const BlockPos &p) const
virtual void onGraphicsModeChanged(const BlockGraphicsModeChangeContext &context)
virtual float getShadeBrightness(const Block &block) const
virtual int telemetryVariant(BlockSource &region, const BlockPos &pos) const
virtual int getVariant(const Block &block) const
virtual bool canSpawnOn(Actor *a2) const
virtual const Block &getRenderBlock() const
virtual unsigned char getMappedFace(unsigned char face, const Block &block) const
virtual Flip getFaceFlip(unsigned char face, const Block &block) const
virtual void animateTickBedrockLegacy(BlockSource&, const BlockPos&, Random&) const
virtual void animateTick(BlockSource &region, const BlockPos &pos, Random &random) const
virtual BlockLegacy &init()
virtual const Block *tryLegacyUpgrade(unsigned short a2) const
virtual bool dealsContactDamage(const Actor &actor, const Block &block, bool isPathFinding) const
virtual const Block *tryGetInfested(const Block &a2) const
virtual const Block *tryGetUninfested(const Block &a2) const
virtual void _addHardCodedBlockComponents(const Experiments&)
BlockLegacy(const std::string &nameId, short id, const Material &material)
short getBlockItemId()
void setDestroyTime(float destroyTime, float explosionResistance)
void addState(const BlockState &blockState)

Public Members

std::string mDescriptionId
BlockLegacy::NameInfo mNameInfo
std::byte padding248[20]
BlockActorType mBlockEntityType
std::byte padding272[24]
const Material &mMaterial
std::byte padding304[69]
unsigned char mLightBlock
unsigned char mLightEmission
std::byte padding375[13]
float mDestroySpeed
float mExplosionResistance
mce::Color mMapColor
std::byte padding412[10]
unsigned short mID
BaseGameVersion mMinRequiredBaseGameVersion
bool mIsVanilla
std::byte padding545[135]
std::map<uint64_t, BlockStateInstance> mStates
std::unordered_map<HashedString, uint64_t> mStateNameMap
uint64_t mCreativeEnumState
std::vector<std::unique_ptr<Block>> mBlockPermutations
std::byte padding792[160]
std::vector<std::shared_ptr<BlockLegacy::AlteredStateCollection>> mAlteredStateCollections
std::byte padding976[8]

Protected Functions

virtual Brightness getLightEmission(const Block &a2) const
virtual void onRemove(BlockSource &region, const BlockPos &pos) const
virtual void onExploded(BlockSource &region, const BlockPos &pos, Actor *entitySource) const
virtual void onStandOn(EntityContext &entity, const BlockPos &pos) const
virtual void onPlace(BlockSource &region, const BlockPos &pos) const
virtual void _unknown_147()
virtual void tick(BlockSource &region, const BlockPos &pos, Random &random) const
virtual void randomTick(BlockSource &region, const BlockPos &pos, Random &random) const
virtual bool isInteractive() const
virtual bool use(Player&, const BlockPos&, unsigned char, std::optional<Vec3>) const
virtual bool use(Player &player, const BlockPos &pos, unsigned char face) const
virtual void _unknown_153()
virtual bool canSurvive(BlockSource &region, const BlockPos &pos) const
virtual BlockRenderLayer getRenderLayer() const
virtual BlockRenderLayer getRenderLayer(const Block &block, BlockSource &a3, const BlockPos &pos) const
virtual int getExtraRenderLayers() const
virtual Brightness getLight(const Block&) const
virtual Brightness getEmissiveBrightness(const Block &a2) const
virtual mce::Color getMapColor(BlockSource &a2, const BlockPos &a3, const Block &a4) const

Private Functions

virtual void _onHitByActivatingAttack(BlockSource&, const BlockPos&, Actor*) const
virtual void entityInside(BlockSource &a2, const BlockPos &a3, Actor &a4) const
std::optional<int> _tryLookupAlteredStateCollection(uint64_t stateId, uint16_t blockData)

Friends

friend class Block
class AlteredStateCollection

Public Functions

virtual std::optional<int> getState(const BlockLegacy &blockLegacy, int blockData) const = 0
virtual const Block *setState(const BlockLegacy&, int, int) const = 0
virtual ~AlteredStateCollection() = default

Public Members

std::reference_wrapper<const BlockState> mBlockState
struct NameInfo

Public Members

HashedString mRawName
std::string mNamespaceName
HashedString mFullName
HashedString mPreFlatteningName
namespace Direction