feat: new chunk load toggle
also fixes item frames / paintings in dlc worlds
This commit is contained in:
@@ -16,6 +16,7 @@ void HangingEntity::_init(Level *level)
|
||||
xTile = yTile = zTile = 0;
|
||||
this->heightOffset = 0;
|
||||
this->setSize(0.5f, 0.5f);
|
||||
placedByTutorial = false;
|
||||
}
|
||||
|
||||
HangingEntity::HangingEntity(Level *level) : Entity( level )
|
||||
@@ -69,7 +70,7 @@ void HangingEntity::setDir(int dir)
|
||||
int offset = 0;
|
||||
|
||||
// set offset to 1 if placed in stock world
|
||||
if (level->isClientSide && !placedByPlayer)
|
||||
if (level->isClientSide && placedByTutorial)
|
||||
{
|
||||
offset = 1;
|
||||
}
|
||||
@@ -262,6 +263,7 @@ void HangingEntity::push(double xa, double ya, double za)
|
||||
void HangingEntity::addAdditonalSaveData(CompoundTag *tag)
|
||||
{
|
||||
tag->putByte(L"PlacedByPlayer", placedByPlayer ? 1 : 0);
|
||||
tag->putByte(L"PlacedByTutorial", placedByTutorial ? 1 : 0);
|
||||
tag->putByte(L"Direction", static_cast<byte>(dir));
|
||||
tag->putInt(L"TileX", xTile);
|
||||
tag->putInt(L"TileY", yTile);
|
||||
@@ -301,6 +303,33 @@ void HangingEntity::readAdditionalSaveData(CompoundTag *tag)
|
||||
placedByPlayer = tag->getByte(L"PlacedByPlayer") == 1;
|
||||
}
|
||||
|
||||
if (tag->contains(L"PlacedByTutorial"))
|
||||
{
|
||||
placedByTutorial = tag->getByte(L"PlacedByTutorial") == 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bool isTutorial = false;
|
||||
Minecraft *minecraft = Minecraft::GetInstance();
|
||||
if (minecraft != nullptr && minecraft->isTutorial())
|
||||
{
|
||||
isTutorial = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LevelGenerationOptions *levelGen = app.getLevelGenerationOptions();
|
||||
if (levelGen != nullptr && levelGen->isTutorial())
|
||||
{
|
||||
isTutorial = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isTutorial && !placedByPlayer)
|
||||
{
|
||||
placedByTutorial = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool hasDir = false;
|
||||
if (tag->contains(L"Direction"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user