diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/ThrownPotion.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/ThrownPotion.h')
| -rw-r--r-- | Minecraft.World/ThrownPotion.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Minecraft.World/ThrownPotion.h b/Minecraft.World/ThrownPotion.h new file mode 100644 index 00000000..cf27491c --- /dev/null +++ b/Minecraft.World/ThrownPotion.h @@ -0,0 +1,43 @@ +#pragma once + +#include "Throwable.h" + +class HitResult; + +class ThrownPotion : public Throwable +{ +public: + eINSTANCEOF GetType() { return eTYPE_THROWNPOTION; } + static Entity *create(Level *level) { return new ThrownPotion(level); } + +public: + static const double SPLASH_RANGE; + +private: + static const double SPLASH_RANGE_SQ; + + int potionValue; + + void _init(); + +public: + ThrownPotion(Level *level); + ThrownPotion(Level *level, shared_ptr<Mob> mob, int potionValue); + ThrownPotion(Level *level, double x, double y, double z, int potionValue); + +protected: + virtual float getGravity(); + virtual float getThrowPower(); + virtual float getThrowUpAngleOffset(); + +public: + void setPotionValue(int potionValue); + int getPotionValue(); + +protected: + virtual void onHit(HitResult *res); + +public: + void readAdditionalSaveData(CompoundTag *tag); + void addAdditonalSaveData(CompoundTag *tag); +};
\ No newline at end of file |
