mirror of
https://github.com/quizhizhe/LiteLoaderBDS-1.16.40.git
synced 2025-06-01 19:53:41 +00:00
Fix BlockSource::getDimensionId
This commit is contained in:
parent
7332bc36c7
commit
4ee7f71968
@ -27,7 +27,7 @@ public:
|
||||
inline AutomaticID<class Dimension, int> getDimensionId() const{
|
||||
//Dimension::onBlockEvent Line24
|
||||
// Dimension* mDimension = dAccess< Dimension*>(this, 4);
|
||||
return dAccess<AutomaticID<class Dimension, int>>(getDimension(), 192);
|
||||
return this->getDimension()->getDimensionId();
|
||||
};
|
||||
inline LevelChunk * getChunkAt(const BlockPos& pos) const{
|
||||
ChunkPos chunkPos = ChunkPos(pos.x>>4, pos.z>>4);
|
||||
|
@ -4,7 +4,16 @@
|
||||
#include "../Global.h"
|
||||
|
||||
#define BEFORE_EXTRA
|
||||
#include "MC/BlockSource.hpp"
|
||||
class BlockSource;
|
||||
|
||||
class DimensionHeightRange
|
||||
{
|
||||
public:
|
||||
short min = 0;
|
||||
short max;
|
||||
|
||||
DimensionHeightRange(short a):max(a){};
|
||||
};
|
||||
#undef BEFORE_EXTRA
|
||||
|
||||
class Dimension {
|
||||
@ -23,6 +32,14 @@ public:
|
||||
//Player::checkSpawnBlock Line19
|
||||
return dAccess<AutomaticID<Dimension,int>>(this,192);
|
||||
};
|
||||
inline DimensionHeightRange const & getHeightRange() const{
|
||||
// 0为主世界,1为下界,2为末地
|
||||
if(this->getDimensionId() == 2 || this->getDimensionId() == 0)
|
||||
return DimensionHeightRange(255);
|
||||
else if(this->getDimensionId() == 1)
|
||||
return DimensionHeightRange(127);
|
||||
return DimensionHeightRange(0);
|
||||
};
|
||||
#undef AFTER_EXTRA
|
||||
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_DIMENSION
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user