diff --git a/Minecraft.Client/ClientConnection.cpp b/Minecraft.Client/ClientConnection.cpp index 36e1d981..8ef643a6 100644 --- a/Minecraft.Client/ClientConnection.cpp +++ b/Minecraft.Client/ClientConnection.cpp @@ -577,12 +577,14 @@ void ClientConnection::handleAddEntity(shared_ptr packet) { int dir = packet->data & 0xFF; bool placedByPlayer = (packet->data & 0x100) != 0; + bool placedByTutorial = (packet->data & 0x200) != 0; e = std::make_shared(level, (int)x, (int)y, (int)z, dir); shared_ptr frame = dynamic_pointer_cast(e); if (frame != nullptr) { frame->placedByPlayer = placedByPlayer; - if (placedByPlayer) + frame->placedByTutorial = placedByTutorial; + if (placedByPlayer || placedByTutorial) { frame->setDir(dir); } @@ -842,7 +844,8 @@ void ClientConnection::handleAddPainting(shared_ptr packet) { shared_ptr painting = std::make_shared(level, packet->x, packet->y, packet->z, packet->dir, packet->motive); painting->placedByPlayer = packet->placedByPlayer; - if (packet->placedByPlayer) + painting->placedByTutorial = packet->placedByTutorial; + if (packet->placedByPlayer || packet->placedByTutorial) { painting->setDir(packet->dir); } diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp index d8a7c482..ca294e47 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp @@ -84,7 +84,7 @@ void UIScene_SettingsOptionsMenu::tick() m_multiList.AddNewCheckbox(app.GetString(IDS_VIEW_BOBBING), eControl_ViewBob, (app.GetGameSettings(m_iPad,eGameSetting_ViewBob)!=0)); m_multiList.AddNewCheckbox(app.GetString(IDS_HINTS), eControl_Hints, (app.GetGameSettings(m_iPad,eGameSetting_Hints)!=0)); m_multiList.AddNewCheckbox(app.GetString(IDS_CHECKBOX_DEATH_MESSAGES), eControl_DeathMessages, (app.GetGameSettings(m_iPad,eGameSetting_DeathMessages)!=0)); - m_multiList.AddNewCheckbox(L"Passive chunk loading", eControl_PassiveChunkLoading, (app.GetGameSettings(m_iPad,eGameSetting_PassiveChunkLoading)!=0)); + m_multiList.AddNewCheckbox(L"Passive Chunk Loading", eControl_PassiveChunkLoading, (app.GetGameSettings(m_iPad,eGameSetting_PassiveChunkLoading)!=0)); if(m_bNotInGame) { diff --git a/Minecraft.Client/ItemFrameRenderer.cpp b/Minecraft.Client/ItemFrameRenderer.cpp index b297c546..7ef3d20d 100644 --- a/Minecraft.Client/ItemFrameRenderer.cpp +++ b/Minecraft.Client/ItemFrameRenderer.cpp @@ -45,7 +45,7 @@ void ItemFrameRenderer::render(shared_ptr _itemframe, double x, double float back = 0.0f; // set offset to 1 if the item frame is not placed by the player - if (itemFrame->level->isClientSide && !itemFrame->placedByPlayer) + if (itemFrame->level->isClientSide && itemFrame->placedByTutorial) { back = 1.0f; } diff --git a/Minecraft.Client/TrackedEntity.cpp b/Minecraft.Client/TrackedEntity.cpp index 82965bbd..5bd13ce0 100644 --- a/Minecraft.Client/TrackedEntity.cpp +++ b/Minecraft.Client/TrackedEntity.cpp @@ -846,6 +846,10 @@ shared_ptr TrackedEntity::getAddEntityPacket() { data |= 0x100; } + if (frame->placedByTutorial) + { + data |= 0x200; + } shared_ptr packet = std::make_shared(e, AddEntityPacket::ITEM_FRAME, data, yRotp, xRotp, xp, yp, zp); packet->x = Mth::floor(frame->xTile * 32.0f); packet->y = Mth::floor(frame->yTile * 32.0f); diff --git a/Minecraft.World/AddPaintingPacket.cpp b/Minecraft.World/AddPaintingPacket.cpp index 1b3ec14b..9e3e3c69 100644 --- a/Minecraft.World/AddPaintingPacket.cpp +++ b/Minecraft.World/AddPaintingPacket.cpp @@ -16,6 +16,7 @@ AddPaintingPacket::AddPaintingPacket() dir = 0; motive = L""; placedByPlayer = false; + placedByTutorial = false; } AddPaintingPacket::AddPaintingPacket(shared_ptr e) @@ -27,6 +28,7 @@ AddPaintingPacket::AddPaintingPacket(shared_ptr e) dir = e->dir; motive = e->motive->name; placedByPlayer = e->placedByPlayer; + placedByTutorial = e->placedByTutorial; } void AddPaintingPacket::read(DataInputStream *dis) //throws IOException @@ -38,6 +40,7 @@ void AddPaintingPacket::read(DataInputStream *dis) //throws IOException z = dis->readInt(); dir = dis->readInt(); placedByPlayer = dis->readByte() != 0; + placedByTutorial = dis->readByte() != 0; } void AddPaintingPacket::write(DataOutputStream *dos) //throws IOException @@ -49,6 +52,7 @@ void AddPaintingPacket::write(DataOutputStream *dos) //throws IOException dos->writeInt(z); dos->writeInt(dir); dos->writeByte(placedByPlayer ? 1 : 0); + dos->writeByte(placedByTutorial ? 1 : 0); } void AddPaintingPacket::handle(PacketListener *listener) diff --git a/Minecraft.World/AddPaintingPacket.h b/Minecraft.World/AddPaintingPacket.h index e42c4863..1d6a288b 100644 --- a/Minecraft.World/AddPaintingPacket.h +++ b/Minecraft.World/AddPaintingPacket.h @@ -13,6 +13,7 @@ public: int dir; wstring motive; bool placedByPlayer; + bool placedByTutorial; public: AddPaintingPacket(); diff --git a/Minecraft.World/HangingEntity.cpp b/Minecraft.World/HangingEntity.cpp index 16649396..42e40600 100644 --- a/Minecraft.World/HangingEntity.cpp +++ b/Minecraft.World/HangingEntity.cpp @@ -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(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")) { diff --git a/Minecraft.World/HangingEntity.h b/Minecraft.World/HangingEntity.h index e6aa8c8d..bd04493e 100644 --- a/Minecraft.World/HangingEntity.h +++ b/Minecraft.World/HangingEntity.h @@ -21,6 +21,7 @@ public: int dir; int xTile, yTile, zTile; bool placedByPlayer = false; + bool placedByTutorial = false; HangingEntity(Level *level); HangingEntity(Level *level, int xTile, int yTile, int zTile, int dir); diff --git a/Minecraft.World/HangingEntityItem.cpp b/Minecraft.World/HangingEntityItem.cpp index 95d6f9e5..6a837ad5 100644 --- a/Minecraft.World/HangingEntityItem.cpp +++ b/Minecraft.World/HangingEntityItem.cpp @@ -74,6 +74,7 @@ shared_ptr HangingEntityItem::createEntity(Level *level, int x, i { shared_ptr painting = std::make_shared(level, x, y, z, dir); painting->placedByPlayer = true; + painting->placedByTutorial = false; #ifndef _CONTENT_PACKAGE if (app.DebugArtToolsOn() && auxValue > 0) @@ -92,6 +93,7 @@ shared_ptr HangingEntityItem::createEntity(Level *level, int x, i { shared_ptr itemFrame = std::make_shared(level, x, y, z, dir); itemFrame->placedByPlayer = true; + itemFrame->placedByTutorial = false; itemFrame->setDir(dir); return dynamic_pointer_cast (itemFrame); diff --git a/Minecraft.World/IceTile.cpp b/Minecraft.World/IceTile.cpp index 3684b7c3..773c61c3 100644 --- a/Minecraft.World/IceTile.cpp +++ b/Minecraft.World/IceTile.cpp @@ -14,7 +14,7 @@ IceTile::IceTile(int id) : HalfTransparentTile(id, L"ice", Material::ice, false) int IceTile::getRenderLayer() { - return 2; + return 1; } bool IceTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face)