feat: new chunk load toggle

also fixes item frames / paintings in dlc worlds
This commit is contained in:
Fireblade
2026-07-24 15:14:27 -04:00
parent 261700ea8b
commit 306d1c9fb7
10 changed files with 50 additions and 6 deletions
+30 -1
View File
@@ -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"))
{