4jcraft/targets/minecraft/world/entity/ExperienceOrb.h
2026-04-01 13:27:58 -05:00

66 lines
1.3 KiB
C++

#pragma once
#include <memory>
#include "Entity.h"
#include "java/Class.h"
#include "minecraft/world/entity/Entity.h"
class Level;
class Player;
class ExperienceOrb : public Entity {
public:
virtual eINSTANCEOF GetType() { return eTYPE_EXPERIENCEORB; }
static Entity* create(Level* level) { return new ExperienceOrb(level); }
private:
static const int LIFETIME;
public:
int tickCount;
int age;
int throwTime;
private:
int health;
int value;
std::shared_ptr<Player> followingPlayer;
int followingTime;
void _init();
public:
ExperienceOrb(Level* level, double x, double y, double z, int count);
protected:
virtual bool makeStepSound();
public:
ExperienceOrb(Level* level);
protected:
virtual void defineSynchedData();
public:
virtual int getLightColor(float a);
virtual void tick();
virtual bool updateInWaterState();
protected:
virtual void burn(int dmg);
public:
virtual bool hurt(DamageSource* source, float damage);
virtual void addAdditonalSaveData(CompoundTag* entityTag);
virtual void readAdditionalSaveData(CompoundTag* tag);
virtual void playerTouch(std::shared_ptr<Player> player);
int getValue();
int getIcon();
static int getExperienceValue(int maxValue);
virtual bool isAttackable();
virtual bool shouldRender(Vec3* c); // 4J added
};