the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 46 lines 1.2 kB view raw
1#include "stdafx.h" 2#include "net.minecraft.stats.h" 3#include "net.minecraft.world.entity.player.h" 4#include "net.minecraft.world.item.h" 5#include "net.minecraft.world.level.h" 6#include "DeadBushTile.h" 7 8DeadBushTile::DeadBushTile(int id) : Bush(id,Material::replaceable_plant) 9{ 10 updateDefaultShape(); 11} 12 13// 4J Added override 14void DeadBushTile::updateDefaultShape() 15{ 16 float ss = 0.4f; 17 this->setShape(0.5f - ss, 0, 0.5f - ss, 0.5f + ss, 0.8f, 0.5f + ss); 18} 19 20bool DeadBushTile::mayPlaceOn(int tile) 21{ 22 return tile == Tile::sand_Id; 23} 24 25int DeadBushTile::getResource(int data, Random *random, int playerBonusLevel) 26{ 27 return -1; 28} 29 30void DeadBushTile::playerDestroy(Level *level, shared_ptr<Player> player, int x, int y, int z, int data) 31{ 32 if (!level->isClientSide && player->getSelectedItem() != NULL && player->getSelectedItem()->id == Item::shears_Id) 33 { 34 player->awardStat( 35 GenericStats::blocksMined(id), 36 GenericStats::param_blocksMined(id,data,1) 37 ); 38 39 // drop leaf block instead of sapling 40 popResource(level, x, y, z, shared_ptr<ItemInstance>(new ItemInstance(Tile::deadBush, 1, data))); 41 } 42 else 43 { 44 Bush::playerDestroy(level, player, x, y, z, data); 45 } 46}