From 885d8287125439047ca2318f8e349b8da279e612 Mon Sep 17 00:00:00 2001 From: Lukas Pioch Date: Fri, 7 Jul 2017 09:31:45 +0200 Subject: Added bed entity (#3823) * Added bed entity * Export cBedEntity to lua * Set color of bed through item damage value * Added bed entity to APIDoc * NBT: Added loading and saving * Crafting recipes for the colored beds --- src/Blocks/BlockHandler.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Blocks/BlockHandler.h') diff --git a/src/Blocks/BlockHandler.h b/src/Blocks/BlockHandler.h index 24552fb46..625def7d8 100644 --- a/src/Blocks/BlockHandler.h +++ b/src/Blocks/BlockHandler.h @@ -80,6 +80,10 @@ public: /** Called when the item is mined to convert it into pickups. Pickups may specify multiple items. Appends items to a_Pickups, preserves its original contents */ virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta); + /** Called when the item is mined to convert it into pickups. Pickups may specify multiple items. Appends items to a_Pickups, preserves its original contents. + Overloaded method with coords and digger, for blocks that needs to access the block entity, e.g. a bed */ + virtual void ConvertToPickups(cEntity * a_Digger, cItems & a_Pickups, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ) {} + /** Handles the dropping, but not destruction, of a block based on what ConvertTo(Verbatim)Pickups() returns, including the spawning of pickups and alertion of plugins @param a_Digger The entity causing the drop; it may be nullptr @param a_CanDrop Informs the handler whether the block should be dropped at all. One example when this is false is when stone is destroyed by hand -- cgit v1.2.3