summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities
diff options
context:
space:
mode:
Diffstat (limited to 'src/BlockEntities')
-rw-r--r--src/BlockEntities/DropSpenserEntity.cpp11
-rw-r--r--src/BlockEntities/HopperEntity.cpp2
2 files changed, 11 insertions, 2 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());
diff --git a/src/BlockEntities/HopperEntity.cpp b/src/BlockEntities/HopperEntity.cpp
index 9665b9f25..2e4264204 100644
--- a/src/BlockEntities/HopperEntity.cpp
+++ b/src/BlockEntities/HopperEntity.cpp
@@ -95,7 +95,7 @@ bool cHopperEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
void cHopperEntity::SendTo(cClientHandle & a_Client)
{
// The hopper entity doesn't need anything sent to the client when it's created / gets in the viewdistance
- // All the actual handling is in the cWindow UI code that gets called when the hopper is rclked
+ // All the actual handling is in the cWindow UI code that gets called when the hopper is right-clicked
UNUSED(a_Client);
}