Cuberite
A lightweight, fast and extensible game server for Minecraft
Rabbit.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "PassiveMonster.h"
5 
6 
7 
8 
9 
10 enum class eRabbitType : UInt8
11 {
12  Brown = 0,
13  White = 1,
14  Black = 2,
15  BlackAndWhite = 3,
16  Gold = 4,
17  SaltAndPepper = 5,
18  TheKillerBunny = 99
19 };
20 
21 
22 
23 
24 
25 class cRabbit :
26  public cPassiveMonster
27 {
29 
30 public:
31  cRabbit();
32  cRabbit(eRabbitType Type, int MoreCarrotTicks = 0);
33 
35 
36  virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
37  virtual void GetFollowedItems(cItems & a_Items) override
38  {
39  a_Items.Add(E_ITEM_CARROT);
40  a_Items.Add(E_ITEM_GOLDEN_CARROT);
41  a_Items.Add(E_BLOCK_DANDELION);
42  }
43 
44  eRabbitType GetRabbitType() const { return m_Type; }
45  int GetMoreCarrotTicks() const { return m_MoreCarrotTicks; }
46 
47 private:
48 
50  int m_MoreCarrotTicks; // Ticks until the Rabbit eat planted Carrots
51 } ;
cPassiveMonster super
Definition: Rabbit.h:28
Definition: Rabbit.h:25
eRabbitType GetRabbitType() const
Definition: Rabbit.h:44
eRabbitType
Definition: Rabbit.h:10
eRabbitType m_Type
Definition: Rabbit.h:49
unsigned char UInt8
Definition: Globals.h:115
int m_MoreCarrotTicks
Definition: Rabbit.h:50
Definition: Entity.h:73
eMonsterType m_Type
Definition: Monster.cpp:33
#define CLASS_PROTODEF(classname)
Definition: Entity.h:11
int GetMoreCarrotTicks() const
Definition: Rabbit.h:45
This class bridges a vector of cItem for safe access via Lua.
Definition: Item.h:234