Skip to content

Commit

Permalink
feat: restore OreFeature, BlockDescriptor, ReplaceRule member variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lovelylavender4 committed Oct 1, 2024
1 parent 29e881d commit 01d0d22
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/mc/world/level/block/BlockDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ namespace cereal { struct ReflectionCtx; }
// clang-format on

class BlockDescriptor {
public:
char filler[0xB8];

public:
// BlockDescriptor inner types declare
// clang-format off
Expand Down
20 changes: 18 additions & 2 deletions src/mc/world/level/levelgen/feature/OreFeature.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
#pragma once

#include "mc/_HeaderOutputPredefine.h"
#include "mc/world/level/block/Block.h"
#include "mc/world/level/block/BlockLegacy.h"
#include "mc/world/level/levelgen/feature/ReplaceRule.h"

// auto generated inclusion list
#include "mc/world/level/levelgen/feature/IFeature.h"

class OreFeature : public ::IFeature {
public:
int mCount;
float mCountf;
float mCountfInv;
float mDiscardChanceOnAirExposure;
std::vector<ReplaceRule> mReplaceRules;

// Bedrock::Threading::InstancedThreadLocal<OreFeature::Helper, std::allocator<OreFeature::Helper>>;
char mHelper[0xE0 - 48];

public:
// OreFeature inner types declare
// clang-format off
Expand All @@ -14,6 +27,9 @@ class OreFeature : public ::IFeature {

// OreFeature inner types define
class ReplaceRulesAccelerator {
public:
std::vector<std::pair<Block const*, std::vector<BlockLegacy const*>>> mRules;

public:
// prevent constructor by default
ReplaceRulesAccelerator& operator=(ReplaceRulesAccelerator const&);
Expand All @@ -22,7 +38,7 @@ class OreFeature : public ::IFeature {

public:
// NOLINTBEGIN
MCAPI void setRules(std::vector<struct ReplaceRule> const&);
MCAPI void setRules(std::vector<struct ReplaceRule> const& replaceRules);

// NOLINTEND
};
Expand Down Expand Up @@ -50,7 +66,7 @@ class OreFeature : public ::IFeature {

MCAPI OreFeature();

MCAPI OreFeature(int count, std::vector<struct ReplaceRule>&&);
MCAPI OreFeature(int count, std::vector<struct ReplaceRule>&& replaceRules);

// NOLINTEND
};
5 changes: 5 additions & 0 deletions src/mc/world/level/levelgen/feature/ReplaceRule.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#pragma once

#include "mc/_HeaderOutputPredefine.h"
#include "mc/world/level/block/BlockDescriptor.h"

struct ReplaceRule {
public:
BlockDescriptor mBlock;
std::vector<BlockDescriptor> mMayReplace;

public:
// prevent constructor by default
ReplaceRule& operator=(ReplaceRule const&);
Expand Down

0 comments on commit 01d0d22

Please sign in to comment.