mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-23 21:23:35 +00:00
55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
#pragma once
|
|
|
|
class Mob;
|
|
|
|
class MobEffectInstance {
|
|
private:
|
|
// sent as byte
|
|
int id;
|
|
// sent as short
|
|
int duration;
|
|
// sent as byte
|
|
int amplifier;
|
|
bool splash;
|
|
bool ambient;
|
|
bool noCounter;
|
|
|
|
void _init(int id, int duration, int amplifier);
|
|
|
|
public:
|
|
MobEffectInstance(int id);
|
|
MobEffectInstance(int id, int duration);
|
|
MobEffectInstance(int id, int duration, int amplifier);
|
|
MobEffectInstance(int id, int duration, int amplifier, bool ambient);
|
|
MobEffectInstance(MobEffectInstance* copy);
|
|
|
|
void update(MobEffectInstance* takeOver);
|
|
int getId();
|
|
int getDuration();
|
|
int getAmplifier();
|
|
|
|
bool isSplash();
|
|
void setSplash(bool splash);
|
|
bool isAmbient();
|
|
|
|
bool tick(std::shared_ptr<LivingEntity> target);
|
|
|
|
private:
|
|
int tickDownDuration();
|
|
|
|
public:
|
|
void applyEffect(std::shared_ptr<LivingEntity> mob);
|
|
int getDescriptionId();
|
|
int getPostfixDescriptionId(); // 4J Added
|
|
int hashCode();
|
|
|
|
std::wstring toString();
|
|
|
|
// Was bool equals(Object obj)
|
|
bool equals(MobEffectInstance* obj);
|
|
|
|
CompoundTag* save(CompoundTag* tag);
|
|
static MobEffectInstance* load(CompoundTag* tag);
|
|
void setNoCounter(bool noCounter);
|
|
bool isNoCounter();
|
|
}; |