Cuberite
A lightweight, fast and extensible game server for Minecraft
BlockHandler.cpp
Go to the documentation of this file.
1 
2 #include "Globals.h"
3 #include "BlockHandler.h"
4 #include "../Item.h"
5 #include "../World.h"
6 #include "../Chunk.h"
7 #include "BlockPluginInterface.h"
8 #include "BlockAnvil.h"
9 #include "BlockBed.h"
10 #include "BlockBigFlower.h"
11 #include "BlockBrewingStand.h"
12 #include "BlockButton.h"
13 #include "BlockCactus.h"
14 #include "BlockCake.h"
15 #include "BlockCarpet.h"
16 #include "BlockCauldron.h"
17 #include "BlockChest.h"
18 #include "BlockCloth.h"
19 #include "BlockCobWeb.h"
20 #include "BlockCocoaPod.h"
21 #include "BlockCommandBlock.h"
22 #include "BlockComparator.h"
23 #include "BlockConcretePowder.h"
24 #include "BlockCrops.h"
25 #include "BlockDeadBush.h"
26 #include "BlockDirt.h"
27 #include "BlockDoor.h"
28 #include "BlockDropSpenser.h"
29 #include "BlockEnchantmentTable.h"
30 #include "BlockEnderchest.h"
31 #include "BlockEndPortalFrame.h"
32 #include "BlockEntity.h"
33 #include "BlockFarmland.h"
34 #include "BlockFence.h"
35 #include "BlockFenceGate.h"
36 #include "BlockFire.h"
37 #include "BlockFlower.h"
38 #include "BlockFlowerPot.h"
39 #include "BlockFluid.h"
40 #include "BlockFurnace.h"
41 #include "BlockGlass.h"
42 #include "BlockGlowstone.h"
43 #include "BlockGravel.h"
44 #include "BlockMobHead.h"
45 #include "BlockHopper.h"
46 #include "BlockIce.h"
47 #include "BlockLadder.h"
48 #include "BlockLeaves.h"
49 #include "BlockLilypad.h"
50 #include "BlockLever.h"
51 #include "BlockMelon.h"
52 #include "BlockMobSpawner.h"
53 #include "BlockMushroom.h"
54 #include "BlockMycelium.h"
55 #include "BlockNetherrack.h"
56 #include "BlockNetherWart.h"
57 #include "BlockOre.h"
58 #include "BlockPiston.h"
59 #include "BlockPlanks.h"
60 #include "BlockPortal.h"
61 #include "BlockPumpkin.h"
62 #include "BlockPressurePlate.h"
63 #include "BlockQuartz.h"
64 #include "BlockRail.h"
65 #include "BlockRedstone.h"
66 #include "BlockRedstoneLamp.h"
67 #include "BlockRedstoneRepeater.h"
68 #include "BlockRedstoneTorch.h"
69 #include "BlockTNT.h"
70 #include "BlockTripwire.h"
71 #include "BlockTripwireHook.h"
72 #include "BlockSand.h"
73 #include "BlockSapling.h"
74 #include "BlockSeaLantern.h"
75 #include "BlockSideways.h"
76 #include "BlockSignPost.h"
77 #include "BlockSlab.h"
78 #include "BlockSlime.h"
79 #include "BlockSnow.h"
80 #include "BlockSponge.h"
81 #include "BlockStairs.h"
82 #include "BlockStems.h"
83 #include "BlockStone.h"
84 #include "BlockSugarcane.h"
85 #include "BlockTallGrass.h"
86 #include "BlockTorch.h"
87 #include "BlockTrapdoor.h"
88 #include "BlockVine.h"
89 #include "BlockWallSign.h"
90 #include "BlockWorkbench.h"
91 
92 
93 
94 
95 
96 /*
97 // Tests the meta rotation and mirroring.
98 // Note that the cMetaRotator needs to have its assert paths disabled for this test to work!
99 static class cBlockHandlerRotationTester
100 {
101 public:
102  cBlockHandlerRotationTester(void)
103  {
104  printf("Performing block handlers test...\n");
105  for (BLOCKTYPE Type = 0; Type < E_BLOCK_MAX_TYPE_ID; Type++)
106  {
107  cBlockHandler * Handler = cBlockInfo::GetHandler(Type);
108  if (Handler == nullptr)
109  {
110  printf("nullptr handler for block type %d!\n", Type);
111  continue;
112  }
113  AString BlockName = ItemTypeToString(Type);
114  for (NIBBLETYPE Meta = 0; Meta < 16; Meta++)
115  {
116  // Test the CW / CCW rotations:
117  NIBBLETYPE TestMeta;
118  TestMeta = Handler->MetaRotateCW(Handler->MetaRotateCW(Handler->MetaRotateCW(Handler->MetaRotateCW(Meta))));
119  if (TestMeta != Meta)
120  {
121  // 4 CW rotations should produce no change in the meta
122  printf("Handler for blocktype %d (%s) fails CW 4-rotation test for meta %d: got back %d\n", Type, BlockName.c_str(), Meta, TestMeta);
123  }
124  TestMeta = Handler->MetaRotateCCW(Handler->MetaRotateCCW(Handler->MetaRotateCCW(Handler->MetaRotateCCW(Meta))));
125  if (TestMeta != Meta)
126  {
127  // 4 CCW rotations should produce no change in the meta
128  printf("Handler for blocktype %d (%s) fails CCW 4-rotation test for meta %d: got back %d\n", Type, BlockName.c_str(), Meta, TestMeta);
129  }
130  TestMeta = Handler->MetaRotateCCW(Handler->MetaRotateCW(Meta));
131  if (TestMeta != Meta)
132  {
133  // CCW rotation of a CW rotation should produce no change in the meta
134  printf("Handler for blocktype %d (%s) fails CCW(CW) rotation test for meta %d: got back %d\n", Type, BlockName.c_str(), Meta, TestMeta);
135  }
136  TestMeta = Handler->MetaRotateCW(Handler->MetaRotateCCW(Meta));
137  if (TestMeta != Meta)
138  {
139  // CW rotation of a CCW rotation should produce no change in the meta
140  printf("Handler for blocktype %d (%s) fails CW(CCW) rotation test for meta %d: got back %d\n", Type, BlockName.c_str(), Meta, TestMeta);
141  }
142 
143  // Test the mirroring:
144  TestMeta = Handler->MetaMirrorXY(Handler->MetaMirrorXY(Meta));
145  if (TestMeta != Meta)
146  {
147  // Double-mirroring should produce the same meta:
148  printf("Handler for blocktype %d (%s) fails XY mirror test for meta %d: got back %d\n", Type, BlockName.c_str(), Meta, TestMeta);
149  }
150  TestMeta = Handler->MetaMirrorXZ(Handler->MetaMirrorXZ(Meta));
151  if (TestMeta != Meta)
152  {
153  // Double-mirroring should produce the same meta:
154  printf("Handler for blocktype %d (%s) fails XZ mirror test for meta %d: got back %d\n", Type, BlockName.c_str(), Meta, TestMeta);
155  }
156  TestMeta = Handler->MetaMirrorYZ(Handler->MetaMirrorYZ(Meta));
157  if (TestMeta != Meta)
158  {
159  // Double-mirroring should produce the same meta:
160  printf("Handler for blocktype %d (%s) fails YZ mirror test for meta %d: got back %d\n", Type, BlockName.c_str(), Meta, TestMeta);
161  }
162 
163  // Test mirror-rotating:
164  TestMeta = Handler->MetaRotateCW(Handler->MetaRotateCW(Handler->MetaMirrorXY(Handler->MetaMirrorYZ(Meta))));
165  if (TestMeta != Meta)
166  {
167  // 2 CW rotations should be the same as XY, YZ mirroring:
168  printf("Handler for blocktype %d (%s) fails rotation-mirror test for meta %d: got back %d\n", Type, BlockName.c_str(), Meta, TestMeta);
169  }
170  }
171  } // for Type
172  printf("Block handlers test complete.\n");
173  }
174 } g_BlockHandlerRotationTester;
175 //*/
176 
177 
178 
179 
180 
183 {
184  switch (a_BlockType)
185  {
186  // Block handlers, alphabetically sorted:
187  case E_BLOCK_ACACIA_DOOR: return new cBlockDoorHandler (a_BlockType);
188  case E_BLOCK_ACACIA_FENCE: return new cBlockFenceHandler (a_BlockType);
189  case E_BLOCK_ACACIA_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType);
190  case E_BLOCK_ACACIA_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType);
191  case E_BLOCK_ACTIVATOR_RAIL: return new cBlockRailHandler (a_BlockType);
192  case E_BLOCK_ACTIVE_COMPARATOR: return new cBlockComparatorHandler (a_BlockType);
193  case E_BLOCK_AIR: return new cBlockWithNoDrops<> (a_BlockType);
194  case E_BLOCK_ANVIL: return new cBlockAnvilHandler (a_BlockType);
195  case E_BLOCK_BEACON: return new cBlockEntityHandler (a_BlockType);
196  case E_BLOCK_BED: return new cBlockBedHandler (a_BlockType);
197  case E_BLOCK_BEETROOTS: return new cBlockCropsHandler<3> (a_BlockType); // 4 stages of growth
198  case E_BLOCK_BIG_FLOWER: return new cBlockBigFlowerHandler (a_BlockType);
199  case E_BLOCK_BIRCH_DOOR: return new cBlockDoorHandler (a_BlockType);
200  case E_BLOCK_BIRCH_FENCE: return new cBlockFenceHandler (a_BlockType);
201  case E_BLOCK_BIRCH_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType);
202  case E_BLOCK_BIRCH_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType);
203  case E_BLOCK_BREWING_STAND: return new cBlockBrewingStandHandler (a_BlockType);
204  case E_BLOCK_BRICK_STAIRS: return new cBlockStairsHandler (a_BlockType);
205  case E_BLOCK_BROWN_MUSHROOM: return new cBlockMushroomHandler (a_BlockType);
206  case E_BLOCK_CACTUS: return new cBlockCactusHandler (a_BlockType);
207  case E_BLOCK_CAKE: return new cBlockCakeHandler (a_BlockType);
208  case E_BLOCK_CARPET: return new cBlockCarpetHandler (a_BlockType);
209  case E_BLOCK_CARROTS: return new cBlockCropsHandler<7> (a_BlockType); // 8 stages of growth
210  case E_BLOCK_CAULDRON: return new cBlockCauldronHandler (a_BlockType);
211  case E_BLOCK_CHAIN_COMMAND_BLOCK: return new cBlockCommandBlockHandler (a_BlockType);
212  case E_BLOCK_CHEST: return new cBlockChestHandler (a_BlockType);
213  case E_BLOCK_CLAY: return new cBlockOreHandler (a_BlockType);
214  case E_BLOCK_COAL_ORE: return new cBlockOreHandler (a_BlockType);
215  case E_BLOCK_COBBLESTONE: return new cBlockStoneHandler (a_BlockType);
216  case E_BLOCK_COBBLESTONE_STAIRS: return new cBlockStairsHandler (a_BlockType);
217  case E_BLOCK_COBWEB: return new cBlockCobWebHandler (a_BlockType);
218  case E_BLOCK_COCOA_POD: return new cBlockCocoaPodHandler (a_BlockType);
219  case E_BLOCK_COMMAND_BLOCK: return new cBlockCommandBlockHandler (a_BlockType);
220  case E_BLOCK_CONCRETE_POWDER: return new cBlockConcretePowderHandler (a_BlockType);
221  case E_BLOCK_CROPS: return new cBlockCropsHandler<7> (a_BlockType); // 8 stages of growth
222  case E_BLOCK_DARK_OAK_DOOR: return new cBlockDoorHandler (a_BlockType);
223  case E_BLOCK_DARK_OAK_FENCE: return new cBlockFenceHandler (a_BlockType);
224  case E_BLOCK_DARK_OAK_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType);
225  case E_BLOCK_DARK_OAK_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType);
226  case E_BLOCK_DEAD_BUSH: return new cBlockDeadBushHandler (a_BlockType);
227  case E_BLOCK_DETECTOR_RAIL: return new cBlockRailHandler (a_BlockType);
228  case E_BLOCK_DIAMOND_ORE: return new cBlockOreHandler (a_BlockType);
229  case E_BLOCK_DIRT: return new cBlockDirtHandler (a_BlockType);
230  case E_BLOCK_DISPENSER: return new cBlockDropSpenserHandler (a_BlockType);
231  case E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB: return new cBlockDoubleSlabHandler (a_BlockType);
232  case E_BLOCK_DOUBLE_STONE_SLAB: return new cBlockDoubleSlabHandler (a_BlockType);
233  case E_BLOCK_DOUBLE_WOODEN_SLAB: return new cBlockDoubleSlabHandler (a_BlockType);
234  case E_BLOCK_DROPPER: return new cBlockDropSpenserHandler (a_BlockType);
235  case E_BLOCK_EMERALD_ORE: return new cBlockOreHandler (a_BlockType);
236  case E_BLOCK_ENCHANTMENT_TABLE: return new cBlockEnchantmentTableHandler(a_BlockType);
237  case E_BLOCK_ENDER_CHEST: return new cBlockEnderchestHandler (a_BlockType);
238  case E_BLOCK_END_PORTAL_FRAME: return new cBlockEndPortalFrameHandler (a_BlockType);
239  case E_BLOCK_FARMLAND: return new cBlockFarmlandHandler (a_BlockType);
240  case E_BLOCK_FENCE: return new cBlockFenceHandler (a_BlockType);
241  case E_BLOCK_FIRE: return new cBlockFireHandler (a_BlockType);
242  case E_BLOCK_FLOWER_POT: return new cBlockFlowerPotHandler (a_BlockType);
243  case E_BLOCK_FROSTED_ICE: return new cBlockIceHandler (a_BlockType);
244  case E_BLOCK_FURNACE: return new cBlockFurnaceHandler (a_BlockType);
245  case E_BLOCK_GLASS: return new cBlockGlassHandler (a_BlockType);
246  case E_BLOCK_GLASS_PANE: return new cBlockGlassHandler (a_BlockType);
247  case E_BLOCK_GLOWSTONE: return new cBlockGlowstoneHandler (a_BlockType);
248  case E_BLOCK_GOLD_ORE: return new cBlockOreHandler (a_BlockType);
249  case E_BLOCK_GRASS: return new cBlockDirtHandler (a_BlockType);
250  case E_BLOCK_GRAVEL: return new cBlockGravelHandler (a_BlockType);
251  case E_BLOCK_HAY_BALE: return new cBlockSidewaysHandler (a_BlockType);
252  case E_BLOCK_HEAD: return new cBlockMobHeadHandler (a_BlockType);
254  case E_BLOCK_HOPPER: return new cBlockHopperHandler (a_BlockType);
255  case E_BLOCK_ICE: return new cBlockIceHandler (a_BlockType);
256  case E_BLOCK_INACTIVE_COMPARATOR: return new cBlockComparatorHandler (a_BlockType);
257  case E_BLOCK_IRON_DOOR: return new cBlockDoorHandler (a_BlockType);
258  case E_BLOCK_IRON_ORE: return new cBlockOreHandler (a_BlockType);
259  case E_BLOCK_IRON_TRAPDOOR: return new cBlockTrapdoorHandler (a_BlockType);
260  case E_BLOCK_JACK_O_LANTERN: return new cBlockPumpkinHandler (a_BlockType);
261  case E_BLOCK_JUKEBOX: return new cBlockEntityHandler (a_BlockType);
262  case E_BLOCK_JUNGLE_DOOR: return new cBlockDoorHandler (a_BlockType);
263  case E_BLOCK_JUNGLE_FENCE: return new cBlockFenceHandler (a_BlockType);
264  case E_BLOCK_JUNGLE_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType);
265  case E_BLOCK_JUNGLE_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType);
266  case E_BLOCK_LADDER: return new cBlockLadderHandler (a_BlockType);
267  case E_BLOCK_LAPIS_ORE: return new cBlockOreHandler (a_BlockType);
268  case E_BLOCK_LAVA: return new cBlockLavaHandler (a_BlockType);
269  case E_BLOCK_LEAVES: return new cBlockLeavesHandler (a_BlockType);
270  case E_BLOCK_LEVER: return new cBlockLeverHandler (a_BlockType);
272  case E_BLOCK_LILY_PAD: return new cBlockLilypadHandler (a_BlockType);
273  case E_BLOCK_LIT_FURNACE: return new cBlockFurnaceHandler (a_BlockType);
274  case E_BLOCK_LOG: return new cBlockSidewaysHandler (a_BlockType);
275  case E_BLOCK_MELON: return new cBlockMelonHandler (a_BlockType);
276  case E_BLOCK_MELON_STEM: return new cBlockMelonStemHandler (a_BlockType);
277  case E_BLOCK_MOB_SPAWNER: return new cBlockMobSpawnerHandler (a_BlockType);
278  case E_BLOCK_MYCELIUM: return new cBlockMyceliumHandler (a_BlockType);
279  case E_BLOCK_NETHERRACK: return new cBlockNetherrack (a_BlockType);
280  case E_BLOCK_NETHER_BRICK_FENCE: return new cBlockFenceHandler (a_BlockType);
281  case E_BLOCK_NETHER_BRICK_STAIRS: return new cBlockStairsHandler (a_BlockType);
282  case E_BLOCK_NETHER_PORTAL: return new cBlockPortalHandler (a_BlockType);
283  case E_BLOCK_NETHER_QUARTZ_ORE: return new cBlockOreHandler (a_BlockType);
284  case E_BLOCK_NETHER_WART: return new cBlockNetherWartHandler (a_BlockType);
285  case E_BLOCK_NEW_LEAVES: return new cBlockLeavesHandler (a_BlockType);
286  case E_BLOCK_NEW_LOG: return new cBlockSidewaysHandler (a_BlockType);
287  case E_BLOCK_NOTE_BLOCK: return new cBlockEntityHandler (a_BlockType);
288  case E_BLOCK_OAK_DOOR: return new cBlockDoorHandler (a_BlockType);
289  case E_BLOCK_OAK_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType);
290  case E_BLOCK_OAK_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType);
291  case E_BLOCK_PACKED_ICE: return new cBlockIceHandler (a_BlockType);
292  case E_BLOCK_PISTON: return new cBlockPistonHandler (a_BlockType);
294  case E_BLOCK_PLANKS: return new cBlockPlanksHandler (a_BlockType);
295  case E_BLOCK_POTATOES: return new cBlockCropsHandler<7> (a_BlockType); // 8 stages of growth
296  case E_BLOCK_POWERED_RAIL: return new cBlockRailHandler (a_BlockType);
297  case E_BLOCK_PUMPKIN: return new cBlockPumpkinHandler (a_BlockType);
298  case E_BLOCK_PUMPKIN_STEM: return new cBlockPumpkinStemHandler (a_BlockType);
299  case E_BLOCK_PURPUR_DOUBLE_SLAB: return new cBlockDoubleSlabHandler (a_BlockType);
300  case E_BLOCK_PURPUR_SLAB: return new cBlockSlabHandler (a_BlockType);
301  case E_BLOCK_PURPUR_STAIRS: return new cBlockStairsHandler (a_BlockType);
302  case E_BLOCK_QUARTZ_BLOCK: return new cBlockQuartzHandler (a_BlockType);
303  case E_BLOCK_QUARTZ_STAIRS: return new cBlockStairsHandler (a_BlockType);
304  case E_BLOCK_RAIL: return new cBlockRailHandler (a_BlockType);
305  case E_BLOCK_REDSTONE_LAMP_ON: return new cBlockRedstoneLampHandler (a_BlockType);
306  case E_BLOCK_REDSTONE_ORE: return new cBlockOreHandler (a_BlockType);
307  case E_BLOCK_REDSTONE_ORE_GLOWING: return new cBlockOreHandler (a_BlockType);
308  case E_BLOCK_REDSTONE_REPEATER_OFF: return new cBlockRedstoneRepeaterHandler(a_BlockType);
309  case E_BLOCK_REDSTONE_REPEATER_ON: return new cBlockRedstoneRepeaterHandler(a_BlockType);
310  case E_BLOCK_REDSTONE_TORCH_OFF: return new cBlockRedstoneTorchHandler (a_BlockType);
311  case E_BLOCK_REDSTONE_TORCH_ON: return new cBlockRedstoneTorchHandler (a_BlockType);
312  case E_BLOCK_REDSTONE_WIRE: return new cBlockRedstoneHandler (a_BlockType);
313  case E_BLOCK_RED_MUSHROOM: return new cBlockMushroomHandler (a_BlockType);
314  case E_BLOCK_RED_ROSE: return new cBlockFlowerHandler (a_BlockType);
315  case E_BLOCK_RED_SANDSTONE_SLAB: return new cBlockSlabHandler (a_BlockType);
316  case E_BLOCK_RED_SANDSTONE_STAIRS: return new cBlockStairsHandler (a_BlockType);
317  case E_BLOCK_REPEATING_COMMAND_BLOCK: return new cBlockCommandBlockHandler (a_BlockType);
318  case E_BLOCK_SAND: return new cBlockSandHandler (a_BlockType);
319  case E_BLOCK_SANDSTONE_STAIRS: return new cBlockStairsHandler (a_BlockType);
320  case E_BLOCK_SAPLING: return new cBlockSaplingHandler (a_BlockType);
321  case E_BLOCK_SEA_LANTERN: return new cBlockSeaLanternHandler (a_BlockType);
322  case E_BLOCK_SIGN_POST: return new cBlockSignPostHandler (a_BlockType);
323  case E_BLOCK_SLIME_BLOCK: return new cBlockSlimeHandler (a_BlockType);
324  case E_BLOCK_SNOW: return new cBlockSnowHandler (a_BlockType);
325  case E_BLOCK_SPONGE: return new cBlockSpongeHandler (a_BlockType);
326  case E_BLOCK_SPRUCE_DOOR: return new cBlockDoorHandler (a_BlockType);
327  case E_BLOCK_SPRUCE_FENCE: return new cBlockFenceHandler (a_BlockType);
328  case E_BLOCK_SPRUCE_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType);
329  case E_BLOCK_SPRUCE_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType);
330  case E_BLOCK_STAINED_GLASS: return new cBlockGlassHandler (a_BlockType);
331  case E_BLOCK_STAINED_GLASS_PANE: return new cBlockGlassHandler (a_BlockType);
332  case E_BLOCK_STATIONARY_LAVA: return new cBlockLavaHandler (a_BlockType);
333  case E_BLOCK_STATIONARY_WATER: return new cBlockFluidHandler (a_BlockType);
334  case E_BLOCK_STICKY_PISTON: return new cBlockPistonHandler (a_BlockType);
335  case E_BLOCK_STONE: return new cBlockStoneHandler (a_BlockType);
336  case E_BLOCK_STONE_BRICK_STAIRS: return new cBlockStairsHandler (a_BlockType);
337  case E_BLOCK_STONE_BUTTON: return new cBlockButtonHandler (a_BlockType);
338  case E_BLOCK_STONE_PRESSURE_PLATE: return new cBlockPressurePlateHandler (a_BlockType);
339  case E_BLOCK_STONE_SLAB: return new cBlockSlabHandler (a_BlockType);
340  case E_BLOCK_SUGARCANE: return new cBlockSugarcaneHandler (a_BlockType);
341  case E_BLOCK_TALL_GRASS: return new cBlockTallGrassHandler (a_BlockType);
342  case E_BLOCK_TNT: return new cBlockTNTHandler (a_BlockType);
343  case E_BLOCK_TORCH: return new cBlockTorchHandler (a_BlockType);
344  case E_BLOCK_TRAPDOOR: return new cBlockTrapdoorHandler (a_BlockType);
345  case E_BLOCK_TRAPPED_CHEST: return new cBlockChestHandler (a_BlockType);
346  case E_BLOCK_TRIPWIRE: return new cBlockTripwireHandler (a_BlockType);
347  case E_BLOCK_TRIPWIRE_HOOK: return new cBlockTripwireHookHandler (a_BlockType);
348  case E_BLOCK_VINES: return new cBlockVineHandler (a_BlockType);
349  case E_BLOCK_WALLSIGN: return new cBlockWallSignHandler (a_BlockType);
350  case E_BLOCK_WATER: return new cBlockFluidHandler (a_BlockType);
351  case E_BLOCK_WOODEN_BUTTON: return new cBlockButtonHandler (a_BlockType);
352  case E_BLOCK_WOODEN_PRESSURE_PLATE: return new cBlockPressurePlateHandler (a_BlockType);
353  case E_BLOCK_WOODEN_SLAB: return new cBlockSlabHandler (a_BlockType);
354  case E_BLOCK_WOOL: return new cBlockClothHandler (a_BlockType);
355  case E_BLOCK_WORKBENCH: return new cBlockWorkbenchHandler (a_BlockType);
356  case E_BLOCK_YELLOW_FLOWER: return new cBlockFlowerHandler (a_BlockType);
357 
358  default: return new cBlockHandler(a_BlockType);
359  }
360 }
361 
362 
363 
364 
365 
367 // cBlockHandler:
368 
370 {
371  m_BlockType = a_BlockType;
372 }
373 
374 
375 
376 
377 
379  cChunkInterface & a_ChunkInterface, cPlayer & a_Player,
380  int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
381  int a_CursorX, int a_CursorY, int a_CursorZ,
382  BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
383 )
384 {
385  // By default, all blocks can be placed and the meta is copied over from the item's damage value:
386  a_BlockType = m_BlockType;
387  a_BlockMeta = static_cast<NIBBLETYPE>(a_Player.GetEquippedItem().m_ItemDamage & 0x0f);
388  return true;
389 }
390 
391 
392 
393 
394 
395 void cBlockHandler::OnUpdate(cChunkInterface & cChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_PluginInterface, cChunk & a_Chunk, int a_BlockX, int a_BlockY, int a_BlockZ)
396 {
397 }
398 
399 
400 
401 
402 
403 void cBlockHandler::OnPlacedByPlayer(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer & a_Player, const sSetBlock & a_BlockChange)
404 {
405  OnPlaced(a_ChunkInterface, a_WorldInterface, a_BlockChange.GetPos(), a_BlockChange.m_BlockType, a_BlockChange.m_BlockMeta);
406 }
407 
408 
409 
410 
411 
412 void cBlockHandler::OnPlaced(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
413 {
414  // Notify the neighbors
415  NeighborChanged(a_ChunkInterface, a_BlockPos.addedX(-1), BLOCK_FACE_XP);
416  NeighborChanged(a_ChunkInterface, a_BlockPos.addedX( 1), BLOCK_FACE_XM);
417  NeighborChanged(a_ChunkInterface, a_BlockPos.addedY(-1), BLOCK_FACE_YP);
418  NeighborChanged(a_ChunkInterface, a_BlockPos.addedY( 1), BLOCK_FACE_YM);
419  NeighborChanged(a_ChunkInterface, a_BlockPos.addedZ(-1), BLOCK_FACE_ZP);
420  NeighborChanged(a_ChunkInterface, a_BlockPos.addedZ( 1), BLOCK_FACE_ZM);
421 }
422 
423 
424 
425 
426 
427 void cBlockHandler::OnBroken(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta)
428 {
429  // Notify the neighbors
430  NeighborChanged(a_ChunkInterface, a_BlockPos.addedX(-1), BLOCK_FACE_XP);
431  NeighborChanged(a_ChunkInterface, a_BlockPos.addedX( 1), BLOCK_FACE_XM);
432  NeighborChanged(a_ChunkInterface, a_BlockPos.addedY(-1), BLOCK_FACE_YP);
433  NeighborChanged(a_ChunkInterface, a_BlockPos.addedY( 1), BLOCK_FACE_YM);
434  NeighborChanged(a_ChunkInterface, a_BlockPos.addedZ(-1), BLOCK_FACE_ZP);
435  NeighborChanged(a_ChunkInterface, a_BlockPos.addedZ( 1), BLOCK_FACE_ZM);
436 }
437 
438 
439 
440 
441 
442 void cBlockHandler::NeighborChanged(cChunkInterface & a_ChunkInterface, Vector3i a_NeighborPos, eBlockFace a_WhichNeighbor)
443 {
444  if (!cChunkDef::IsValidHeight(a_NeighborPos.y))
445  {
446  return;
447  }
448 
449  cBlockInfo::GetHandler(a_ChunkInterface.GetBlock(a_NeighborPos))->OnNeighborChanged(a_ChunkInterface, a_NeighborPos, a_WhichNeighbor);
450 }
451 
452 
453 
454 
455 
457  NIBBLETYPE a_BlockMeta,
458  cBlockEntity * a_BlockEntity,
459  const cEntity * a_Digger,
460  const cItem * a_Tool
461 )
462 {
463  UNUSED(a_BlockEntity);
464  UNUSED(a_Digger);
465  UNUSED(a_Tool);
466 
467  // Add self:
468  cItems res;
469  res.push_back(cItem(m_BlockType, 1, a_BlockMeta));
470  return res;
471 }
472 
473 
474 
475 
476 
477 bool cBlockHandler::CanBeAt(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ, const cChunk & a_Chunk)
478 {
479  return true;
480 }
481 
482 
483 
484 
485 
487 {
488  return false;
489 }
490 
491 
492 
493 
494 
496 {
497  return false;
498 }
499 
500 
501 
502 
503 
504 bool cBlockHandler::DoesIgnoreBuildCollision(cChunkInterface & a_ChunkInterface, Vector3i a_Pos, cPlayer & a_Player, NIBBLETYPE a_Meta)
505 {
506  return (m_BlockType == E_BLOCK_AIR);
507 }
508 
509 
510 
511 
512 
514 {
515  return true;
516 }
517 
518 
519 
520 
521 
522 /* default functionality: only test for height, since we assume full voxels with varying height */
523 bool cBlockHandler::IsInsideBlock(Vector3d a_Position, const BLOCKTYPE a_BlockType, const NIBBLETYPE a_BlockMeta)
524 {
525  return a_Position.y < cBlockInfo::GetBlockHeight(a_BlockType);
526 }
527 
528 
529 
530 
531 
533 {
535  {
536  // Non-solid things can be placed within entities
537  return cBoundingBox(0, 0, 0, 0, 0, 0);
538  }
539  return cBoundingBox(0, 1, 0, cBlockInfo::GetBlockHeight(m_BlockType), 0, 1);
540 }
541 
542 
543 
544 
545 
547  cChunkInterface & a_ChunkInterface, cBlockPluginInterface & a_PluginInterface,
548  Vector3i a_RelPos,
549  cChunk & a_Chunk
550 )
551 {
552  if (!CanBeAt(a_ChunkInterface, a_RelPos.x, a_RelPos.y, a_RelPos.z, a_Chunk))
553  {
554  if (DoesDropOnUnsuitable())
555  {
556  a_ChunkInterface.DropBlockAsPickups(a_Chunk.RelativeToAbsolute(a_RelPos));
557  }
558  else
559  {
560  a_Chunk.SetBlock(a_RelPos, E_BLOCK_AIR, 0);
561  }
562  }
563  else
564  {
565  // Wake up the simulators for this block:
566  auto absPos = a_Chunk.RelativeToAbsolute(a_RelPos);
567  a_Chunk.GetWorld()->GetSimulatorManager()->WakeUp(absPos, &a_Chunk);
568  }
569 }
570 
571 
572 
573 
574 
576 {
577  // Zero for transparent
578  return 0;
579 }
580 
581 
582 
583 
584 
586 {
587  return ((a_Tool != nullptr) && (a_Tool->m_Enchantments.GetLevel(cEnchantments::enchSilkTouch) > 0));
588 }
589 
590 
591 
592 
593 
595 {
596  return ::CreateBlockHandler(aBlockType);
597 }
598 
599 
600 
601 
602 
604 // Temporary:
605 
607 {
608  static struct
609  {
610  const char * newBlockTypeName;
611  BLOCKTYPE oldBlockType;
612  } regs[] =
613  {
614  {"minecraft:acacia_button", E_BLOCK_WOODEN_BUTTON},
615  {"minecraft:acacia_door", E_BLOCK_ACACIA_DOOR},
616  {"minecraft:acacia_fence", E_BLOCK_ACACIA_FENCE},
617  {"minecraft:acacia_fence_gate", E_BLOCK_ACACIA_FENCE_GATE},
618  {"minecraft:acacia_leaves", E_BLOCK_LEAVES},
619  {"minecraft:acacia_log", E_BLOCK_LOG},
620  {"minecraft:acacia_planks", E_BLOCK_PLANKS},
621  {"minecraft:acacia_pressure_plate", E_BLOCK_WOODEN_PRESSURE_PLATE},
622  {"minecraft:acacia_sapling", E_BLOCK_SAPLING},
623  {"minecraft:acacia_sign", E_BLOCK_SIGN_POST},
624  {"minecraft:acacia_slab", E_BLOCK_WOODEN_SLAB},
625  {"minecraft:acacia_stairs", E_BLOCK_ACACIA_WOOD_STAIRS},
626  {"minecraft:acacia_trapdoor", E_BLOCK_TRAPDOOR},
627  {"minecraft:acacia_wall_sign", E_BLOCK_WALLSIGN},
628  {"minecraft:acacia_wood", E_BLOCK_UNFINISHED},
629  {"minecraft:activator_rail", E_BLOCK_ACTIVATOR_RAIL},
630  {"minecraft:air", E_BLOCK_AIR},
631  {"minecraft:allium", E_BLOCK_FLOWER},
632  {"minecraft:andesite", E_BLOCK_UNFINISHED},
633  {"minecraft:andesite_slab", E_BLOCK_STONE_SLAB},
634  {"minecraft:andesite_stairs", E_BLOCK_COBBLESTONE_STAIRS},
635  {"minecraft:andesite_wall", E_BLOCK_COBBLESTONE_WALL},
636  {"minecraft:anvil", E_BLOCK_ANVIL},
637  {"minecraft:attached_melon_stem", E_BLOCK_MELON_STEM},
638  {"minecraft:attached_pumpkin_stem", E_BLOCK_PUMPKIN_STEM},
639  {"minecraft:azure_bluet", E_BLOCK_FLOWER},
640  {"minecraft:bamboo", E_BLOCK_UNFINISHED},
641  {"minecraft:bamboo_sapling", E_BLOCK_SAPLING},
642  {"minecraft:barrel", E_BLOCK_UNFINISHED},
643  {"minecraft:barrier", E_BLOCK_BARRIER},
644  {"minecraft:beacon", E_BLOCK_BEACON},
645  {"minecraft:bedrock", E_BLOCK_BEDROCK},
646  {"minecraft:beetroots", E_BLOCK_BEETROOTS},
647  {"minecraft:bell", E_BLOCK_UNFINISHED},
648  {"minecraft:birch_button", E_BLOCK_WOODEN_BUTTON},
649  {"minecraft:birch_door", E_BLOCK_ACACIA_DOOR},
650  {"minecraft:birch_fence", E_BLOCK_ACACIA_FENCE},
651  {"minecraft:birch_fence_gate", E_BLOCK_ACACIA_FENCE_GATE},
652  {"minecraft:birch_leaves", E_BLOCK_LEAVES},
653  {"minecraft:birch_log", E_BLOCK_LOG},
654  {"minecraft:birch_planks", E_BLOCK_PLANKS},
655  {"minecraft:birch_pressure_plate", E_BLOCK_WOODEN_PRESSURE_PLATE},
656  {"minecraft:birch_sapling", E_BLOCK_SAPLING},
657  {"minecraft:birch_sign", E_BLOCK_SIGN_POST},
658  {"minecraft:birch_slab", E_BLOCK_WOODEN_SLAB},
659  {"minecraft:birch_stairs", E_BLOCK_BIRCH_WOOD_STAIRS},
660  {"minecraft:birch_trapdoor", E_BLOCK_TRAPDOOR},
661  {"minecraft:birch_wall_sign", E_BLOCK_WALLSIGN},
662  {"minecraft:birch_wood", E_BLOCK_UNFINISHED},
663  {"minecraft:black_banner", E_BLOCK_STANDING_BANNER},
664  {"minecraft:black_bed", E_BLOCK_BED},
665  {"minecraft:black_carpet", E_BLOCK_CARPET},
666  {"minecraft:black_concrete", E_BLOCK_CONCRETE},
667  {"minecraft:black_concrete_powder", E_BLOCK_CONCRETE_POWDER},
668  {"minecraft:black_glazed_terracotta", E_BLOCK_UNFINISHED},
669  {"minecraft:black_shulker_box", E_BLOCK_BLACK_SHULKER_BOX},
670  {"minecraft:black_stained_glass", E_BLOCK_STAINED_GLASS},
671  {"minecraft:black_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
672  {"minecraft:black_terracotta", E_BLOCK_TERRACOTTA},
673  {"minecraft:black_wall_banner", E_BLOCK_WALL_BANNER},
674  {"minecraft:black_wool", E_BLOCK_WOOL},
675  {"minecraft:blast_furnace", E_BLOCK_UNFINISHED},
676  {"minecraft:blue_banner", E_BLOCK_STANDING_BANNER},
677  {"minecraft:blue_bed", E_BLOCK_BED},
678  {"minecraft:blue_carpet", E_BLOCK_CARPET},
679  {"minecraft:blue_concrete", E_BLOCK_CONCRETE},
680  {"minecraft:blue_concrete_powder", E_BLOCK_CONCRETE_POWDER},
681  {"minecraft:blue_glazed_terracotta", E_BLOCK_UNFINISHED},
682  {"minecraft:blue_ice", E_BLOCK_UNFINISHED},
683  {"minecraft:blue_orchid", E_BLOCK_FLOWER},
684  {"minecraft:blue_shulker_box", E_BLOCK_BLUE_SHULKER_BOX},
685  {"minecraft:blue_stained_glass", E_BLOCK_STAINED_GLASS},
686  {"minecraft:blue_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
687  {"minecraft:blue_terracotta", E_BLOCK_TERRACOTTA},
688  {"minecraft:blue_wall_banner", E_BLOCK_WALL_BANNER},
689  {"minecraft:blue_wool", E_BLOCK_WOOL},
690  {"minecraft:bone_block", E_BLOCK_BONE_BLOCK},
691  {"minecraft:bookshelf", E_BLOCK_BOOKCASE},
692  {"minecraft:brain_coral", E_BLOCK_UNFINISHED},
693  {"minecraft:brain_coral_block", E_BLOCK_UNFINISHED},
694  {"minecraft:brain_coral_fan", E_BLOCK_UNFINISHED},
695  {"minecraft:brain_coral_wall_fan", E_BLOCK_UNFINISHED},
696  {"minecraft:brewing_stand", E_BLOCK_BREWING_STAND},
697  {"minecraft:brick_slab", E_BLOCK_WOODEN_SLAB},
698  {"minecraft:brick_stairs", E_BLOCK_BRICK_STAIRS},
699  {"minecraft:brick_wall", E_BLOCK_COBBLESTONE_WALL},
700  {"minecraft:bricks", E_BLOCK_BRICK},
701  {"minecraft:brown_banner", E_BLOCK_STANDING_BANNER},
702  {"minecraft:brown_bed", E_BLOCK_BED},
703  {"minecraft:brown_carpet", E_BLOCK_CARPET},
704  {"minecraft:brown_concrete", E_BLOCK_CONCRETE},
705  {"minecraft:brown_concrete_powder", E_BLOCK_CONCRETE_POWDER},
706  {"minecraft:brown_glazed_terracotta", E_BLOCK_BROWN_GLAZED_TERRACOTTA},
707  {"minecraft:brown_mushroom", E_BLOCK_BROWN_MUSHROOM},
708  {"minecraft:brown_mushroom_block", E_BLOCK_HUGE_BROWN_MUSHROOM},
709  {"minecraft:brown_shulker_box", E_BLOCK_BROWN_SHULKER_BOX},
710  {"minecraft:brown_stained_glass", E_BLOCK_STAINED_GLASS},
711  {"minecraft:brown_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
712  {"minecraft:brown_terracotta", E_BLOCK_TERRACOTTA},
713  {"minecraft:brown_wall_banner", E_BLOCK_WALL_BANNER},
714  {"minecraft:brown_wool", E_BLOCK_WOOL},
715  {"minecraft:bubble_column", E_BLOCK_UNFINISHED},
716  {"minecraft:bubble_coral", E_BLOCK_UNFINISHED},
717  {"minecraft:bubble_coral_block", E_BLOCK_UNFINISHED},
718  {"minecraft:bubble_coral_fan", E_BLOCK_UNFINISHED},
719  {"minecraft:bubble_coral_wall_fan", E_BLOCK_UNFINISHED},
720  {"minecraft:cactus", E_BLOCK_CACTUS},
721  {"minecraft:cake", E_BLOCK_CAKE},
722  {"minecraft:campfire", E_BLOCK_UNFINISHED},
723  {"minecraft:carrots", E_BLOCK_CARROTS},
724  {"minecraft:cartography_table", E_BLOCK_UNFINISHED},
725  {"minecraft:carved_pumpkin", E_BLOCK_UNFINISHED},
726  {"minecraft:cauldron", E_BLOCK_CAULDRON},
727  {"minecraft:cave_air", E_BLOCK_UNFINISHED},
728  {"minecraft:chain_command_block", E_BLOCK_COMMAND_BLOCK},
729  {"minecraft:chest", E_BLOCK_CHEST},
730  {"minecraft:chipped_anvil", E_BLOCK_ANVIL},
731  {"minecraft:chiseled_quartz_block", E_BLOCK_QUARTZ_BLOCK},
732  {"minecraft:chiseled_red_sandstone", E_BLOCK_RED_SANDSTONE},
733  {"minecraft:chiseled_sandstone", E_BLOCK_SANDSTONE},
734  {"minecraft:chiseled_stone_bricks", E_BLOCK_STONE_BRICKS},
735  {"minecraft:chorus_flower", E_BLOCK_CHORUS_FLOWER},
736  {"minecraft:chorus_plant", E_BLOCK_CHORUS_PLANT},
737  {"minecraft:clay", E_BLOCK_CLAY},
738  {"minecraft:coal_block", E_BLOCK_BLOCK_OF_COAL},
739  {"minecraft:coal_ore", E_BLOCK_COAL_ORE},
740  {"minecraft:coarse_dirt", E_BLOCK_DIRT},
741  {"minecraft:cobblestone", E_BLOCK_COBBLESTONE},
742  {"minecraft:cobblestone_slab", E_BLOCK_WOODEN_SLAB},
743  {"minecraft:cobblestone_stairs", E_BLOCK_COBBLESTONE_STAIRS},
744  {"minecraft:cobblestone_wall", E_BLOCK_COBBLESTONE_WALL},
745  {"minecraft:cobweb", E_BLOCK_COBWEB},
746  {"minecraft:cocoa", E_BLOCK_COCOA_POD},
747  {"minecraft:command_block", E_BLOCK_COMMAND_BLOCK},
748  {"minecraft:comparator", E_BLOCK_UNFINISHED}, // We only have active / inactive blocks
749  {"minecraft:composter", E_BLOCK_UNFINISHED},
750  {"minecraft:conduit", E_BLOCK_UNFINISHED},
751  {"minecraft:cornflower", E_BLOCK_FLOWER},
752  {"minecraft:cracked_stone_bricks", E_BLOCK_STONE_BRICKS},
753  {"minecraft:crafting_table", E_BLOCK_CRAFTING_TABLE},
754  {"minecraft:creeper_head", E_BLOCK_HEAD},
755  {"minecraft:creeper_wall_head", E_BLOCK_HEAD},
756  {"minecraft:cut_red_sandstone", E_BLOCK_RED_SANDSTONE},
757  {"minecraft:cut_red_sandstone_slab", E_BLOCK_RED_SANDSTONE_SLAB},
758  {"minecraft:cut_sandstone", E_BLOCK_SANDSTONE},
759  {"minecraft:cut_sandstone_slab", E_BLOCK_RED_SANDSTONE_SLAB},
760  {"minecraft:cyan_banner", E_BLOCK_STANDING_BANNER},
761  {"minecraft:cyan_bed", E_BLOCK_BED},
762  {"minecraft:cyan_carpet", E_BLOCK_CARPET},
763  {"minecraft:cyan_concrete", E_BLOCK_CONCRETE},
764  {"minecraft:cyan_concrete_powder", E_BLOCK_CONCRETE_POWDER},
765  {"minecraft:cyan_glazed_terracotta", E_BLOCK_CYAN_GLAZED_TERRACOTTA},
766  {"minecraft:cyan_shulker_box", E_BLOCK_CYAN_SHULKER_BOX},
767  {"minecraft:cyan_stained_glass", E_BLOCK_STAINED_GLASS},
768  {"minecraft:cyan_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
769  {"minecraft:cyan_terracotta", E_BLOCK_TERRACOTTA},
770  {"minecraft:cyan_wall_banner", E_BLOCK_WALL_BANNER},
771  {"minecraft:cyan_wool", E_BLOCK_WOOL},
772  {"minecraft:damaged_anvil", E_BLOCK_ANVIL},
773  {"minecraft:dandelion", E_BLOCK_FLOWER},
774  {"minecraft:dark_oak_button", E_BLOCK_WOODEN_BUTTON},
775  {"minecraft:dark_oak_door", E_BLOCK_WOODEN_DOOR},
776  {"minecraft:dark_oak_fence", E_BLOCK_FENCE},
777  {"minecraft:dark_oak_fence_gate", E_BLOCK_FENCE_GATE},
778  {"minecraft:dark_oak_leaves", E_BLOCK_LEAVES},
779  {"minecraft:dark_oak_log", E_BLOCK_LOG},
780  {"minecraft:dark_oak_planks", E_BLOCK_PLANKS},
781  {"minecraft:dark_oak_pressure_plate", E_BLOCK_WOODEN_PRESSURE_PLATE},
782  {"minecraft:dark_oak_sapling", E_BLOCK_SAPLING},
783  {"minecraft:dark_oak_sign", E_BLOCK_SIGN_POST},
784  {"minecraft:dark_oak_slab", E_BLOCK_WOODEN_SLAB},
785  {"minecraft:dark_oak_stairs", E_BLOCK_WOODEN_STAIRS},
786  {"minecraft:dark_oak_trapdoor", E_BLOCK_TRAPDOOR},
787  {"minecraft:dark_oak_wall_sign", E_BLOCK_WALLSIGN},
788  {"minecraft:dark_oak_wood", E_BLOCK_UNFINISHED},
789  {"minecraft:dark_prismarine", E_BLOCK_PRISMARINE_BLOCK},
790  {"minecraft:dark_prismarine_slab", E_BLOCK_UNFINISHED},
791  {"minecraft:dark_prismarine_stairs", E_BLOCK_UNFINISHED},
792  {"minecraft:daylight_detector", E_BLOCK_DAYLIGHT_SENSOR},
793  {"minecraft:dead_brain_coral", E_BLOCK_UNFINISHED},
794  {"minecraft:dead_brain_coral_block", E_BLOCK_UNFINISHED},
795  {"minecraft:dead_brain_coral_fan", E_BLOCK_UNFINISHED},
796  {"minecraft:dead_brain_coral_wall_fan", E_BLOCK_UNFINISHED},
797  {"minecraft:dead_bubble_coral", E_BLOCK_UNFINISHED},
798  {"minecraft:dead_bubble_coral_block", E_BLOCK_UNFINISHED},
799  {"minecraft:dead_bubble_coral_fan", E_BLOCK_UNFINISHED},
800  {"minecraft:dead_bubble_coral_wall_fan", E_BLOCK_UNFINISHED},
801  {"minecraft:dead_bush", E_BLOCK_DEAD_BUSH},
802  {"minecraft:dead_fire_coral", E_BLOCK_UNFINISHED},
803  {"minecraft:dead_fire_coral_block", E_BLOCK_UNFINISHED},
804  {"minecraft:dead_fire_coral_fan", E_BLOCK_UNFINISHED},
805  {"minecraft:dead_fire_coral_wall_fan", E_BLOCK_UNFINISHED},
806  {"minecraft:dead_horn_coral", E_BLOCK_UNFINISHED},
807  {"minecraft:dead_horn_coral_block", E_BLOCK_UNFINISHED},
808  {"minecraft:dead_horn_coral_fan", E_BLOCK_UNFINISHED},
809  {"minecraft:dead_horn_coral_wall_fan", E_BLOCK_UNFINISHED},
810  {"minecraft:dead_tube_coral", E_BLOCK_UNFINISHED},
811  {"minecraft:dead_tube_coral_block", E_BLOCK_UNFINISHED},
812  {"minecraft:dead_tube_coral_fan", E_BLOCK_UNFINISHED},
813  {"minecraft:dead_tube_coral_wall_fan", E_BLOCK_UNFINISHED},
814  {"minecraft:detector_rail", E_BLOCK_DETECTOR_RAIL},
815  {"minecraft:diamond_block", E_BLOCK_DIAMOND_BLOCK},
816  {"minecraft:diamond_ore", E_BLOCK_DIAMOND_ORE},
817  {"minecraft:diorite", E_BLOCK_UNFINISHED},
818  {"minecraft:diorite_slab", E_BLOCK_STONE_SLAB},
819  {"minecraft:diorite_stairs", E_BLOCK_COBBLESTONE_STAIRS},
820  {"minecraft:diorite_wall", E_BLOCK_COBBLESTONE_WALL},
821  {"minecraft:dirt", E_BLOCK_DIRT},
822  {"minecraft:dispenser", E_BLOCK_DISPENSER},
823  {"minecraft:dragon_egg", E_BLOCK_DRAGON_EGG},
824  {"minecraft:dragon_head", E_BLOCK_UNFINISHED},
825  {"minecraft:dragon_wall_head", E_BLOCK_UNFINISHED},
826  {"minecraft:dried_kelp_block", E_BLOCK_UNFINISHED},
827  {"minecraft:dropper", E_BLOCK_DROPPER},
828  {"minecraft:emerald_block", E_BLOCK_EMERALD_BLOCK},
829  {"minecraft:emerald_ore", E_BLOCK_EMERALD_ORE},
830  {"minecraft:enchanting_table", E_BLOCK_ENCHANTMENT_TABLE},
831  {"minecraft:end_gateway", E_BLOCK_END_GATEWAY},
832  {"minecraft:end_portal", E_BLOCK_END_PORTAL},
833  {"minecraft:end_portal_frame", E_BLOCK_END_PORTAL_FRAME},
834  {"minecraft:end_rod", E_BLOCK_END_ROD},
835  {"minecraft:end_stone", E_BLOCK_END_STONE},
836  {"minecraft:end_stone_brick_slab", E_BLOCK_STONE_SLAB},
837  {"minecraft:end_stone_brick_stairs", E_BLOCK_COBBLESTONE_STAIRS},
838  {"minecraft:end_stone_brick_wall", E_BLOCK_COBBLESTONE_WALL},
839  {"minecraft:end_stone_bricks", E_BLOCK_UNFINISHED},
840  {"minecraft:ender_chest", E_BLOCK_ENDER_CHEST},
841  {"minecraft:farmland", E_BLOCK_FARMLAND},
842  {"minecraft:fern", E_BLOCK_TALL_GRASS},
843  {"minecraft:fire", E_BLOCK_FIRE},
844  {"minecraft:fire_coral", E_BLOCK_UNFINISHED},
845  {"minecraft:fire_coral_block", E_BLOCK_UNFINISHED},
846  {"minecraft:fire_coral_fan", E_BLOCK_UNFINISHED},
847  {"minecraft:fire_coral_wall_fan", E_BLOCK_UNFINISHED},
848  {"minecraft:fletching_table", E_BLOCK_UNFINISHED},
849  {"minecraft:flower_pot", E_BLOCK_FLOWER_POT},
850  {"minecraft:frosted_ice", E_BLOCK_FROSTED_ICE},
851  {"minecraft:furnace", E_BLOCK_FURNACE},
852  {"minecraft:glass", E_BLOCK_GLASS},
853  {"minecraft:glass_pane", E_BLOCK_GLASS_PANE},
854  {"minecraft:glowstone", E_BLOCK_GLOWSTONE},
855  {"minecraft:gold_block", E_BLOCK_GOLD_BLOCK},
856  {"minecraft:gold_ore", E_BLOCK_GOLD_ORE},
857  {"minecraft:granite", E_BLOCK_UNFINISHED},
858  {"minecraft:granite_slab", E_BLOCK_STONE_SLAB},
859  {"minecraft:granite_stairs", E_BLOCK_COBBLESTONE_STAIRS},
860  {"minecraft:granite_wall", E_BLOCK_COBBLESTONE_WALL},
861  {"minecraft:grass", E_BLOCK_TALL_GRASS},
862  {"minecraft:grass_block", E_BLOCK_GRASS},
863  {"minecraft:grass_path", E_BLOCK_UNFINISHED},
864  {"minecraft:gravel", E_BLOCK_GRAVEL},
865  {"minecraft:gray_banner", E_BLOCK_STANDING_BANNER},
866  {"minecraft:gray_bed", E_BLOCK_BED},
867  {"minecraft:gray_carpet", E_BLOCK_CARPET},
868  {"minecraft:gray_concrete", E_BLOCK_CONCRETE},
869  {"minecraft:gray_concrete_powder", E_BLOCK_CONCRETE_POWDER},
870  {"minecraft:gray_glazed_terracotta", E_BLOCK_GRAY_GLAZED_TERRACOTTA},
871  {"minecraft:gray_shulker_box", E_BLOCK_GRAY_SHULKER_BOX},
872  {"minecraft:gray_stained_glass", E_BLOCK_STAINED_GLASS},
873  {"minecraft:gray_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
874  {"minecraft:gray_terracotta", E_BLOCK_TERRACOTTA},
875  {"minecraft:gray_wall_banner", E_BLOCK_WALL_BANNER},
876  {"minecraft:gray_wool", E_BLOCK_WOOL},
877  {"minecraft:green_banner", E_BLOCK_STANDING_BANNER},
878  {"minecraft:green_bed", E_BLOCK_BED},
879  {"minecraft:green_carpet", E_BLOCK_CARPET},
880  {"minecraft:green_concrete", E_BLOCK_CONCRETE},
881  {"minecraft:green_concrete_powder", E_BLOCK_CONCRETE_POWDER},
882  {"minecraft:green_glazed_terracotta", E_BLOCK_GREEN_GLAZED_TERRACOTTA},
883  {"minecraft:green_shulker_box", E_BLOCK_GREEN_SHULKER_BOX},
884  {"minecraft:green_stained_glass", E_BLOCK_STAINED_GLASS},
885  {"minecraft:green_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
886  {"minecraft:green_terracotta", E_BLOCK_TERRACOTTA},
887  {"minecraft:green_wall_banner", E_BLOCK_WALL_BANNER},
888  {"minecraft:green_wool", E_BLOCK_WOOL},
889  {"minecraft:grindstone", E_BLOCK_UNFINISHED},
890  {"minecraft:hay_block", E_BLOCK_HAY_BALE},
891  {"minecraft:heavy_weighted_pressure_plate", E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE},
892  {"minecraft:hopper", E_BLOCK_HOPPER},
893  {"minecraft:horn_coral", E_BLOCK_UNFINISHED},
894  {"minecraft:horn_coral_block", E_BLOCK_UNFINISHED},
895  {"minecraft:horn_coral_fan", E_BLOCK_UNFINISHED},
896  {"minecraft:horn_coral_wall_fan", E_BLOCK_UNFINISHED},
897  {"minecraft:ice", E_BLOCK_ICE},
898  {"minecraft:infested_chiseled_stone_bricks", E_BLOCK_SILVERFISH_EGG},
899  {"minecraft:infested_cobblestone", E_BLOCK_SILVERFISH_EGG},
900  {"minecraft:infested_cracked_stone_bricks", E_BLOCK_SILVERFISH_EGG},
901  {"minecraft:infested_mossy_stone_bricks", E_BLOCK_SILVERFISH_EGG},
902  {"minecraft:infested_stone", E_BLOCK_SILVERFISH_EGG},
903  {"minecraft:infested_stone_bricks", E_BLOCK_SILVERFISH_EGG},
904  {"minecraft:iron_bars", E_BLOCK_IRON_BARS},
905  {"minecraft:iron_block", E_BLOCK_IRON_BLOCK},
906  {"minecraft:iron_door", E_BLOCK_IRON_DOOR},
907  {"minecraft:iron_ore", E_BLOCK_IRON_ORE},
908  {"minecraft:iron_trapdoor", E_BLOCK_IRON_TRAPDOOR},
909  {"minecraft:jack_o_lantern", E_BLOCK_JACK_O_LANTERN},
910  {"minecraft:jigsaw", E_BLOCK_UNFINISHED},
911  {"minecraft:jukebox", E_BLOCK_JUKEBOX},
912  {"minecraft:jungle_button", E_BLOCK_WOODEN_BUTTON},
913  {"minecraft:jungle_door", E_BLOCK_WOODEN_DOOR},
914  {"minecraft:jungle_fence", E_BLOCK_FENCE},
915  {"minecraft:jungle_fence_gate", E_BLOCK_FENCE_GATE},
916  {"minecraft:jungle_leaves", E_BLOCK_LEAVES},
917  {"minecraft:jungle_log", E_BLOCK_LOG},
918  {"minecraft:jungle_planks", E_BLOCK_PLANKS},
919  {"minecraft:jungle_pressure_plate", E_BLOCK_WOODEN_PRESSURE_PLATE},
920  {"minecraft:jungle_sapling", E_BLOCK_SAPLING},
921  {"minecraft:jungle_sign", E_BLOCK_SIGN_POST},
922  {"minecraft:jungle_slab", E_BLOCK_WOODEN_SLAB},
923  {"minecraft:jungle_stairs", E_BLOCK_WOODEN_STAIRS},
924  {"minecraft:jungle_trapdoor", E_BLOCK_TRAPDOOR},
925  {"minecraft:jungle_wall_sign", E_BLOCK_WALLSIGN},
926  {"minecraft:jungle_wood", E_BLOCK_UNFINISHED},
927  {"minecraft:kelp", E_BLOCK_UNFINISHED},
928  {"minecraft:kelp_plant", E_BLOCK_UNFINISHED},
929  {"minecraft:ladder", E_BLOCK_LADDER},
930  {"minecraft:lantern", E_BLOCK_UNFINISHED},
931  {"minecraft:lapis_block", E_BLOCK_LAPIS_BLOCK},
932  {"minecraft:lapis_ore", E_BLOCK_LAPIS_ORE},
933  {"minecraft:large_fern", E_BLOCK_BIG_FLOWER},
934  {"minecraft:lava", E_BLOCK_LAVA},
935  {"minecraft:lectern", E_BLOCK_UNFINISHED},
936  {"minecraft:lever", E_BLOCK_LEVER},
937  {"minecraft:light_blue_banner", E_BLOCK_STANDING_BANNER},
938  {"minecraft:light_blue_bed", E_BLOCK_BED},
939  {"minecraft:light_blue_carpet", E_BLOCK_CARPET},
940  {"minecraft:light_blue_concrete", E_BLOCK_CONCRETE},
941  {"minecraft:light_blue_concrete_powder", E_BLOCK_CONCRETE_POWDER},
942  {"minecraft:light_blue_glazed_terracotta", E_BLOCK_LIGHT_BLUE_GLAZED_TERRACOTTA},
943  {"minecraft:light_blue_shulker_box", E_BLOCK_LIGHT_BLUE_SHULKER_BOX},
944  {"minecraft:light_blue_stained_glass", E_BLOCK_STAINED_GLASS},
945  {"minecraft:light_blue_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
946  {"minecraft:light_blue_terracotta", E_BLOCK_TERRACOTTA},
947  {"minecraft:light_blue_wall_banner", E_BLOCK_WALL_BANNER},
948  {"minecraft:light_blue_wool", E_BLOCK_WOOL},
949  {"minecraft:light_gray_banner", E_BLOCK_STANDING_BANNER},
950  {"minecraft:light_gray_bed", E_BLOCK_BED},
951  {"minecraft:light_gray_carpet", E_BLOCK_CARPET},
952  {"minecraft:light_gray_concrete", E_BLOCK_CONCRETE},
953  {"minecraft:light_gray_concrete_powder", E_BLOCK_CONCRETE_POWDER},
954  {"minecraft:light_gray_glazed_terracotta", E_BLOCK_LIGHT_GRAY_GLAZED_TERRACOTTA},
955  {"minecraft:light_gray_shulker_box", E_BLOCK_LIGHT_GRAY_SHULKER_BOX},
956  {"minecraft:light_gray_stained_glass", E_BLOCK_STAINED_GLASS},
957  {"minecraft:light_gray_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
958  {"minecraft:light_gray_terracotta", E_BLOCK_TERRACOTTA},
959  {"minecraft:light_gray_wall_banner", E_BLOCK_WALL_BANNER},
960  {"minecraft:light_gray_wool", E_BLOCK_WOOL},
961  {"minecraft:light_weighted_pressure_plate", E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE},
962  {"minecraft:lilac", E_BLOCK_BIG_FLOWER},
963  {"minecraft:lily_of_the_valley", E_BLOCK_FLOWER},
964  {"minecraft:lily_pad", E_BLOCK_LILY_PAD},
965  {"minecraft:lime_banner", E_BLOCK_STANDING_BANNER},
966  {"minecraft:lime_bed", E_BLOCK_BED},
967  {"minecraft:lime_carpet", E_BLOCK_CARPET},
968  {"minecraft:lime_concrete", E_BLOCK_CONCRETE},
969  {"minecraft:lime_concrete_powder", E_BLOCK_CONCRETE_POWDER},
970  {"minecraft:lime_glazed_terracotta", E_BLOCK_LIME_GLAZED_TERRACOTTA},
971  {"minecraft:lime_shulker_box", E_BLOCK_LIME_SHULKER_BOX},
972  {"minecraft:lime_stained_glass", E_BLOCK_STAINED_GLASS},
973  {"minecraft:lime_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
974  {"minecraft:lime_terracotta", E_BLOCK_TERRACOTTA},
975  {"minecraft:lime_wall_banner", E_BLOCK_WALL_BANNER},
976  {"minecraft:lime_wool", E_BLOCK_WOOL},
977  {"minecraft:loom", E_BLOCK_UNFINISHED},
978  {"minecraft:magenta_banner", E_BLOCK_STANDING_BANNER},
979  {"minecraft:magenta_bed", E_BLOCK_BED},
980  {"minecraft:magenta_carpet", E_BLOCK_CARPET},
981  {"minecraft:magenta_concrete", E_BLOCK_CONCRETE},
982  {"minecraft:magenta_concrete_powder", E_BLOCK_CONCRETE_POWDER},
983  {"minecraft:magenta_glazed_terracotta", E_BLOCK_MAGENTA_GLAZED_TERRACOTTA},
984  {"minecraft:magenta_shulker_box", E_BLOCK_MAGENTA_SHULKER_BOX},
985  {"minecraft:magenta_stained_glass", E_BLOCK_STAINED_GLASS},
986  {"minecraft:magenta_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
987  {"minecraft:magenta_terracotta", E_BLOCK_TERRACOTTA},
988  {"minecraft:magenta_wall_banner", E_BLOCK_WALL_BANNER},
989  {"minecraft:magenta_wool", E_BLOCK_WOOL},
990  {"minecraft:magma_block", E_BLOCK_MAGMA},
991  {"minecraft:melon", E_BLOCK_MELON},
992  {"minecraft:melon_stem", E_BLOCK_MELON_STEM},
993  {"minecraft:mossy_cobblestone", E_BLOCK_MOSSY_COBBLESTONE},
994  {"minecraft:mossy_cobblestone_slab", E_BLOCK_STONE_SLAB},
995  {"minecraft:mossy_cobblestone_stairs", E_BLOCK_COBBLESTONE_STAIRS},
996  {"minecraft:mossy_cobblestone_wall", E_BLOCK_COBBLESTONE_WALL},
997  {"minecraft:mossy_stone_brick_slab", E_BLOCK_STONE_SLAB},
998  {"minecraft:mossy_stone_brick_stairs", E_BLOCK_COBBLESTONE_STAIRS},
999  {"minecraft:mossy_stone_brick_wall", E_BLOCK_COBBLESTONE_WALL},
1000  {"minecraft:mossy_stone_bricks", E_BLOCK_STONE_BRICKS},
1001  {"minecraft:moving_piston", E_BLOCK_UNFINISHED},
1002  {"minecraft:mushroom_stem", E_BLOCK_HUGE_BROWN_MUSHROOM},
1003  {"minecraft:mycelium", E_BLOCK_MYCELIUM},
1004  {"minecraft:nether_brick_fence", E_BLOCK_NETHER_BRICK_FENCE},
1005  {"minecraft:nether_brick_slab", E_BLOCK_STONE_SLAB},
1006  {"minecraft:nether_brick_stairs", E_BLOCK_NETHER_BRICK_STAIRS},
1007  {"minecraft:nether_brick_wall", E_BLOCK_COBBLESTONE_WALL},
1008  {"minecraft:nether_bricks", E_BLOCK_NETHER_BRICK},
1009  {"minecraft:nether_portal", E_BLOCK_NETHER_PORTAL},
1010  {"minecraft:nether_quartz_ore", E_BLOCK_NETHER_QUARTZ_ORE},
1011  {"minecraft:nether_wart", E_BLOCK_NETHER_WART},
1012  {"minecraft:nether_wart_block", E_BLOCK_NETHER_WART_BLOCK},
1013  {"minecraft:netherrack", E_BLOCK_NETHERRACK},
1014  {"minecraft:note_block", E_BLOCK_NOTE_BLOCK},
1015  {"minecraft:oak_button", E_BLOCK_WOODEN_BUTTON},
1016  {"minecraft:oak_door", E_BLOCK_WOODEN_DOOR},
1017  {"minecraft:oak_fence", E_BLOCK_FENCE},
1018  {"minecraft:oak_fence_gate", E_BLOCK_FENCE_GATE},
1019  {"minecraft:oak_leaves", E_BLOCK_LEAVES},
1020  {"minecraft:oak_log", E_BLOCK_LOG},
1021  {"minecraft:oak_planks", E_BLOCK_PLANKS},
1022  {"minecraft:oak_pressure_plate", E_BLOCK_WOODEN_PRESSURE_PLATE},
1023  {"minecraft:oak_sapling", E_BLOCK_SAPLING},
1024  {"minecraft:oak_sign", E_BLOCK_SIGN_POST},
1025  {"minecraft:oak_slab", E_BLOCK_WOODEN_SLAB},
1026  {"minecraft:oak_stairs", E_BLOCK_WOODEN_STAIRS},
1027  {"minecraft:oak_trapdoor", E_BLOCK_TRAPDOOR},
1028  {"minecraft:oak_wall_sign", E_BLOCK_WALLSIGN},
1029  {"minecraft:oak_wood", E_BLOCK_UNFINISHED},
1030  {"minecraft:observer", E_BLOCK_OBSERVER},
1031  {"minecraft:obsidian", E_BLOCK_OBSIDIAN},
1032  {"minecraft:orange_banner", E_BLOCK_STANDING_BANNER},
1033  {"minecraft:orange_bed", E_BLOCK_BED},
1034  {"minecraft:orange_carpet", E_BLOCK_CARPET},
1035  {"minecraft:orange_concrete", E_BLOCK_CONCRETE},
1036  {"minecraft:orange_concrete_powder", E_BLOCK_CONCRETE_POWDER},
1037  {"minecraft:orange_glazed_terracotta", E_BLOCK_ORANGE_GLAZED_TERRACOTTA},
1038  {"minecraft:orange_shulker_box", E_BLOCK_ORANGE_SHULKER_BOX},
1039  {"minecraft:orange_stained_glass", E_BLOCK_STAINED_GLASS},
1040  {"minecraft:orange_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
1041  {"minecraft:orange_terracotta", E_BLOCK_TERRACOTTA},
1042  {"minecraft:orange_tulip", E_BLOCK_FLOWER},
1043  {"minecraft:orange_wall_banner", E_BLOCK_WALL_BANNER},
1044  {"minecraft:orange_wool", E_BLOCK_WOOL},
1045  {"minecraft:oxeye_daisy", E_BLOCK_FLOWER},
1046  {"minecraft:packed_ice", E_BLOCK_PACKED_ICE},
1047  {"minecraft:peony", E_BLOCK_BIG_FLOWER},
1048  {"minecraft:petrified_oak_slab", E_BLOCK_WOODEN_SLAB},
1049  {"minecraft:pink_banner", E_BLOCK_STANDING_BANNER},
1050  {"minecraft:pink_bed", E_BLOCK_BED},
1051  {"minecraft:pink_carpet", E_BLOCK_CARPET},
1052  {"minecraft:pink_concrete", E_BLOCK_CONCRETE},
1053  {"minecraft:pink_concrete_powder", E_BLOCK_CONCRETE_POWDER},
1054  {"minecraft:pink_glazed_terracotta", E_BLOCK_PINK_GLAZED_TERRACOTTA},
1055  {"minecraft:pink_shulker_box", E_BLOCK_PINK_SHULKER_BOX},
1056  {"minecraft:pink_stained_glass", E_BLOCK_STAINED_GLASS},
1057  {"minecraft:pink_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
1058  {"minecraft:pink_terracotta", E_BLOCK_TERRACOTTA},
1059  {"minecraft:pink_tulip", E_BLOCK_FLOWER},
1060  {"minecraft:pink_wall_banner", E_BLOCK_WALL_BANNER},
1061  {"minecraft:pink_wool", E_BLOCK_WOOL},
1062  {"minecraft:piston", E_BLOCK_PISTON},
1063  {"minecraft:piston_head", E_BLOCK_PISTON_EXTENSION},
1064  {"minecraft:player_head", E_BLOCK_HEAD},
1065  {"minecraft:player_wall_head", E_BLOCK_HEAD},
1066  {"minecraft:podzol", E_BLOCK_UNFINISHED},
1067  {"minecraft:polished_andesite", E_BLOCK_UNFINISHED},
1068  {"minecraft:polished_andesite_slab", E_BLOCK_STONE_SLAB},
1069  {"minecraft:polished_andesite_stairs", E_BLOCK_COBBLESTONE_STAIRS},
1070  {"minecraft:polished_diorite", E_BLOCK_UNFINISHED},
1071  {"minecraft:polished_diorite_slab", E_BLOCK_STONE_SLAB},
1072  {"minecraft:polished_diorite_stairs", E_BLOCK_COBBLESTONE_STAIRS},
1073  {"minecraft:polished_granite", E_BLOCK_UNFINISHED},
1074  {"minecraft:polished_granite_slab", E_BLOCK_STONE_SLAB},
1075  {"minecraft:polished_granite_stairs", E_BLOCK_COBBLESTONE_STAIRS},
1076  {"minecraft:poppy", E_BLOCK_FLOWER},
1077  {"minecraft:potatoes", E_BLOCK_POTATOES},
1078  {"minecraft:potted_acacia_sapling", E_BLOCK_UNFINISHED},
1079  {"minecraft:potted_allium", E_BLOCK_UNFINISHED},
1080  {"minecraft:potted_azure_bluet", E_BLOCK_UNFINISHED},
1081  {"minecraft:potted_bamboo", E_BLOCK_UNFINISHED},
1082  {"minecraft:potted_birch_sapling", E_BLOCK_UNFINISHED},
1083  {"minecraft:potted_blue_orchid", E_BLOCK_UNFINISHED},
1084  {"minecraft:potted_brown_mushroom", E_BLOCK_UNFINISHED},
1085  {"minecraft:potted_cactus", E_BLOCK_UNFINISHED},
1086  {"minecraft:potted_cornflower", E_BLOCK_UNFINISHED},
1087  {"minecraft:potted_dandelion", E_BLOCK_UNFINISHED},
1088  {"minecraft:potted_dark_oak_sapling", E_BLOCK_UNFINISHED},
1089  {"minecraft:potted_dead_bush", E_BLOCK_UNFINISHED},
1090  {"minecraft:potted_fern", E_BLOCK_UNFINISHED},
1091  {"minecraft:potted_jungle_sapling", E_BLOCK_UNFINISHED},
1092  {"minecraft:potted_lily_of_the_valley", E_BLOCK_UNFINISHED},
1093  {"minecraft:potted_oak_sapling", E_BLOCK_UNFINISHED},
1094  {"minecraft:potted_orange_tulip", E_BLOCK_UNFINISHED},
1095  {"minecraft:potted_oxeye_daisy", E_BLOCK_UNFINISHED},
1096  {"minecraft:potted_pink_tulip", E_BLOCK_UNFINISHED},
1097  {"minecraft:potted_poppy", E_BLOCK_UNFINISHED},
1098  {"minecraft:potted_red_mushroom", E_BLOCK_UNFINISHED},
1099  {"minecraft:potted_red_tulip", E_BLOCK_UNFINISHED},
1100  {"minecraft:potted_spruce_sapling", E_BLOCK_UNFINISHED},
1101  {"minecraft:potted_white_tulip", E_BLOCK_UNFINISHED},
1102  {"minecraft:potted_wither_rose", E_BLOCK_UNFINISHED},
1103  {"minecraft:powered_rail", E_BLOCK_POWERED_RAIL},
1104  {"minecraft:prismarine", E_BLOCK_PRISMARINE_BLOCK},
1105  {"minecraft:prismarine_brick_slab", E_BLOCK_STONE_SLAB},
1106  {"minecraft:prismarine_brick_stairs", E_BLOCK_COBBLESTONE_STAIRS},
1107  {"minecraft:prismarine_bricks", E_BLOCK_PRISMARINE_BLOCK},
1108  {"minecraft:prismarine_slab", E_BLOCK_STONE_SLAB},
1109  {"minecraft:prismarine_stairs", E_BLOCK_COBBLESTONE_STAIRS},
1110  {"minecraft:prismarine_wall", E_BLOCK_COBBLESTONE_WALL},
1111  {"minecraft:pumpkin", E_BLOCK_PUMPKIN},
1112  {"minecraft:pumpkin_stem", E_BLOCK_PUMPKIN_STEM},
1113  {"minecraft:purple_banner", E_BLOCK_STANDING_BANNER},
1114  {"minecraft:purple_bed", E_BLOCK_BED},
1115  {"minecraft:purple_carpet", E_BLOCK_CARPET},
1116  {"minecraft:purple_concrete", E_BLOCK_CONCRETE},
1117  {"minecraft:purple_concrete_powder", E_BLOCK_CONCRETE_POWDER},
1118  {"minecraft:purple_glazed_terracotta", E_BLOCK_PURPLE_GLAZED_TERRACOTTA},
1119  {"minecraft:purple_shulker_box", E_BLOCK_PURPLE_SHULKER_BOX},
1120  {"minecraft:purple_stained_glass", E_BLOCK_STAINED_GLASS},
1121  {"minecraft:purple_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
1122  {"minecraft:purple_terracotta", E_BLOCK_TERRACOTTA},
1123  {"minecraft:purple_wall_banner", E_BLOCK_WALL_BANNER},
1124  {"minecraft:purple_wool", E_BLOCK_WOOL},
1125  {"minecraft:purpur_block", E_BLOCK_PURPUR_BLOCK},
1126  {"minecraft:purpur_pillar", E_BLOCK_PURPUR_PILLAR},
1127  {"minecraft:purpur_slab", E_BLOCK_PURPUR_SLAB},
1128  {"minecraft:purpur_stairs", E_BLOCK_PURPUR_STAIRS},
1129  {"minecraft:quartz_block", E_BLOCK_QUARTZ_BLOCK},
1130  {"minecraft:quartz_pillar", E_BLOCK_UNFINISHED},
1131  {"minecraft:quartz_slab", E_BLOCK_STONE_SLAB},
1132  {"minecraft:quartz_stairs", E_BLOCK_QUARTZ_STAIRS},
1133  {"minecraft:rail", E_BLOCK_RAIL},
1134  {"minecraft:red_banner", E_BLOCK_STANDING_BANNER},
1135  {"minecraft:red_bed", E_BLOCK_BED},
1136  {"minecraft:red_carpet", E_BLOCK_CARPET},
1137  {"minecraft:red_concrete", E_BLOCK_CONCRETE},
1138  {"minecraft:red_concrete_powder", E_BLOCK_CONCRETE_POWDER},
1139  {"minecraft:red_glazed_terracotta", E_BLOCK_RED_GLAZED_TERRACOTTA},
1140  {"minecraft:red_mushroom", E_BLOCK_RED_MUSHROOM},
1141  {"minecraft:red_mushroom_block", E_BLOCK_HUGE_RED_MUSHROOM},
1142  {"minecraft:red_nether_brick_slab", E_BLOCK_STONE_SLAB},
1143  {"minecraft:red_nether_brick_stairs", E_BLOCK_STONE_BRICK_STAIRS},
1144  {"minecraft:red_nether_brick_wall", E_BLOCK_COBBLESTONE_WALL},
1145  {"minecraft:red_nether_bricks", E_BLOCK_RED_NETHER_BRICK},
1146  {"minecraft:red_sand", E_BLOCK_UNFINISHED},
1147  {"minecraft:red_sandstone", E_BLOCK_RED_SANDSTONE},
1148  {"minecraft:red_sandstone_slab", E_BLOCK_STONE_SLAB},
1149  {"minecraft:red_sandstone_stairs", E_BLOCK_COBBLESTONE_STAIRS},
1150  {"minecraft:red_sandstone_wall", E_BLOCK_COBBLESTONE_WALL},
1151  {"minecraft:red_shulker_box", E_BLOCK_RED_SHULKER_BOX},
1152  {"minecraft:red_stained_glass", E_BLOCK_STAINED_GLASS},
1153  {"minecraft:red_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
1154  {"minecraft:red_terracotta", E_BLOCK_TERRACOTTA},
1155  {"minecraft:red_tulip", E_BLOCK_FLOWER},
1156  {"minecraft:red_wall_banner", E_BLOCK_WALL_BANNER},
1157  {"minecraft:red_wool", E_BLOCK_WOOL},
1158  {"minecraft:redstone_block", E_BLOCK_BLOCK_OF_REDSTONE},
1159  {"minecraft:redstone_lamp", E_BLOCK_UNFINISHED}, // We only have handlers for either ON or OFF variant
1160  {"minecraft:redstone_ore", E_BLOCK_REDSTONE_ORE},
1161  {"minecraft:redstone_torch", E_BLOCK_UNFINISHED}, // We only have handlers for either ON or OFF variant
1162  {"minecraft:redstone_wall_torch", E_BLOCK_UNFINISHED},
1163  {"minecraft:redstone_wire", E_BLOCK_REDSTONE_WIRE},
1164  {"minecraft:repeater", E_BLOCK_UNFINISHED},
1165  {"minecraft:repeating_command_block", E_BLOCK_REPEATING_COMMAND_BLOCK},
1166  {"minecraft:rose_bush", E_BLOCK_BIG_FLOWER},
1167  {"minecraft:sand", E_BLOCK_SAND},
1168  {"minecraft:sandstone", E_BLOCK_SANDSTONE},
1169  {"minecraft:sandstone_slab", E_BLOCK_STONE_SLAB},
1170  {"minecraft:sandstone_stairs", E_BLOCK_SANDSTONE_STAIRS},
1171  {"minecraft:sandstone_wall", E_BLOCK_COBBLESTONE_WALL},
1172  {"minecraft:scaffolding", E_BLOCK_UNFINISHED},
1173  {"minecraft:sea_lantern", E_BLOCK_SEA_LANTERN},
1174  {"minecraft:sea_pickle", E_BLOCK_UNFINISHED},
1175  {"minecraft:seagrass", E_BLOCK_UNFINISHED},
1176  {"minecraft:shulker_box", E_BLOCK_PURPLE_SHULKER_BOX}, // Color is irrelevant in the handler
1177  {"minecraft:skeleton_skull", E_BLOCK_HEAD},
1178  {"minecraft:skeleton_wall_skull", E_BLOCK_HEAD},
1179  {"minecraft:slime_block", E_BLOCK_SLIME_BLOCK},
1180  {"minecraft:smithing_table", E_BLOCK_UNFINISHED},
1181  {"minecraft:smoker", E_BLOCK_UNFINISHED},
1182  {"minecraft:smooth_quartz", E_BLOCK_QUARTZ_BLOCK},
1183  {"minecraft:smooth_quartz_slab", E_BLOCK_STONE_SLAB},
1184  {"minecraft:smooth_quartz_stairs", E_BLOCK_QUARTZ_STAIRS},
1185  {"minecraft:smooth_red_sandstone", E_BLOCK_SANDSTONE},
1186  {"minecraft:smooth_red_sandstone_slab", E_BLOCK_STONE_SLAB},
1187  {"minecraft:smooth_red_sandstone_stairs", E_BLOCK_SANDSTONE_STAIRS},
1188  {"minecraft:smooth_sandstone", E_BLOCK_SANDSTONE},
1189  {"minecraft:smooth_sandstone_slab", E_BLOCK_STONE_SLAB},
1190  {"minecraft:smooth_sandstone_stairs", E_BLOCK_SANDSTONE_STAIRS},
1191  {"minecraft:smooth_stone", E_BLOCK_SANDSTONE},
1192  {"minecraft:smooth_stone_slab", E_BLOCK_STONE_SLAB},
1193  {"minecraft:snow", E_BLOCK_SNOW},
1194  {"minecraft:snow_block", E_BLOCK_SNOW_BLOCK},
1195  {"minecraft:soul_sand", E_BLOCK_SOULSAND},
1196  {"minecraft:spawner", E_BLOCK_MOB_SPAWNER},
1197  {"minecraft:sponge", E_BLOCK_SPONGE},
1198  {"minecraft:spruce_button", E_BLOCK_WOODEN_BUTTON},
1199  {"minecraft:spruce_door", E_BLOCK_WOODEN_DOOR},
1200  {"minecraft:spruce_fence", E_BLOCK_FENCE},
1201  {"minecraft:spruce_fence_gate", E_BLOCK_FENCE_GATE},
1202  {"minecraft:spruce_leaves", E_BLOCK_LEAVES},
1203  {"minecraft:spruce_log", E_BLOCK_LOG},
1204  {"minecraft:spruce_planks", E_BLOCK_PLANKS},
1205  {"minecraft:spruce_pressure_plate", E_BLOCK_WOODEN_PRESSURE_PLATE},
1206  {"minecraft:spruce_sapling", E_BLOCK_SAPLING},
1207  {"minecraft:spruce_sign", E_BLOCK_SIGN_POST},
1208  {"minecraft:spruce_slab", E_BLOCK_WOODEN_SLAB},
1209  {"minecraft:spruce_stairs", E_BLOCK_WOODEN_STAIRS},
1210  {"minecraft:spruce_trapdoor", E_BLOCK_TRAPDOOR},
1211  {"minecraft:spruce_wall_sign", E_BLOCK_WALLSIGN},
1212  {"minecraft:spruce_wood", E_BLOCK_UNFINISHED},
1213  {"minecraft:sticky_piston", E_BLOCK_STICKY_PISTON},
1214  {"minecraft:stone", E_BLOCK_STONE},
1215  {"minecraft:stone_brick_slab", E_BLOCK_STONE_SLAB},
1216  {"minecraft:stone_brick_stairs", E_BLOCK_COBBLESTONE_STAIRS},
1217  {"minecraft:stone_brick_wall", E_BLOCK_COBBLESTONE_WALL},
1218  {"minecraft:stone_bricks", E_BLOCK_STONE_BRICKS},
1219  {"minecraft:stone_button", E_BLOCK_STONE_BUTTON},
1220  {"minecraft:stone_pressure_plate", E_BLOCK_STONE_PRESSURE_PLATE},
1221  {"minecraft:stone_slab", E_BLOCK_STONE_SLAB},
1222  {"minecraft:stone_stairs", E_BLOCK_COBBLESTONE_STAIRS},
1223  {"minecraft:stonecutter", E_BLOCK_UNFINISHED},
1224  {"minecraft:stripped_acacia_log", E_BLOCK_LOG},
1225  {"minecraft:stripped_acacia_wood", E_BLOCK_UNFINISHED},
1226  {"minecraft:stripped_birch_log", E_BLOCK_LOG},
1227  {"minecraft:stripped_birch_wood", E_BLOCK_UNFINISHED},
1228  {"minecraft:stripped_dark_oak_log", E_BLOCK_LOG},
1229  {"minecraft:stripped_dark_oak_wood", E_BLOCK_UNFINISHED},
1230  {"minecraft:stripped_jungle_log", E_BLOCK_LOG},
1231  {"minecraft:stripped_jungle_wood", E_BLOCK_UNFINISHED},
1232  {"minecraft:stripped_oak_log", E_BLOCK_LOG},
1233  {"minecraft:stripped_oak_wood", E_BLOCK_UNFINISHED},
1234  {"minecraft:stripped_spruce_log", E_BLOCK_LOG},
1235  {"minecraft:stripped_spruce_wood", E_BLOCK_UNFINISHED},
1236  {"minecraft:structure_block", E_BLOCK_STRUCTURE_BLOCK},
1237  {"minecraft:structure_void", E_BLOCK_STRUCTURE_VOID},
1238  {"minecraft:sugar_cane", E_BLOCK_SUGARCANE},
1239  {"minecraft:sunflower", E_BLOCK_BIG_FLOWER},
1240  {"minecraft:sweet_berry_bush", E_BLOCK_FLOWER},
1241  {"minecraft:tall_grass", E_BLOCK_TALL_GRASS},
1242  {"minecraft:tall_seagrass", E_BLOCK_UNFINISHED},
1243  {"minecraft:terracotta", E_BLOCK_TERRACOTTA},
1244  {"minecraft:tnt", E_BLOCK_TNT},
1245  {"minecraft:torch", E_BLOCK_TORCH},
1246  {"minecraft:trapped_chest", E_BLOCK_TRAPPED_CHEST},
1247  {"minecraft:tripwire", E_BLOCK_TRIPWIRE},
1248  {"minecraft:tripwire_hook", E_BLOCK_TRIPWIRE_HOOK},
1249  {"minecraft:tube_coral", E_BLOCK_UNFINISHED},
1250  {"minecraft:tube_coral_block", E_BLOCK_UNFINISHED},
1251  {"minecraft:tube_coral_fan", E_BLOCK_UNFINISHED},
1252  {"minecraft:tube_coral_wall_fan", E_BLOCK_UNFINISHED},
1253  {"minecraft:turtle_egg", E_BLOCK_UNFINISHED},
1254  {"minecraft:vine", E_BLOCK_VINES},
1255  {"minecraft:void_air", E_BLOCK_AIR},
1256  {"minecraft:wall_sign", E_BLOCK_WALLSIGN},
1257  {"minecraft:wall_torch", E_BLOCK_TORCH},
1258  {"minecraft:water", E_BLOCK_WATER},
1259  {"minecraft:wet_sponge", E_BLOCK_SPONGE},
1260  {"minecraft:wheat", E_BLOCK_CROPS},
1261  {"minecraft:white_banner", E_BLOCK_STANDING_BANNER},
1262  {"minecraft:white_bed", E_BLOCK_BED},
1263  {"minecraft:white_carpet", E_BLOCK_CARPET},
1264  {"minecraft:white_concrete", E_BLOCK_CONCRETE},
1265  {"minecraft:white_concrete_powder", E_BLOCK_CONCRETE_POWDER},
1266  {"minecraft:white_glazed_terracotta", E_BLOCK_WHITE_GLAZED_TERRACOTTA},
1267  {"minecraft:white_shulker_box", E_BLOCK_WHITE_SHULKER_BOX},
1268  {"minecraft:white_stained_glass", E_BLOCK_STAINED_GLASS},
1269  {"minecraft:white_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
1270  {"minecraft:white_terracotta", E_BLOCK_TERRACOTTA},
1271  {"minecraft:white_tulip", E_BLOCK_FLOWER},
1272  {"minecraft:white_wall_banner", E_BLOCK_WALL_BANNER},
1273  {"minecraft:white_wool", E_BLOCK_WOOL},
1274  {"minecraft:wither_rose", E_BLOCK_FLOWER},
1275  {"minecraft:wither_skeleton_skull", E_BLOCK_HEAD},
1276  {"minecraft:wither_skeleton_wall_skull", E_BLOCK_HEAD},
1277  {"minecraft:yellow_banner", E_BLOCK_STANDING_BANNER},
1278  {"minecraft:yellow_bed", E_BLOCK_BED},
1279  {"minecraft:yellow_carpet", E_BLOCK_CARPET},
1280  {"minecraft:yellow_concrete", E_BLOCK_CONCRETE},
1281  {"minecraft:yellow_concrete_powder", E_BLOCK_CONCRETE_POWDER},
1282  {"minecraft:yellow_glazed_terracotta", E_BLOCK_YELLOW_GLAZED_TERRACOTTA},
1283  {"minecraft:yellow_shulker_box", E_BLOCK_YELLOW_SHULKER_BOX},
1284  {"minecraft:yellow_stained_glass", E_BLOCK_STAINED_GLASS},
1285  {"minecraft:yellow_stained_glass_pane", E_BLOCK_STAINED_GLASS_PANE},
1286  {"minecraft:yellow_terracotta", E_BLOCK_TERRACOTTA},
1287  {"minecraft:yellow_wall_banner", E_BLOCK_WALL_BANNER},
1288  {"minecraft:yellow_wool", E_BLOCK_WOOL},
1289  {"minecraft:zombie_head", E_BLOCK_HEAD},
1290  {"minecraft:zombie_wall_head", E_BLOCK_HEAD},
1291  };
1292 
1293  for (const auto & r: regs)
1294  {
1295  std::shared_ptr<cBlockHandler> handler(::CreateBlockHandler(r.oldBlockType));
1296  aRegistry.registerBlockType("<built-in>", r.newBlockTypeName, handler);
1297  }
1298 }
cWorld * GetWorld(void) const
Definition: Chunk.h:153
virtual void OnNeighborChanged(cChunkInterface &a_ChunkInterface, Vector3i a_BlockPos, eBlockFace a_WhichNeighbor)
Called when a direct neighbor of this block has been changed.
Definition: BlockHandler.h:101
Handler for blocks that have 3 orientations (hay bale, log), specified by the upper 2 bits in meta...
Definition: BlockSideways.h:13
Stores information on all known block types.
Wrapper for blocks that have a cBlockEntity descendant attached to them and can be "used" by the play...
Definition: BlockEntity.h:15
T x
Definition: Vector3.h:17
void WakeUp(Vector3i a_Block, cChunk *a_Chunk)
virtual void Check(cChunkInterface &ChunkInterface, cBlockPluginInterface &a_PluginInterface, Vector3i a_RelPos, cChunk &a_Chunk)
Called when one of the neighbors gets set; equivalent to MC block update.
virtual void OnBroken(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta)
Called after a block gets broken (replaced with air), either by player or by natural means...
static float GetBlockHeight(BLOCKTYPE a_Type)
Definition: BlockInfo.h:52
virtual bool DoesIgnoreBuildCollision(cChunkInterface &ChunkInterface, Vector3i a_Pos, cPlayer &a_Player, NIBBLETYPE a_Meta)
Checks if the player can build "inside" this block.
short m_ItemDamage
Definition: Item.h:211
static bool IsSolid(BLOCKTYPE a_Type)
Definition: BlockInfo.h:48
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:42
static cBlockHandler * GetHandler(BLOCKTYPE a_Type)
Definition: BlockInfo.h:57
Vector3i RelativeToAbsolute(Vector3i a_RelBlockPosition)
Converts the coord relative to this chunk into an absolute coord.
Definition: Chunk.h:569
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta)
Returns the base colour ID of the block, as will be represented on a map, as per documentation: https...
static bool IsValidHeight(int a_Height)
Validates a height-coordinate.
Definition: ChunkDef.h:212
const cItem & GetEquippedItem(void) const
Definition: Player.h:142
Definition: Player.h:27
cBlockHandler(BLOCKTYPE a_BlockType)
void SetBlock(Vector3i a_RelBlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Definition: Chunk.cpp:1313
virtual void OnPlacedByPlayer(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, const sSetBlock &a_BlockChange)
Called by cPlayer::PlaceBlocks() for each block after it has been set to the world.
static void NeighborChanged(cChunkInterface &a_ChunkInterface, Vector3i a_NeighborPos, eBlockFace a_WhichNeighbor)
Notifies the specified neighbor that the current block has changed.
BLOCKTYPE m_BlockType
Definition: BlockHandler.h:213
unsigned int GetLevel(int a_EnchantmentID) const
Returns the level for the specified enchantment; 0 if not stored.
cSimulatorManager * GetSimulatorManager(void)
Definition: World.h:713
virtual bool GetPlacementBlockTypeMeta(cChunkInterface &a_ChunkInterface, cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta)
Called before a block is placed into a world.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:45
Represents two sets of coords, minimum and maximum for each direction.
Definition: BoundingBox.h:23
static bool ToolHasSilkTouch(const cItem *a_Tool)
Returns true if the specified tool is valid and has a non-zero silk-touch enchantment.
Definition: Chunk.h:49
void RegisterAllBlockHandlers(BlockTypeRegistry &aRegistry)
Registers all the BlockHandler descendants in the specified registry.
Vector3i GetPos(void) const
Returns the absolute position of the stored block.
Definition: ChunkDef.h:560
T y
Definition: Vector3.h:17
T z
Definition: Vector3.h:17
Vector3< T > addedY(T a_AddY) const
Returns a copy of this vector moved by the specified amount on the y axis.
Definition: Vector3.h:299
Vector3< T > addedX(T a_AddX) const
Returns a copy of this vector moved by the specified amount on the X axis.
Definition: Vector3.h:293
BLOCKTYPE m_BlockType
Definition: ChunkDef.h:521
This interface is used to decouple block handlers from the cPluginManager dependency through cWorld...
virtual void OnUpdate(cChunkInterface &cChunkInterface, cWorldInterface &a_WorldInterface, cBlockPluginInterface &a_BlockPluginInterface, cChunk &a_Chunk, int a_RelX, int a_RelY, int a_RelZ)
Called when the block gets ticked either by a random tick or by a queued tick.
cEnchantments m_Enchantments
Definition: Item.h:212
virtual bool IsClickedThrough(void)
Indicates whether the client will click through this block.
Common class that takes care of beetroots, carrots, potatoes and wheat.
Definition: BlockCrops.h:13
cBlockStemsHandler< E_BLOCK_MELON, E_ITEM_MELON_SEEDS > cBlockMelonStemHandler
Definition: BlockStems.h:167
virtual cBoundingBox GetPlacementCollisionBox(BLOCKTYPE a_XM, BLOCKTYPE a_XP, BLOCKTYPE a_YM, BLOCKTYPE a_YP, BLOCKTYPE a_ZM, BLOCKTYPE a_ZP)
Returns the relative bounding box that must be entity-free in order for the block to be placed...
Handles the grass that is 1 block tall.
Vector3< T > addedZ(T a_AddZ) const
Returns a copy of this vector moved by the specified amount on the Z axis.
Definition: Vector3.h:305
#define UNUSED
Definition: Globals.h:152
void DropBlockAsPickups(Vector3i a_BlockPos, const cEntity *a_Digger=nullptr, const cItem *a_Tool=nullptr)
Digs the block and spawns the relevant pickups, as if a_Digger used a_Tool to dig the block...
static cBlockHandler * CreateBlockHandler(BLOCKTYPE a_BlockType)
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
Definition: Defines.h:29
virtual bool IsUseable(void)
Checks if the block can be placed at this point.
BLOCKTYPE GetBlock(Vector3i a_Pos)
virtual bool DoesDropOnUnsuitable(void)
Returns if this block drops if it gets destroyed by an unsuitable situation.
Byte ColourID
Definition: Globals.h:118
static cBlockHandler * CreateBlockHandler(BLOCKTYPE a_BlockType)
Creates a block handler instance based on the specified block type.
Handler used for all types of dirt and grassblock.
Definition: BlockDirt.h:15
Definition: Entity.h:73
cBlockStemsHandler< E_BLOCK_PUMPKIN, E_ITEM_PUMPKIN_SEEDS > cBlockPumpkinStemHandler
Definition: BlockStems.h:168
virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity *a_BlockEntity, const cEntity *a_Digger=nullptr, const cItem *a_Tool=nullptr)
Returns the pickups that would result if the block was mined by a_Digger using a_Tool.
NIBBLETYPE m_BlockMeta
Definition: ChunkDef.h:522
void registerBlockType(const AString &aPluginName, const AString &aBlockTypeName, std::shared_ptr< cBlockHandler > aHandler, const std::map< AString, AString > &aHints=std::map< AString, AString >(), const std::map< AString, BlockInfo::HintCallback > &aHintCallbacks=std::map< AString, BlockInfo::HintCallback >())
Registers the specified block type.
virtual void OnPlaced(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Called by cWorld::SetBlock() after the block has been set.
virtual bool IsInsideBlock(Vector3d a_Position, const BLOCKTYPE a_BlockType, const NIBBLETYPE a_BlockMeta)
Tests if a_Position is inside the block where a_Position is relative to the origin of the block Note ...
Definition: Item.h:36
This class bridges a vector of cItem for safe access via Lua.
Definition: Item.h:234
virtual bool CanBeAt(cChunkInterface &a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk &a_Chunk)
Checks if the block can stay at the specified relative coords in the chunk.