the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "CompassItem.h"
3#include "..\Minecraft.Client\Minecraft.h"
4#include "..\Minecraft.Client\MultiPlayerLocalPlayer.h"
5#include "net.minecraft.world.h"
6
7#ifdef __PSVITA__
8const wstring CompassItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = {L"compassP0"};
9#else
10const wstring CompassItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = {L"compassP0",L"compassP1",L"compassP2",L"compassP3"};
11#endif
12
13CompassItem::CompassItem(int id) : Item(id)
14{
15 icons = NULL;
16}
17
18// 4J Added so that we can override the icon id used to calculate the texture UV's for each player
19
20Icon *CompassItem::getIcon(int auxValue)
21{
22 Icon *icon = Item::getIcon(auxValue);
23 Minecraft *pMinecraft = Minecraft::GetInstance();
24
25 if( pMinecraft->player != NULL && auxValue == 0 )
26 {
27 icon = icons[pMinecraft->player->GetXboxPad()];
28 }
29 return icon;
30}
31
32void CompassItem::registerIcons(IconRegister *iconRegister)
33{
34 Item::registerIcons(iconRegister);
35
36 icons = new Icon *[XUSER_MAX_COUNT];
37
38 for (int i = 0; i < XUSER_MAX_COUNT; i++)
39 {
40 icons[i] = iconRegister->registerIcon(TEXTURE_PLAYER_ICON[i]);
41 }
42}