Cuberite
A lightweight, fast and extensible game server for Minecraft
BlockEnderChest.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "Mixins.h"
5 
6 
7 
8 
10  public cYawRotator<cBlockEntityHandler, 0x07, 0x03, 0x04, 0x02, 0x05>
11 {
13 
14 public:
15 
16  using Super::Super;
17 
18 private:
19 
20  virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem * const a_Tool) const override
21  {
22  // Only drop something when mined with a pickaxe:
23  if (
24  (a_Tool != nullptr) &&
26  )
27  {
28  // Only drop self when mined with a silk-touch pickaxe:
30  {
31  return cItem(E_BLOCK_ENDER_CHEST);
32  }
33 
34  return cItem(E_BLOCK_OBSIDIAN, 8);
35  }
36 
37  return {};
38  }
39 
40 };
@ E_BLOCK_OBSIDIAN
Definition: BlockType.h:59
@ E_BLOCK_ENDER_CHEST
Definition: BlockType.h:145
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:44
bool IsPickaxe(short a_ItemType)
Definition: Defines.cpp:414
virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem *const a_Tool) const override
Mixin for blocks whose meta on placement depends on the yaw of the player placing the block.
Definition: Mixins.h:162
cMetaRotator< cBlockEntityHandler, BitMask, North, East, South, West, false > Super
Definition: Mixins.h:163
unsigned int GetLevel(int a_EnchantmentID) const
Returns the level for the specified enchantment; 0 if not stored.
Definition: Item.h:37
cEnchantments m_Enchantments
Definition: Item.h:166
short m_ItemType
Definition: Item.h:163
This class bridges a vector of cItem for safe access via Lua.
Definition: Item.h:215