From b3feddfef372618c8a9d7a0abcaf18cfad866c18 Mon Sep 17 00:00:00 2001 From: daoge <3523206925@qq.com> Date: Tue, 3 Mar 2026 03:04:10 +0800 Subject: feat: TU19 (Dec 2014) Features & Content (#155) * try to resolve merge conflict * feat: TU19 (Dec 2014) Features & Content (#32) * December 2014 files * Working release build * Fix compilation issues * Add sound to Windows64Media * Add DLC content and force Tutorial DLC * Revert "Add DLC content and force Tutorial DLC" This reverts commit 97a43994725008e35fceb984d5549df9c8cea470. * Disable broken light packing * Disable breakpoint during DLC texture map load Allows DLC loading but the DLC textures are still broken * Fix post build not working * ... * fix vs2022 build * fix cmake build --------- Co-authored-by: Loki --- Minecraft.World/DamageSource.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'Minecraft.World/DamageSource.h') diff --git a/Minecraft.World/DamageSource.h b/Minecraft.World/DamageSource.h index 2e1d249d..1173db4d 100644 --- a/Minecraft.World/DamageSource.h +++ b/Minecraft.World/DamageSource.h @@ -1,11 +1,12 @@ #pragma once using namespace std; -class Mob; +class LivingEntity; class Entity; class Arrow; class Fireball; class Player; +class Explosion; #include "ChatPacket.h" @@ -22,22 +23,20 @@ public: static DamageSource *fall; static DamageSource *outOfWorld; static DamageSource *genericSource; - static DamageSource *explosion; - static DamageSource *controlledExplosion; static DamageSource *magic; static DamageSource *dragonbreath; static DamageSource *wither; static DamageSource *anvil; static DamageSource *fallingBlock; - static DamageSource *mobAttack(shared_ptr mob); + static DamageSource *mobAttack(shared_ptr mob); static DamageSource *playerAttack(shared_ptr player); static DamageSource *arrow(shared_ptr arrow, shared_ptr owner); static DamageSource *fireball(shared_ptr fireball, shared_ptr owner); static DamageSource *thrown(shared_ptr entity, shared_ptr owner); static DamageSource *indirectMagic(shared_ptr entity, shared_ptr owner); static DamageSource *thorns(shared_ptr source); - + static DamageSource *explosion(Explosion *explosion); private: bool _bypassArmor; bool _bypassInvul; @@ -47,10 +46,13 @@ private: bool _isProjectile; bool _scalesWithDifficulty; bool _isMagic; + bool _isExplosion; public: bool isProjectile(); DamageSource *setProjectile(); + bool isExplosion(); + DamageSource *setExplosion(); bool isBypassArmor(); float getFoodExhaustion(); @@ -58,10 +60,11 @@ public: //wstring msgId; ChatPacket::EChatPacketMessage m_msgId; // 4J Made int so we can localise + ChatPacket::EChatPacketMessage m_msgWithItemId; // 4J: Renamed from m_msgWithSourceId (it was already renamed in places, just made consistent) protected: //DamageSource(const wstring &msgId); - DamageSource(ChatPacket::EChatPacketMessage msgId); + DamageSource(ChatPacket::EChatPacketMessage msgId, ChatPacket::EChatPacketMessage msgWithItemId = ChatPacket::e_ChatCustom); public: virtual ~DamageSource() {} @@ -83,8 +86,12 @@ public: // 4J Stu - Made return a packet //virtual wstring getLocalizedDeathMessage(shared_ptr player); - virtual shared_ptr getDeathMessagePacket(shared_ptr player); + virtual shared_ptr getDeathMessagePacket(shared_ptr player); bool isFire(); ChatPacket::EChatPacketMessage getMsgId(); // 4J Stu - Used to return String + + // 4J Added + bool equals(DamageSource *source); + virtual DamageSource *copy(); }; \ No newline at end of file -- cgit v1.2.3