Files
pieeebot 6c757e5322 feat(TU20/21): Implement la's TU21 patch file
This adds the following:

TU20:
1. Librarians now have a small chance to offer name tags for sale
2. Witches can now spawn at light level 7 or less in any biome or cave
3. Skeletons & Wither Skeletons now rarely spawn anywhere in the Nether

TU21:
1. Minecart entity limit increased
2026-07-08 06:51:34 +03:00

66 lines
1.5 KiB
C++

#pragma once
using namespace std;
#include "Animal.h"
class Player;
class LightningBolt;
class ControlledByPlayerGoal;
class Pig : public Animal
{
public:
eINSTANCEOF GetType() { return eTYPE_PIG; }
static Entity *create(Level *level) { return new Pig(level); }
private:
static const int DATA_SADDLE_ID = 16;
ControlledByPlayerGoal *controlGoal;
public:
Pig(Level *level);
virtual bool useNewAi();
protected:
virtual bool removeWhenFarAway();
virtual void registerAttributes();
virtual void newServerAiStep();
public:
virtual bool canBeControlledByRider();
protected:
virtual void defineSynchedData();
public:
virtual void addAdditonalSaveData(CompoundTag *tag);
virtual void readAdditionalSaveData(CompoundTag *tag);
protected:
virtual int getAmbientSound();
virtual int getHurtSound();
virtual int getDeathSound();
virtual void playStepSound(int xt, int yt, int zt, int t);
public:
virtual bool mobInteract(shared_ptr<Player> player);
protected:
virtual int getDeathLoot();
virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel);
public:
bool hasSaddle();
void setSaddle(bool value);
virtual void thunderHit(const LightningBolt *lightningBolt);
protected:
virtual void causeFallDamage(float distance);
public:
virtual shared_ptr<AgableMob> getBreedOffspring(shared_ptr<AgableMob> target);
bool isFood(shared_ptr<ItemInstance> itemInstance);
ControlledByPlayerGoal *getControlGoal();
};