Updated Bookshelves drop behaviour (#4567)
* Updated BookShelves Drop Behaviour As described here : https://minecraft.gamepedia.com/Bookshelf#Loot * Update src/Blocks/BlockBookShelf.h * Update CONTRIBUTORS
This commit is contained in:
parent
ec7247fa63
commit
1e1f79b795
@ -66,3 +66,4 @@ williamhatcher (Helped with API documentation updates and bug fixes)
|
|||||||
worktycho
|
worktycho
|
||||||
xoft (Mattes Dolak/madmaxoft on GH)
|
xoft (Mattes Dolak/madmaxoft on GH)
|
||||||
Yeeeeezus (Donated AlchemistVillage prefabs)
|
Yeeeeezus (Donated AlchemistVillage prefabs)
|
||||||
|
Xenoxis
|
||||||
|
26
src/Blocks/BlockBookShelf.h
Normal file
26
src/Blocks/BlockBookShelf.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "BlockHandler.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class cBlockBookShelfHandler :
|
||||||
|
public cBlockHandler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
cBlockBookShelfHandler(BLOCKTYPE a_BlockType) :
|
||||||
|
cBlockHandler(a_BlockType)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override
|
||||||
|
{
|
||||||
|
if ((ItemCategory::IsTool(a_Tool->m_ItemType)) && (ToolHasSilkTouch(a_Tool)))
|
||||||
|
{
|
||||||
|
return cItem(m_BlockType, 1);
|
||||||
|
}
|
||||||
|
return cItem(E_ITEM_BOOK, 3);
|
||||||
|
}
|
||||||
|
};
|
@ -8,6 +8,7 @@
|
|||||||
#include "BlockAnvil.h"
|
#include "BlockAnvil.h"
|
||||||
#include "BlockBed.h"
|
#include "BlockBed.h"
|
||||||
#include "BlockBigFlower.h"
|
#include "BlockBigFlower.h"
|
||||||
|
#include "BlockBookShelf.h"
|
||||||
#include "BlockBrewingStand.h"
|
#include "BlockBrewingStand.h"
|
||||||
#include "BlockButton.h"
|
#include "BlockButton.h"
|
||||||
#include "BlockCactus.h"
|
#include "BlockCactus.h"
|
||||||
@ -202,6 +203,7 @@ static cBlockHandler * CreateBlockHandler(BLOCKTYPE a_BlockType)
|
|||||||
case E_BLOCK_BIRCH_FENCE: return new cBlockFenceHandler (a_BlockType);
|
case E_BLOCK_BIRCH_FENCE: return new cBlockFenceHandler (a_BlockType);
|
||||||
case E_BLOCK_BIRCH_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType);
|
case E_BLOCK_BIRCH_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType);
|
||||||
case E_BLOCK_BIRCH_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType);
|
case E_BLOCK_BIRCH_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType);
|
||||||
|
case E_BLOCK_BOOKCASE: return new cBlockBookShelfHandler (a_BlockType);
|
||||||
case E_BLOCK_BREWING_STAND: return new cBlockBrewingStandHandler (a_BlockType);
|
case E_BLOCK_BREWING_STAND: return new cBlockBrewingStandHandler (a_BlockType);
|
||||||
case E_BLOCK_BRICK_STAIRS: return new cBlockStairsHandler (a_BlockType);
|
case E_BLOCK_BRICK_STAIRS: return new cBlockStairsHandler (a_BlockType);
|
||||||
case E_BLOCK_BROWN_MUSHROOM: return new cBlockMushroomHandler (a_BlockType);
|
case E_BLOCK_BROWN_MUSHROOM: return new cBlockMushroomHandler (a_BlockType);
|
||||||
|
@ -14,6 +14,7 @@ SET (HDRS
|
|||||||
BlockAnvil.h
|
BlockAnvil.h
|
||||||
BlockBed.h
|
BlockBed.h
|
||||||
BlockBigFlower.h
|
BlockBigFlower.h
|
||||||
|
BlockBookShelf.h
|
||||||
BlockBrewingStand.h
|
BlockBrewingStand.h
|
||||||
BlockButton.h
|
BlockButton.h
|
||||||
BlockCactus.h
|
BlockCactus.h
|
||||||
|
Loading…
Reference in New Issue
Block a user