From 748b121703fa28b10933f4432c09391e66179118 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 28 Mar 2021 14:40:57 +0100 Subject: Unify DoWithBlockEntity (#5168) + DoWith calls now broadcast the block entity and mark the chunk dirty + Add block entity change queue to synchronise BE updates with block updates * Fixed a few incorrect assertions about BE type - Remove manual overloads --- src/Blocks/WorldInterface.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/Blocks/WorldInterface.h') diff --git a/src/Blocks/WorldInterface.h b/src/Blocks/WorldInterface.h index 2a39ffbc2..4ae3f33c9 100644 --- a/src/Blocks/WorldInterface.h +++ b/src/Blocks/WorldInterface.h @@ -4,13 +4,11 @@ #include "../FunctionRef.h" #include "../Mobs/MonsterTypes.h" -class cBedEntity; class cBlockEntity; class cBroadcastInterface; class cItems; class cPlayer; -using cBedCallback = cFunctionRef; using cBlockEntityCallback = cFunctionRef; using cPlayerListCallback = cFunctionRef; using cEntityCallback = cFunctionRef; @@ -32,10 +30,8 @@ public: virtual void DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_BlockY, double a_BlockZ, bool a_CanCauseFire, eExplosionSource a_Source, void * a_SourceData) = 0; - virtual bool DoWithBedAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBedCallback a_Callback) = 0; - /** Calls the callback for the block entity at the specified coords; returns false if there's no block entity at those coords, true if found */ - virtual bool DoWithBlockEntityAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBlockEntityCallback a_Callback) = 0; + virtual bool DoWithBlockEntityAt(Vector3i a_Position, cBlockEntityCallback a_Callback) = 0; /** Spawns item pickups for each item in the list. May compress pickups if too many entities: */ virtual void SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_FlyAwaySpeed = 1.0, bool IsPlayerCreated = false) = 0; -- cgit v1.2.3