From b3feddfef372618c8a9d7a0abcaf18cfad866c18 Mon Sep 17 00:00:00 2001 From: daoge <3523206925@qq.com> Date: Tue, 3 Mar 2026 03:04:10 +0800 Subject: feat: TU19 (Dec 2014) Features & Content (#155) * try to resolve merge conflict * feat: TU19 (Dec 2014) Features & Content (#32) * December 2014 files * Working release build * Fix compilation issues * Add sound to Windows64Media * Add DLC content and force Tutorial DLC * Revert "Add DLC content and force Tutorial DLC" This reverts commit 97a43994725008e35fceb984d5549df9c8cea470. * Disable broken light packing * Disable breakpoint during DLC texture map load Allows DLC loading but the DLC textures are still broken * Fix post build not working * ... * fix vs2022 build * fix cmake build --------- Co-authored-by: Loki --- Minecraft.World/HangingEntityItem.cpp | 47 ++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 9 deletions(-) (limited to 'Minecraft.World/HangingEntityItem.cpp') diff --git a/Minecraft.World/HangingEntityItem.cpp b/Minecraft.World/HangingEntityItem.cpp index 505dce4d..9e4e9d5b 100644 --- a/Minecraft.World/HangingEntityItem.cpp +++ b/Minecraft.World/HangingEntityItem.cpp @@ -3,6 +3,7 @@ #include "net.minecraft.world.phys.h" #include "net.minecraft.world.damagesource.h" #include "net.minecraft.world.level.tile.h" +#include "net.minecraft.world.item.h" #include "net.minecraft.world.level.h" #include "HangingEntityItem.h" #include "HangingEntity.h" @@ -13,10 +14,7 @@ HangingEntityItem::HangingEntityItem(int id, eINSTANCEOF eClassType) : Item(id) { - //super(id); - //this.clazz = clazz; this->eType=eClassType; - // setItemCategory(CreativeModeTab.TAB_DECORATIONS); } bool HangingEntityItem::useOn(shared_ptr instance, shared_ptr player, Level *level, int xt, int yt, int zt, int face, float clickX, float clickY, float clickZ, bool bTestOnly) @@ -26,17 +24,16 @@ bool HangingEntityItem::useOn(shared_ptr instance, shared_ptrmayBuild(xt, yt, zt)) return false; + if (!player->mayUseItemAt(xt, yt, zt, face, instance)) return false; return true; } int dir = Direction::FACING_DIRECTION[face]; - shared_ptr entity = createEntity(level, xt, yt, zt, dir); + shared_ptr entity = createEntity(level, xt, yt, zt, dir, instance->getAuxValue() ); - //if (!player->mayUseItemAt(xt, yt, zt, face, instance)) return false; - if (!player->mayBuild(xt, yt, zt)) return false; + if (!player->mayUseItemAt(xt, yt, zt, face, instance)) return false; if (entity != NULL && entity->survives()) { @@ -65,12 +62,22 @@ bool HangingEntityItem::useOn(shared_ptr instance, shared_ptr HangingEntityItem::createEntity(Level *level, int x, int y, int z, int dir) +shared_ptr HangingEntityItem::createEntity(Level *level, int x, int y, int z, int dir, int auxValue) // 4J added auxValue { if (eType == eTYPE_PAINTING) { shared_ptr painting = shared_ptr(new Painting(level, x, y, z, dir)); - painting->PaintingPostConstructor(dir); + +#ifndef _CONTENT_PACKAGE + if (app.DebugArtToolsOn() && auxValue > 0) + { + painting->PaintingPostConstructor(dir, auxValue - 1); + } + else +#endif + { + painting->PaintingPostConstructor(dir); + } return dynamic_pointer_cast (painting); } @@ -86,3 +93,25 @@ shared_ptr HangingEntityItem::createEntity(Level *level, int x, i } } +// 4J Adding overrides for art tools +void HangingEntityItem::appendHoverText(shared_ptr itemInstance, shared_ptr player, vector *lines, bool advanced) +{ +#ifndef _CONTENT_PACKAGE + if (eType == eTYPE_PAINTING && app.DebugArtToolsOn() && itemInstance->getAuxValue() > 0 ) + { + int motive = itemInstance->getAuxValue() - 1; + + wchar_t formatted[256]; + ZeroMemory(formatted, 256 * sizeof(wchar_t)); + swprintf(formatted, 256, L"** %ls %dx%d",Painting::Motive::values[motive]->name.c_str(),Painting::Motive::values[motive]->w/16,Painting::Motive::values[motive]->h/16); + + wstring motiveName = formatted; + + lines->push_back(HtmlString(motiveName.c_str(), eHTMLColor_c)); + } + else +#endif + { + return Item::appendHoverText(itemInstance, player, lines, advanced); + } +} \ No newline at end of file -- cgit v1.2.3