the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 88 lines 2.1 kB view raw
1#pragma once 2 3using namespace std; 4 5class Random; 6class EatTileGoal; 7class CraftingContainer; 8 9#include "Animal.h" 10#include "SharedConstants.h" 11#include "AbstractContainerMenu.h" 12 13class Sheep : public Animal 14{ 15private: 16 class SheepContainer : public AbstractContainerMenu 17 { 18 bool stillValid(shared_ptr<Player> player) { return false; } 19 }; 20 21 shared_ptr<CraftingContainer> container; 22public: 23 eINSTANCEOF GetType() { return eTYPE_SHEEP; } 24 static Entity *create(Level *level) { return new Sheep(level); } 25 26private: 27 static const int EAT_ANIMATION_TICKS = SharedConstants::TICKS_PER_SECOND * 2; 28 static const int DATA_WOOL_ID = 16; 29 30 int eatAnimationTick; 31 EatTileGoal *eatTileGoal; 32 33public: 34 static const int COLOR_LENGTH = 16; 35 static const float COLOR[COLOR_LENGTH][3]; 36 37public: 38 Sheep(Level *level); 39 40protected: 41 virtual bool useNewAi(); 42 virtual void newServerAiStep(); 43 44public: 45 void aiStep(); 46 47protected: 48 virtual void registerAttributes(); 49 virtual void defineSynchedData(); 50 51public: 52 virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel); 53 virtual int getDeathLoot(); 54 55public: 56 virtual void handleEntityEvent(byte id); 57 58public: 59 float getHeadEatPositionScale(float a); 60 float getHeadEatAngleScale(float a); 61 62 virtual bool mobInteract(shared_ptr<Player> player); 63 virtual void addAdditonalSaveData(CompoundTag *tag); 64 virtual void readAdditionalSaveData(CompoundTag *tag); 65 66protected: 67 virtual int getAmbientSound(); 68 virtual int getHurtSound(); 69 virtual int getDeathSound(); 70 virtual void playStepSound(int xt, int yt, int zt, int t); 71 72public: 73 int getColor(); 74 void setColor(int color); 75 bool isSheared(); 76 void setSheared(bool value); 77 78 static int getSheepColor(Random *random); 79 virtual shared_ptr<AgableMob> getBreedOffspring(shared_ptr<AgableMob> target); 80 81 virtual void ate(); 82 83 MobGroupData *finalizeMobSpawn(MobGroupData *groupData, int extraData = 0); // 4J Added extraData param 84 85private: 86 int getOffspringColor(shared_ptr<Animal> animal, shared_ptr<Animal> partner); 87 int getDyeColor(shared_ptr<Animal> animal); 88};