aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ClockItem.cpp
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/ClockItem.cpp
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.World/ClockItem.cpp')
-rw-r--r--Minecraft.World/ClockItem.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/Minecraft.World/ClockItem.cpp b/Minecraft.World/ClockItem.cpp
new file mode 100644
index 00000000..afe0544d
--- /dev/null
+++ b/Minecraft.World/ClockItem.cpp
@@ -0,0 +1,41 @@
+#include "stdafx.h"
+#include "ClockItem.h"
+#include "..\Minecraft.Client\Minecraft.h"
+#include "..\Minecraft.Client\MultiPlayerLocalPlayer.h"
+#include "net.minecraft.world.h"
+
+#ifdef __PSVITA__
+const wstring ClockItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = {L"clockP0"};
+#else
+const wstring ClockItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = {L"clockP0",L"clockP1",L"clockP2",L"clockP3"};
+#endif
+
+ClockItem::ClockItem(int id) : Item(id)
+{
+ icons = NULL;
+}
+
+// 4J Added so that we can override the icon id used to calculate the texture UV's for each player
+Icon *ClockItem::getIcon(int auxValue)
+{
+ Icon *icon = Item::getIcon(auxValue);
+ Minecraft *pMinecraft = Minecraft::GetInstance();
+
+ if( pMinecraft->player != NULL && auxValue == 0 )
+ {
+ icon = icons[pMinecraft->player->GetXboxPad()];
+ }
+ return icon;
+}
+
+void ClockItem::registerIcons(IconRegister *iconRegister)
+{
+ Item::registerIcons(iconRegister);
+
+ icons = new Icon *[XUSER_MAX_COUNT];
+
+ for (int i = 0; i < XUSER_MAX_COUNT; i++)
+ {
+ icons[i] = iconRegister->registerIcon(TEXTURE_PLAYER_ICON[i]);
+ }
+}