neoLegacy/Minecraft.World/Rabbit.h
ChristianF 29523f5ba4 Rabbit follow Parents and Variants per biome
now rabbits in panic state are ok and doesnt jump far away. They spawn in a group 1 adult 1-2 baby
different weight spawn based on the biome, also they have correct variants per biome as far as i could check online
2026-03-13 19:09:15 +01:00

58 lines
1.5 KiB
C++

#pragma once
#include "Animal.h"
class Rabbit : public Animal
{
public:
enum class Variant
{
BROWN = 0,
WHITE = 1,
BLACK = 2,
GOLD = 3,
SALT = 4,
WHITE_SPLOTCHED = 5,
EVIL = 99,
};
eINSTANCEOF GetType() { return eTYPE_RABBIT; }
static Entity *create(Level *level) { return new Rabbit(level); }
private:
static const int DATA_TYPE_ID = 16;
float jumpCompletion;
int jumpTicks;
int moreCarrotTicks;
public:
Rabbit(Level *level);
virtual ~Rabbit() {}
float getJumpCompletion(float partialTick) const;
Variant getVariant() const;
void setVariant(Variant v);
virtual bool useNewAi() override;
virtual void tick() override;
protected:
virtual void registerAttributes() override;
virtual void defineSynchedData() override;
virtual int getAmbientSound() override;
virtual int getHurtSound() override;
virtual int getDeathSound() override;
virtual float getSoundVolume() override { return 0.6f; }
virtual bool makeStepSound() override { return true; }
public:
virtual bool isFood(shared_ptr<ItemInstance> item) override;
virtual shared_ptr<AgableMob> getBreedOffspring(shared_ptr<AgableMob> target) override;
virtual void readAdditionalSaveData(CompoundTag *tag) override;
virtual void addAdditonalSaveData(CompoundTag *tag) override;
virtual MobGroupData *finalizeMobSpawn(MobGroupData *groupData, int extraData = 0) override;
};