aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Sheep.h
blob: 666e1d57b48fabb0a2f794d640adf21d795ca5c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#pragma once

using namespace std;

class Random;
class EatTileGoal;
class CraftingContainer;

#include "Animal.h"
#include "SharedConstants.h"
#include "AbstractContainerMenu.h"

class Sheep : public Animal
{
private:
	class SheepContainer : public AbstractContainerMenu
	{
		bool stillValid(shared_ptr<Player> player) { return false; }
	};

	shared_ptr<CraftingContainer> container;
public:
	eINSTANCEOF GetType() { return eTYPE_SHEEP; }
	static Entity *create(Level *level) { return new Sheep(level); }

private:
	static const int EAT_ANIMATION_TICKS = SharedConstants::TICKS_PER_SECOND * 2;
	static const int DATA_WOOL_ID = 16;

	int eatAnimationTick;
	EatTileGoal *eatTileGoal;

public:
	static const float COLOR[][3];

public:
	Sheep(Level *level);

protected:
	virtual bool useNewAi();
	virtual void newServerAiStep();

public:
	void aiStep();
	virtual int getMaxHealth();

protected:
	virtual void defineSynchedData();

public:
	virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel);
	virtual int getDeathLoot();

public:
	virtual void handleEntityEvent(byte id);

public:
	float getHeadEatPositionScale(float a);
	float getHeadEatAngleScale(float a);

	virtual bool interact(shared_ptr<Player> player);
	virtual void addAdditonalSaveData(CompoundTag *tag);
	virtual void readAdditionalSaveData(CompoundTag *tag);

protected:
	virtual int getAmbientSound();
	virtual int getHurtSound();
	virtual int getDeathSound();

public:
	int getColor();
	void setColor(int color);
	bool isSheared();
	void setSheared(bool value);

	static int getSheepColor(Random *random);
	virtual shared_ptr<AgableMob> getBreedOffspring(shared_ptr<AgableMob> target);

	virtual void ate();

	void finalizeMobSpawn();

private:
	int getOffspringColor(shared_ptr<Animal> animal, shared_ptr<Animal> partner);
	int getDyeColor(shared_ptr<Animal> animal);
};