aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Throwable.h
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/Throwable.h
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.World/Throwable.h')
-rw-r--r--Minecraft.World/Throwable.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/Minecraft.World/Throwable.h b/Minecraft.World/Throwable.h
new file mode 100644
index 00000000..4d7daea0
--- /dev/null
+++ b/Minecraft.World/Throwable.h
@@ -0,0 +1,60 @@
+#pragma once
+
+#include "Entity.h"
+
+class Mob;
+class HitResult;
+
+class Throwable : public Entity
+{
+private:
+ int xTile;
+ int yTile;
+ int zTile;
+ int lastTile;
+
+protected:
+ bool inGround;
+
+public:
+ int shakeTime;
+
+protected:
+ shared_ptr<Mob> owner;
+
+private:
+ int life;
+ int flightTime;
+
+ void _throwableInit();
+
+public:
+ Throwable(Level *level);
+
+protected:
+ virtual void defineSynchedData();
+
+public:
+ virtual bool shouldRenderAtSqrDistance(double distance);
+
+ Throwable(Level *level, shared_ptr<Mob> mob);
+ Throwable(Level *level, double x, double y, double z);
+
+protected:
+ virtual float getThrowPower();
+ virtual float getThrowUpAngleOffset();
+
+public:
+ virtual void shoot(double xd, double yd, double zd, float pow, float uncertainty);
+ virtual void lerpMotion(double xd, double yd, double zd);
+ virtual void tick();
+
+protected:
+ virtual float getGravity();
+ virtual void onHit(HitResult *res) = 0;
+
+public:
+ virtual void addAdditonalSaveData(CompoundTag *tag);
+ virtual void readAdditionalSaveData(CompoundTag *tag);
+ virtual float getShadowHeightOffs();
+}; \ No newline at end of file