Skip to content

Commit

Permalink
fix: fix Dimension and Generator of vtable and size
Browse files Browse the repository at this point in the history
  • Loading branch information
quizhizhe committed Feb 12, 2024
1 parent a21b7a5 commit 5e5e79b
Show file tree
Hide file tree
Showing 9 changed files with 432 additions and 199 deletions.
327 changes: 232 additions & 95 deletions src/mc/world/level/dimension/Dimension.h

Large diffs are not rendered by default.

19 changes: 14 additions & 5 deletions src/mc/world/level/dimension/IDimension.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,29 @@ class IDimension {
// vIndex: 0, symbol: ??1IDimension@@UEAA@XZ
virtual ~IDimension();

// vIndex: 0, symbol: ?isNaturalDimension@Dimension@@UEBA_NXZ
// vIndex: 1
virtual bool isNaturalDimension() const = 0;

// vIndex: 1, symbol: ?getDimensionId@Dimension@@UEBA?AV?$AutomaticID@VDimension@@H@@XZ
// vIndex: 2
virtual DimensionType getDimensionId() const = 0;

// vIndex: 2, symbol: ?sendPacketForPosition@Dimension@@UEAAXAEBVBlockPos@@AEBVPacket@@PEBVPlayer@@@Z
// vIndex: 3
virtual void sendPacketForPosition(class BlockPos const&, class Packet const&, class Player const*) = 0;

// vIndex: 3, symbol: ?flushLevelChunkGarbageCollector@Dimension@@UEAAXXZ
// vIndex: 4
virtual void flushLevelChunkGarbageCollector() = 0;

// vIndex: 4, symbol: ?initializeWithLevelStorageManager@Dimension@@UEAAXAEAVLevelStorageManager@@@Z
// vIndex: 5
virtual void initializeWithLevelStorageManager(class LevelStorageManager&) = 0;

// vIndex: 6
virtual class BiomeRegistry& getBiomeRegistry() = 0;

// vIndex: 7
virtual class BiomeRegistry const& getBiomeRegistry() const = 0;

// vIndex: 8
virtual class Vec3 translatePosAcrossDimension(class Vec3 const&, DimensionType) const = 0;

// NOLINTEND
};
32 changes: 16 additions & 16 deletions src/mc/world/level/dimension/NetherDimension.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,57 +23,57 @@ class NetherDimension : public ::Dimension {
public:
// NOLINTBEGIN
// symbol: ?_upgradeOldLimboEntity@NetherDimension@@EEAAXAEAVCompoundTag@@W4LimboEntitiesVersion@@@Z
MCVAPI void _upgradeOldLimboEntity(class CompoundTag& tag, ::LimboEntitiesVersion vers);
virtual void _upgradeOldLimboEntity(class CompoundTag& tag, ::LimboEntitiesVersion vers);

// symbol:
// ?_wrapStorageForVersionCompatibility@NetherDimension@@EEAA?AV?$unique_ptr@VChunkSource@@U?$default_delete@VChunkSource@@@std@@@std@@V23@W4StorageVersion@@@Z
MCVAPI std::unique_ptr<class ChunkSource> _wrapStorageForVersionCompatibility(
virtual std::unique_ptr<class ChunkSource> _wrapStorageForVersionCompatibility(
std::unique_ptr<class ChunkSource> storageSource,
::StorageVersion levelVersion
);

// symbol:
// ?createGenerator@NetherDimension@@UEAA?AV?$unique_ptr@VWorldGenerator@@U?$default_delete@VWorldGenerator@@@std@@@std@@AEBVStructureSetRegistry@worldgen@br@@@Z
MCVAPI std::unique_ptr<class WorldGenerator> createGenerator(class br::worldgen::StructureSetRegistry const&);
virtual std::unique_ptr<class WorldGenerator> createGenerator(class br::worldgen::StructureSetRegistry const&);

// symbol: ?fixWallChunk@NetherDimension@@UEAAXAEAVChunkSource@@AEAVLevelChunk@@@Z
MCVAPI void fixWallChunk(class ChunkSource& source, class LevelChunk& lc);
virtual void fixWallChunk(class ChunkSource& source, class LevelChunk& lc);

// symbol: ?forceCheckAllNeighChunkSavedStat@NetherDimension@@UEBA_NXZ
MCVAPI bool forceCheckAllNeighChunkSavedStat() const;
virtual bool forceCheckAllNeighChunkSavedStat() const;

// symbol: ?getDefaultBiome@NetherDimension@@UEBA?AVHashedString@@XZ
MCVAPI class HashedString getDefaultBiome() const;
virtual class HashedString getDefaultBiome() const;

// symbol: ?getTimeOfDay@NetherDimension@@UEBAMHM@Z
MCVAPI float getTimeOfDay(int time, float a) const;
virtual float getTimeOfDay(int time, float a) const;

// symbol: ?init@NetherDimension@@UEAAXAEBVStructureSetRegistry@worldgen@br@@@Z
MCVAPI void init(class br::worldgen::StructureSetRegistry const&);
virtual void init(class br::worldgen::StructureSetRegistry const&);

// symbol: ?isFoggyAt@NetherDimension@@UEBA_NHH@Z
MCVAPI bool isFoggyAt(int x, int z) const;
virtual bool isFoggyAt(int x, int z) const;

// symbol: ?isNaturalDimension@NetherDimension@@UEBA_NXZ
MCVAPI bool isNaturalDimension() const;
virtual bool isNaturalDimension() const;

// symbol: ?isValidSpawn@NetherDimension@@UEBA_NHH@Z
MCVAPI bool isValidSpawn(int x, int z) const;
virtual bool isValidSpawn(int x, int z) const;

// symbol: ?levelChunkNeedsUpgrade@NetherDimension@@UEBA_NAEBVLevelChunk@@@Z
MCVAPI bool levelChunkNeedsUpgrade(class LevelChunk const& lc) const;
virtual bool levelChunkNeedsUpgrade(class LevelChunk const& lc) const;

// symbol: ?mayRespawnViaBed@NetherDimension@@UEBA_NXZ
MCVAPI bool mayRespawnViaBed() const;
virtual bool mayRespawnViaBed() const;

// symbol: ?showSky@NetherDimension@@UEBA_NXZ
MCVAPI bool showSky() const;
virtual bool showSky() const;

// symbol: ?translatePosAcrossDimension@NetherDimension@@UEBA?AVVec3@@AEBV2@V?$AutomaticID@VDimension@@H@@@Z
MCVAPI class Vec3 translatePosAcrossDimension(class Vec3 const& originalPos, DimensionType fromId) const;
virtual class Vec3 translatePosAcrossDimension(class Vec3 const& originalPos, DimensionType fromId) const;

// symbol: ?upgradeLevelChunk@NetherDimension@@UEAAXAEAVChunkSource@@AEAVLevelChunk@@1@Z
MCVAPI void upgradeLevelChunk(class ChunkSource& source, class LevelChunk& lc, class LevelChunk& generatedChunk);
virtual void upgradeLevelChunk(class ChunkSource& source, class LevelChunk& lc, class LevelChunk& generatedChunk);

// symbol: ??0NetherDimension@@QEAA@AEAVILevel@@AEAVScheduler@@@Z
MCAPI NetherDimension(class ILevel& level, class Scheduler& callbackContext);
Expand Down
20 changes: 10 additions & 10 deletions src/mc/world/level/dimension/OverworldDimension.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,39 @@ class OverworldDimension : public ::Dimension {
public:
// NOLINTBEGIN
// symbol: ?_upgradeOldLimboEntity@OverworldDimension@@EEAAXAEAVCompoundTag@@W4LimboEntitiesVersion@@@Z
MCVAPI void _upgradeOldLimboEntity(class CompoundTag& tag, ::LimboEntitiesVersion vers);
virtual void _upgradeOldLimboEntity(class CompoundTag& tag, ::LimboEntitiesVersion vers);

// symbol:
// ?_wrapStorageForVersionCompatibility@OverworldDimension@@EEAA?AV?$unique_ptr@VChunkSource@@U?$default_delete@VChunkSource@@@std@@@std@@V23@W4StorageVersion@@@Z
MCVAPI std::unique_ptr<class ChunkSource> _wrapStorageForVersionCompatibility(
virtual std::unique_ptr<class ChunkSource> _wrapStorageForVersionCompatibility(
std::unique_ptr<class ChunkSource> storageSource,
::StorageVersion levelVersion
);

// symbol:
// ?createGenerator@OverworldDimension@@UEAA?AV?$unique_ptr@VWorldGenerator@@U?$default_delete@VWorldGenerator@@@std@@@std@@AEBVStructureSetRegistry@worldgen@br@@@Z
MCVAPI std::unique_ptr<class WorldGenerator> createGenerator(class br::worldgen::StructureSetRegistry const&);
virtual std::unique_ptr<class WorldGenerator> createGenerator(class br::worldgen::StructureSetRegistry const&);

// symbol: ?fixWallChunk@OverworldDimension@@UEAAXAEAVChunkSource@@AEAVLevelChunk@@@Z
MCVAPI void fixWallChunk(class ChunkSource& source, class LevelChunk& lc);
virtual void fixWallChunk(class ChunkSource& source, class LevelChunk& lc);

// symbol: ?getBrightnessDependentFogColor@OverworldDimension@@UEBA?AVColor@mce@@AEBV23@M@Z
MCVAPI class mce::Color getBrightnessDependentFogColor(class mce::Color const& baseColor, float brightness) const;
virtual class mce::Color getBrightnessDependentFogColor(class mce::Color const& baseColor, float brightness) const;

// symbol: ?getCloudHeight@OverworldDimension@@UEBAFXZ
MCVAPI short getCloudHeight() const;
virtual short getCloudHeight() const;

// symbol: ?hasPrecipitationFog@OverworldDimension@@UEBA_NXZ
MCVAPI bool hasPrecipitationFog() const;
virtual bool hasPrecipitationFog() const;

// symbol: ?levelChunkNeedsUpgrade@OverworldDimension@@UEBA_NAEBVLevelChunk@@@Z
MCVAPI bool levelChunkNeedsUpgrade(class LevelChunk const& lc) const;
virtual bool levelChunkNeedsUpgrade(class LevelChunk const& lc) const;

// symbol: ?translatePosAcrossDimension@OverworldDimension@@UEBA?AVVec3@@AEBV2@V?$AutomaticID@VDimension@@H@@@Z
MCVAPI class Vec3 translatePosAcrossDimension(class Vec3 const& originalPos, DimensionType fromId) const;
virtual class Vec3 translatePosAcrossDimension(class Vec3 const& originalPos, DimensionType fromId) const;

// symbol: ?upgradeLevelChunk@OverworldDimension@@UEAAXAEAVChunkSource@@AEAVLevelChunk@@1@Z
MCVAPI void upgradeLevelChunk(class ChunkSource& source, class LevelChunk& lc, class LevelChunk& generatedChunk);
virtual void upgradeLevelChunk(class ChunkSource& source, class LevelChunk& lc, class LevelChunk& generatedChunk);

// NOLINTEND
};
51 changes: 27 additions & 24 deletions src/mc/world/level/dimension/end/TheEndDimension.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
namespace br::worldgen { class StructureSetRegistry; }
// clang-format on

class EndDragonFight;

class TheEndDimension : public ::Dimension {
public:
std::unique_ptr<EndDragonFight> mDragonFight;
// prevent constructor by default
TheEndDimension& operator=(TheEndDimension const&);
TheEndDimension(TheEndDimension const&);
Expand All @@ -23,81 +26,81 @@ class TheEndDimension : public ::Dimension {
public:
// NOLINTBEGIN
// symbol: ?_upgradeOldLimboEntity@TheEndDimension@@EEAAXAEAVCompoundTag@@W4LimboEntitiesVersion@@@Z
MCVAPI void _upgradeOldLimboEntity(class CompoundTag& tag, ::LimboEntitiesVersion vers);
virtual void _upgradeOldLimboEntity(class CompoundTag& tag, ::LimboEntitiesVersion vers);

// symbol:
// ?_wrapStorageForVersionCompatibility@TheEndDimension@@EEAA?AV?$unique_ptr@VChunkSource@@U?$default_delete@VChunkSource@@@std@@@std@@V23@W4StorageVersion@@@Z
MCVAPI std::unique_ptr<class ChunkSource> _wrapStorageForVersionCompatibility(
virtual std::unique_ptr<class ChunkSource> _wrapStorageForVersionCompatibility(
std::unique_ptr<class ChunkSource> storageSource,
::StorageVersion levelVersion
);

// symbol:
// ?createGenerator@TheEndDimension@@UEAA?AV?$unique_ptr@VWorldGenerator@@U?$default_delete@VWorldGenerator@@@std@@@std@@AEBVStructureSetRegistry@worldgen@br@@@Z
MCVAPI std::unique_ptr<class WorldGenerator> createGenerator(class br::worldgen::StructureSetRegistry const&);
virtual std::unique_ptr<class WorldGenerator> createGenerator(class br::worldgen::StructureSetRegistry const&);

// symbol: ?deserialize@TheEndDimension@@UEAAXAEBVCompoundTag@@@Z
MCVAPI void deserialize(class CompoundTag const& tag);
virtual void deserialize(class CompoundTag const& tag);

// symbol: ?fixWallChunk@TheEndDimension@@UEAAXAEAVChunkSource@@AEAVLevelChunk@@@Z
MCVAPI void fixWallChunk(class ChunkSource& source, class LevelChunk& lc);
virtual void fixWallChunk(class ChunkSource& source, class LevelChunk& lc);

// symbol: ?getCloudHeight@TheEndDimension@@UEBAFXZ
MCVAPI short getCloudHeight() const;
virtual short getCloudHeight() const;

// symbol: ?getDefaultBiome@TheEndDimension@@UEBA?AVHashedString@@XZ
MCVAPI class HashedString getDefaultBiome() const;
virtual class HashedString getDefaultBiome() const;

// symbol: ?getSpawnPos@TheEndDimension@@UEBA?AVBlockPos@@XZ
MCVAPI class BlockPos getSpawnPos() const;
virtual class BlockPos getSpawnPos() const;

// symbol: ?getSpawnYPosition@TheEndDimension@@UEBAHXZ
MCVAPI int getSpawnYPosition() const;
virtual int getSpawnYPosition() const;

// symbol: ?getSunIntensity@TheEndDimension@@UEBAMMAEBVVec3@@M@Z
MCVAPI float getSunIntensity(float a, class Vec3 const& viewVector, float minInfluenceAngle) const;
virtual float getSunIntensity(float a, class Vec3 const& viewVector, float minInfluenceAngle) const;

// symbol: ?getTimeOfDay@TheEndDimension@@UEBAMHM@Z
MCVAPI float getTimeOfDay(int time, float a) const;
virtual float getTimeOfDay(int time, float a) const;

// symbol: ?hasGround@TheEndDimension@@UEBA_NXZ
MCVAPI bool hasGround() const;
virtual bool hasGround() const;

// symbol: ?init@TheEndDimension@@UEAAXAEBVStructureSetRegistry@worldgen@br@@@Z
MCVAPI void init(class br::worldgen::StructureSetRegistry const&);
virtual void init(class br::worldgen::StructureSetRegistry const&);

// symbol: ?isDay@TheEndDimension@@UEBA_NXZ
MCVAPI bool isDay() const;
virtual bool isDay() const;

// symbol: ?isFoggyAt@TheEndDimension@@UEBA_NHH@Z
MCVAPI bool isFoggyAt(int x, int z) const;
virtual bool isFoggyAt(int x, int z) const;

// symbol: ?isNaturalDimension@TheEndDimension@@UEBA_NXZ
MCVAPI bool isNaturalDimension() const;
virtual bool isNaturalDimension() const;

// symbol: ?isValidSpawn@TheEndDimension@@UEBA_NHH@Z
MCVAPI bool isValidSpawn(int x, int z) const;
virtual bool isValidSpawn(int x, int z) const;

// symbol: ?levelChunkNeedsUpgrade@TheEndDimension@@UEBA_NAEBVLevelChunk@@@Z
MCVAPI bool levelChunkNeedsUpgrade(class LevelChunk const& lc) const;
virtual bool levelChunkNeedsUpgrade(class LevelChunk const& lc) const;

// symbol: ?mayRespawnViaBed@TheEndDimension@@UEBA_NXZ
MCVAPI bool mayRespawnViaBed() const;
virtual bool mayRespawnViaBed() const;

// symbol: ?serialize@TheEndDimension@@UEBAXAEAVCompoundTag@@@Z
MCVAPI void serialize(class CompoundTag& tag) const;
virtual void serialize(class CompoundTag& tag) const;

// symbol: ?startLeaveGame@TheEndDimension@@UEAAXXZ
MCVAPI void startLeaveGame();
virtual void startLeaveGame();

// symbol: ?tick@TheEndDimension@@UEAAXXZ
MCVAPI void tick();
virtual void tick();

// symbol: ?translatePosAcrossDimension@TheEndDimension@@UEBA?AVVec3@@AEBV2@V?$AutomaticID@VDimension@@H@@@Z
MCVAPI class Vec3 translatePosAcrossDimension(class Vec3 const& originalPos, DimensionType fromId) const;
virtual class Vec3 translatePosAcrossDimension(class Vec3 const& originalPos, DimensionType fromId) const;

// symbol: ?upgradeLevelChunk@TheEndDimension@@UEAAXAEAVChunkSource@@AEAVLevelChunk@@1@Z
MCVAPI void upgradeLevelChunk(class ChunkSource& source, class LevelChunk& lc, class LevelChunk& generatedChunk);
virtual void upgradeLevelChunk(class ChunkSource& source, class LevelChunk& lc, class LevelChunk& generatedChunk);

// symbol: ?AMBIENT_MULTIPLIER@TheEndDimension@@2MB
MCAPI static float const AMBIENT_MULTIPLIER;
Expand Down
12 changes: 6 additions & 6 deletions src/mc/world/level/levelgen/VoidGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ class VoidGenerator : public ::WorldGenerator {
class Random& random
) const;

// vIndex: 42, symbol: ?findSpawnPosition@VoidGenerator@@UEBA?AVBlockPos@@XZ
// vIndex: 43, symbol: ?findSpawnPosition@VoidGenerator@@UEBA?AVBlockPos@@XZ
virtual class BlockPos findSpawnPosition() const;

// vIndex: 39, symbol: ?getBiomeArea@VoidGenerator@@UEBA?AVBiomeArea@@AEBVBoundingBox@@I@Z
// vIndex: 40, symbol: ?getBiomeArea@VoidGenerator@@UEBA?AVBiomeArea@@AEBVBoundingBox@@I@Z
virtual class BiomeArea getBiomeArea(class BoundingBox const& area, uint scale) const;

// vIndex: 40, symbol: ?getBiomeSource@VoidGenerator@@UEBAAEBVBiomeSource@@XZ
// vIndex: 41, symbol: ?getBiomeSource@VoidGenerator@@UEBAAEBVBiomeSource@@XZ
virtual class BiomeSource const& getBiomeSource() const;

// vIndex: 41, symbol: ?getBlockVolumeDimensions@VoidGenerator@@UEBA?AUBlockVolumeDimensions@WorldGenerator@@XZ
// vIndex: 42, symbol: ?getBlockVolumeDimensions@VoidGenerator@@UEBA?AUBlockVolumeDimensions@WorldGenerator@@XZ
virtual struct WorldGenerator::BlockVolumeDimensions getBlockVolumeDimensions() const;

// vIndex: 11, symbol: ?loadChunk@VoidGenerator@@UEAAXAEAVLevelChunk@@_N@Z
Expand All @@ -65,7 +65,7 @@ class VoidGenerator : public ::WorldGenerator {
// vIndex: 9, symbol: ?postProcess@VoidGenerator@@UEAA_NAEAVChunkViewSource@@@Z
virtual bool postProcess(class ChunkViewSource& neighborhood);

// vIndex: 38, symbol:
// vIndex: 39, symbol:
// ?prepareAndComputeHeights@VoidGenerator@@UEAAXAEAVBlockVolume@@AEBVChunkPos@@AEAV?$vector@FV?$allocator@F@std@@@std@@_NH@Z
virtual void prepareAndComputeHeights(
class BlockVolume& box,
Expand All @@ -75,7 +75,7 @@ class VoidGenerator : public ::WorldGenerator {
int skipTopN
);

// vIndex: 37, symbol: ?prepareHeights@VoidGenerator@@UEAAXAEAVBlockVolume@@AEBVChunkPos@@_N@Z
// vIndex: 38, symbol: ?prepareHeights@VoidGenerator@@UEAAXAEAVBlockVolume@@AEBVChunkPos@@_N@Z
virtual void prepareHeights(class BlockVolume& box, class ChunkPos const& chunkPos, bool factorInBeardsAndShavers);

// symbol: ??0VoidGenerator@@QEAA@AEAVDimension@@@Z
Expand Down
Loading

0 comments on commit 5e5e79b

Please sign in to comment.