summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/DropSpenserEntity.cpp
diff options
context:
space:
mode:
authorKrystilizeNevaDies <57762380+KrystilizeNevaDies@users.noreply.github.com>2020-09-21 17:31:45 +0200
committerGitHub <noreply@github.com>2020-09-21 17:31:45 +0200
commit23bca008317e125659d4b97f29cf13da81a7aecd (patch)
treecb48b0c62ca3254c0d8aeaf4485d773b17c2c515 /src/BlockEntities/DropSpenserEntity.cpp
parentTrapdoor crash fix (#4890) (diff)
downloadcuberite-23bca008317e125659d4b97f29cf13da81a7aecd.tar
cuberite-23bca008317e125659d4b97f29cf13da81a7aecd.tar.gz
cuberite-23bca008317e125659d4b97f29cf13da81a7aecd.tar.bz2
cuberite-23bca008317e125659d4b97f29cf13da81a7aecd.tar.lz
cuberite-23bca008317e125659d4b97f29cf13da81a7aecd.tar.xz
cuberite-23bca008317e125659d4b97f29cf13da81a7aecd.tar.zst
cuberite-23bca008317e125659d4b97f29cf13da81a7aecd.zip
Diffstat (limited to 'src/BlockEntities/DropSpenserEntity.cpp')
-rw-r--r--src/BlockEntities/DropSpenserEntity.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/BlockEntities/DropSpenserEntity.cpp b/src/BlockEntities/DropSpenserEntity.cpp
index 97a67ff60..243ec8594 100644
--- a/src/BlockEntities/DropSpenserEntity.cpp
+++ b/src/BlockEntities/DropSpenserEntity.cpp
@@ -6,6 +6,7 @@
#include "Globals.h"
#include "DropSpenserEntity.h"
+#include "../Bindings/PluginManager.h"
#include "../EffectID.h"
#include "../Entities/Player.h"
#include "../Chunk.h"
@@ -80,8 +81,16 @@ void cDropSpenserEntity::DropSpense(cChunk & a_Chunk)
int RandomSlot = m_World->GetTickRandomNumber(SlotsCnt - 1);
+ int SpenseSlot = OccupiedSlots[RandomSlot];
+
+ if (cPluginManager::Get()->CallHookDropSpense(*m_World, *this, SpenseSlot))
+ {
+ // Plugin disagrees with the move
+ return;
+ }
+
// DropSpense the item, using the specialized behavior in the subclasses:
- DropSpenseFromSlot(a_Chunk, OccupiedSlots[RandomSlot]);
+ DropSpenseFromSlot(a_Chunk, SpenseSlot);
// Broadcast a smoke and click effects:
NIBBLETYPE Meta = a_Chunk.GetMeta(GetRelPos());