mirror of
https://github.com/quizhizhe/LiteLoaderBDS-1.16.40.git
synced 2025-06-03 04:23:39 +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{
|
inline AutomaticID<class Dimension, int> getDimensionId() const{
|
||||||
//Dimension::onBlockEvent Line24
|
//Dimension::onBlockEvent Line24
|
||||||
// Dimension* mDimension = dAccess< Dimension*>(this, 4);
|
// 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{
|
inline LevelChunk * getChunkAt(const BlockPos& pos) const{
|
||||||
ChunkPos chunkPos = ChunkPos(pos.x>>4, pos.z>>4);
|
ChunkPos chunkPos = ChunkPos(pos.x>>4, pos.z>>4);
|
||||||
|
@ -4,7 +4,16 @@
|
|||||||
#include "../Global.h"
|
#include "../Global.h"
|
||||||
|
|
||||||
#define BEFORE_EXTRA
|
#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
|
#undef BEFORE_EXTRA
|
||||||
|
|
||||||
class Dimension {
|
class Dimension {
|
||||||
@ -23,6 +32,14 @@ public:
|
|||||||
//Player::checkSpawnBlock Line19
|
//Player::checkSpawnBlock Line19
|
||||||
return dAccess<AutomaticID<Dimension,int>>(this,192);
|
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
|
#undef AFTER_EXTRA
|
||||||
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_DIMENSION
|
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_DIMENSION
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user