the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 71 lines 1.9 kB view raw
1#include "stdafx.h" 2#include "net.minecraft.world.h" 3#include "HugeMushroomTile.h" 4 5const wstring HugeMushroomTile::TEXTURE_STEM = L"skin_stem"; 6const wstring HugeMushroomTile::TEXTURE_INSIDE = L"inside"; 7const wstring HugeMushroomTile::TEXTURE_TYPE[] = {L"skin_brown", L"skin_red"}; 8 9HugeMushroomTile::HugeMushroomTile(int id, Material *material, int type) : Tile(id, material) 10{ 11 this->type = type; 12 icons = NULL; 13 iconStem = NULL; 14 iconInside = NULL; 15} 16 17Icon *HugeMushroomTile::getTexture(int face, int data) 18{ 19 // 123 20 // 456 10 21 // 789 22 if (data == 10 && face > 1) return iconStem; 23 if (data >= 1 && data <= 9 && face == 1) return icons[type]; 24 if (data >= 1 && data <= 3 && face == 2) return icons[type]; 25 if (data >= 7 && data <= 9 && face == 3) return icons[type]; 26 27 if ((data == 1 || data == 4 || data == 7) && face == 4) return icons[type]; 28 if ((data == 3 || data == 6 || data == 9) && face == 5) return icons[type]; 29 30 // two special cases requested by rhodox (painterly pack) 31 if (data == 14) 32 { 33 return icons[type]; 34 } 35 if (data == 15) 36 { 37 return iconStem; 38 } 39 40 return iconInside; 41} 42 43int HugeMushroomTile::getResourceCount(Random *random) 44{ 45 int count = random->nextInt(10) - 7; 46 if (count < 0) count = 0; 47 return count; 48} 49 50int HugeMushroomTile::getResource(int data, Random *random, int playerBonusLevel) 51{ 52 return Tile::mushroom_brown_Id + type; 53} 54 55int HugeMushroomTile::cloneTileId(Level *level, int x, int y, int z) 56{ 57 return Tile::mushroom_brown_Id + type; 58} 59 60void HugeMushroomTile::registerIcons(IconRegister *iconRegister) 61{ 62 icons = new Icon*[HUGE_MUSHROOM_TEXTURE_COUNT]; 63 64 for (int i = 0; i < HUGE_MUSHROOM_TEXTURE_COUNT; i++) 65 { 66 icons[i] = iconRegister->registerIcon(getIconName() + L"_" + TEXTURE_TYPE[i]); 67 } 68 69 iconInside = iconRegister->registerIcon(getIconName() + L"_" + TEXTURE_INSIDE); 70 iconStem = iconRegister->registerIcon(getIconName() + L"_" + TEXTURE_STEM); 71}