Cuberite
A lightweight, fast and extensible game server for Minecraft
BlockInfo.cpp
Go to the documentation of this file.
1 #include "Globals.h"
2 
3 #include "BlockInfo.h"
4 #include "BlockType.h"
5 
6 
7 
8 
9 
10 bool IsBlockWater(BLOCKTYPE a_BlockType)
11 {
12  return ((a_BlockType == E_BLOCK_WATER) || (a_BlockType == E_BLOCK_STATIONARY_WATER));
13 }
14 
15 
16 
17 
18 
19 bool IsBlockIce(BLOCKTYPE a_BlockType)
20 {
21  switch (a_BlockType)
22  {
24  case E_BLOCK_ICE:
25  case E_BLOCK_PACKED_ICE:
26  {
27  return true;
28  }
29  default:
30  {
31  return false;
32  }
33  }
34 }
35 
36 
37 
38 
39 
40 bool IsBlockWaterOrIce(BLOCKTYPE a_BlockType)
41 {
42  return (IsBlockWater(a_BlockType) || IsBlockIce(a_BlockType));
43 }
44 
45 
46 
47 
48 
49 bool IsBlockLava(BLOCKTYPE a_BlockType)
50 {
51  return ((a_BlockType == E_BLOCK_LAVA) || (a_BlockType == E_BLOCK_STATIONARY_LAVA));
52 }
53 
54 
55 
56 
57 
58 bool IsBlockLiquid(BLOCKTYPE a_BlockType)
59 {
60  return IsBlockWater(a_BlockType) || IsBlockLava(a_BlockType);
61 }
62 
63 
64 
65 
66 
67 bool IsBlockRail(BLOCKTYPE a_BlockType)
68 {
69  switch (a_BlockType)
70  {
74  case E_BLOCK_RAIL:
75  {
76  return true;
77  }
78  default: return false;
79  }
80 }
81 
82 
83 
84 
85 
86 bool IsBlockTypeOfDirt(BLOCKTYPE a_BlockType)
87 {
88  switch (a_BlockType)
89  {
90  case E_BLOCK_DIRT:
91  case E_BLOCK_FARMLAND:
92  case E_BLOCK_GRASS:
93  case E_BLOCK_GRASS_PATH:
94  {
95  return true;
96  }
97  }
98  return false;
99 }
100 
101 
102 
103 
104 
105 bool IsBlockFence(BLOCKTYPE a_BlockType)
106 {
107  switch (a_BlockType)
108  {
111  case E_BLOCK_BIRCH_FENCE:
116  case E_BLOCK_FENCE:
123  {
124  return true;
125  }
126  default:
127  {
128  return false;
129  }
130  }
131 }
132 
133 
134 
135 
136 
137 bool IsBlockShulkerBox(BLOCKTYPE a_BlockType)
138 {
139  return ((a_BlockType >= E_BLOCK_WHITE_SHULKER_BOX) && (a_BlockType <= E_BLOCK_BLACK_SHULKER_BOX));
140 }
141 
142 
143 
144 
145 
147 {
148  switch (a_BlockType)
149  {
150  case E_BLOCK_ACACIA_DOOR:
154  case E_BLOCK_BIRCH_DOOR:
155  case E_BLOCK_BIRCH_FENCE:
158  case E_BLOCK_BOOKCASE:
159  case E_BLOCK_CHEST:
167  case E_BLOCK_FENCE:
171  case E_BLOCK_JUKEBOX:
172  case E_BLOCK_JUNGLE_DOOR:
176  case E_BLOCK_LOG:
177  case E_BLOCK_NEW_LOG:
178  case E_BLOCK_NOTE_BLOCK:
179  case E_BLOCK_OAK_DOOR:
182  case E_BLOCK_PLANKS:
183  case E_BLOCK_SIGN_POST:
184  case E_BLOCK_SPRUCE_DOOR:
189  case E_BLOCK_TRAPDOOR:
191  case E_BLOCK_WALLSIGN:
192  case E_BLOCK_WALL_BANNER:
194  case E_BLOCK_WOODEN_SLAB:
195  {
196  return true;
197  }
198  default:
199  {
200  return false;
201  }
202  }
203 }
204 
205 
206 
207 
208 
210 {
211  switch (a_BlockType)
212  {
213  case E_BLOCK_BEETROOTS:
215  case E_BLOCK_CARROTS:
218  case E_BLOCK_COCOA_POD:
219  case E_BLOCK_CROPS:
220  case E_BLOCK_DANDELION:
221  case E_BLOCK_FLOWER:
222  case E_BLOCK_LILY_PAD:
223  case E_BLOCK_MELON_STEM:
224  case E_BLOCK_NETHER_WART:
225  case E_BLOCK_POTATOES:
228  case E_BLOCK_REEDS:
229  case E_BLOCK_SAPLING:
230  {
231  return true;
232  }
233  default:
234  {
235  return false;
236  }
237  }
238 }
239 
240 
241 
242 
243 
245 {
246  switch (a_BlockType)
247  {
248  case E_BLOCK_BIG_FLOWER:
249  case E_BLOCK_DEAD_BUSH:
250  case E_BLOCK_TALL_GRASS:
251  case E_BLOCK_VINES:
252  {
253  return true;
254  }
255  default:
256  {
257  return false;
258  }
259  }
260 }
261 
262 
263 
264 
265 
267 {
268  switch (a_BlockType)
269  {
272  case E_BLOCK_CAULDRON:
277  case E_BLOCK_GOLD_BLOCK:
279  case E_BLOCK_HOPPER:
280  case E_BLOCK_IRON_BARS:
281  case E_BLOCK_IRON_BLOCK:
282  case E_BLOCK_IRON_DOOR:
284  case E_BLOCK_LAPIS_BLOCK:
288  {
289  return true;
290  }
291  default:
292  {
293  return false;
294  }
295  }
296 }
297 
298 
299 
300 
301 
303 {
304  return (a_BlockType == E_BLOCK_LEAVES) || (a_BlockType == E_BLOCK_NEW_LEAVES);
305 }
306 
307 
308 
309 
310 
312 {
313  switch (a_BlockType)
314  {
316  case E_BLOCK_MELON:
317  case E_BLOCK_PUMPKIN:
318  {
319  return true;
320  }
321  default:
322  {
323  return false;
324  }
325  }
326 }
327 
328 
329 
330 
331 
333 {
334  switch (a_BlockType)
335  {
336  case E_BLOCK_BEDROCK:
338  case E_BLOCK_BONE_BLOCK:
339  case E_BLOCK_BRICK:
341  case E_BLOCK_COAL_ORE:
342  case E_BLOCK_COBBLESTONE:
345  case E_BLOCK_DIAMOND_ORE:
346  case E_BLOCK_DISPENSER:
349  case E_BLOCK_DROPPER:
350  case E_BLOCK_EMERALD_ORE:
352  case E_BLOCK_ENDER_CHEST:
353  case E_BLOCK_END_BRICKS:
355  case E_BLOCK_END_STONE:
356  case E_BLOCK_FURNACE:
357  case E_BLOCK_GOLD_ORE:
359  case E_BLOCK_IRON_ORE:
360  case E_BLOCK_LAPIS_ORE:
361  case E_BLOCK_LIT_FURNACE:
362  case E_BLOCK_MAGMA:
363  case E_BLOCK_MOB_SPAWNER:
365  case E_BLOCK_NETHERRACK:
370  case E_BLOCK_OBSERVER:
371  case E_BLOCK_OBSIDIAN:
376  case E_BLOCK_PURPUR_SLAB:
386  case E_BLOCK_SANDSTONE:
389  case E_BLOCK_STONE:
393  case E_BLOCK_STONE_SLAB:
394  {
395  return true;
396  }
397  default:
398  {
399  return false;
400  }
401  }
402 }
403 
404 
405 
406 
407 
409 // cBlockInfo:
410 
412 {
413  // Emissive blocks:
414  switch (Block)
415  {
416  case E_BLOCK_ACTIVE_COMPARATOR: return 9;
417  case E_BLOCK_BEACON: return 15;
418  case E_BLOCK_BREWING_STAND: return 1;
419  case E_BLOCK_BROWN_MUSHROOM: return 1;
420  case E_BLOCK_BURNING_FURNACE: return 13;
421  case E_BLOCK_DRAGON_EGG: return 1;
422  case E_BLOCK_ENDER_CHEST: return 7;
423  case E_BLOCK_END_PORTAL: return 15;
424  case E_BLOCK_END_PORTAL_FRAME: return 1;
425  case E_BLOCK_END_ROD: return 14;
426  case E_BLOCK_FIRE: return 15;
427  case E_BLOCK_GLOWSTONE: return 15;
428  case E_BLOCK_JACK_O_LANTERN: return 15;
429  case E_BLOCK_LAVA: return 15;
430  case E_BLOCK_MAGMA: return 3;
431  case E_BLOCK_NETHER_PORTAL: return 11;
432  case E_BLOCK_REDSTONE_LAMP_ON: return 15;
433  case E_BLOCK_REDSTONE_ORE_GLOWING: return 9;
434  case E_BLOCK_REDSTONE_REPEATER_ON: return 9;
435  case E_BLOCK_REDSTONE_TORCH_ON: return 7;
436  case E_BLOCK_SEA_LANTERN: return 15;
437  case E_BLOCK_STATIONARY_LAVA: return 15;
438  case E_BLOCK_TORCH: return 14;
439  default: return 0;
440  }
441 }
442 
443 
444 
445 
446 
448 {
449  switch (Block)
450  {
451  // Spread blocks:
452  case E_BLOCK_ACACIA_DOOR:
457  case E_BLOCK_AIR:
458  case E_BLOCK_ANVIL:
459  case E_BLOCK_BARRIER:
460  case E_BLOCK_BEACON:
461  case E_BLOCK_BED:
462  case E_BLOCK_BEETROOTS:
463  case E_BLOCK_BIG_FLOWER:
464  case E_BLOCK_BIRCH_DOOR:
465  case E_BLOCK_BIRCH_FENCE:
469  case E_BLOCK_CACTUS:
470  case E_BLOCK_CAKE:
471  case E_BLOCK_CARPET:
472  case E_BLOCK_CARROTS:
473  case E_BLOCK_CAULDRON:
474  case E_BLOCK_CHEST:
478  case E_BLOCK_COBWEB:
479  case E_BLOCK_COCOA_POD:
480  case E_BLOCK_CROPS:
481  case E_BLOCK_DANDELION:
486  case E_BLOCK_DEAD_BUSH:
488  case E_BLOCK_DRAGON_EGG:
490  case E_BLOCK_ENDER_CHEST:
491  case E_BLOCK_END_PORTAL:
493  case E_BLOCK_END_ROD:
494  case E_BLOCK_FENCE:
495  case E_BLOCK_FIRE:
496  case E_BLOCK_FLOWER:
497  case E_BLOCK_FLOWER_POT:
498  case E_BLOCK_GLASS:
499  case E_BLOCK_GLASS_PANE:
500  case E_BLOCK_HEAD:
502  case E_BLOCK_HOPPER:
505  case E_BLOCK_IRON_BARS:
506  case E_BLOCK_IRON_DOOR:
508  case E_BLOCK_JUNGLE_DOOR:
511  case E_BLOCK_LADDER:
512  case E_BLOCK_LEAVES:
513  case E_BLOCK_LEVER:
515  case E_BLOCK_LILY_PAD:
516  case E_BLOCK_MELON_STEM:
517  case E_BLOCK_MOB_SPAWNER:
519  case E_BLOCK_NETHER_WART:
520  case E_BLOCK_NEW_LEAVES:
521  case E_BLOCK_OAK_DOOR:
523  case E_BLOCK_PISTON:
526  case E_BLOCK_POTATOES:
529  case E_BLOCK_RAIL:
536  case E_BLOCK_SAPLING:
537  case E_BLOCK_SIGN_POST:
538  case E_BLOCK_SNOW:
539  case E_BLOCK_SPRUCE_DOOR:
548  case E_BLOCK_SUGARCANE:
549  case E_BLOCK_TALL_GRASS:
550  case E_BLOCK_TORCH:
551  case E_BLOCK_TRAPDOOR:
553  case E_BLOCK_TRIPWIRE:
555  case E_BLOCK_VINES:
556  case E_BLOCK_WALLSIGN:
557  case E_BLOCK_WALL_BANNER:
559  case E_BLOCK_WOODEN_PRESSURE_PLATE: return 1;
560 
561  // Light in ice and water disappears faster:
562  case E_BLOCK_ICE:
564  case E_BLOCK_WATER: return 3;
565 
566  // Light does not pass through anything else (note: including tilled farmland, stairs, and slabs):
567  default: return 15;
568  }
569 }
570 
571 
572 
573 
574 
576 {
577  // Blocks that can be terraformed:
578  switch (Block)
579  {
580  case E_BLOCK_COAL_ORE:
581  case E_BLOCK_COBBLESTONE:
582  case E_BLOCK_DIAMOND_ORE:
583  case E_BLOCK_DIRT:
584  case E_BLOCK_GOLD_ORE:
585  case E_BLOCK_GRASS:
586  case E_BLOCK_GRAVEL:
588  case E_BLOCK_IRON_ORE:
589  case E_BLOCK_MYCELIUM:
590  case E_BLOCK_NETHERRACK:
593  case E_BLOCK_SAND:
594  case E_BLOCK_SANDSTONE:
595  case E_BLOCK_SOULSAND:
597  case E_BLOCK_STONE: return true;
598  default: return false;
599  }
600 }
601 
602 
603 
604 
605 
607 {
608  // Blocks that fully occupy their voxel - used as a guide for torch placeable blocks, amongst other things:
609  switch (Block)
610  {
611  case E_BLOCK_BARRIER:
612  case E_BLOCK_BEDROCK:
617  case E_BLOCK_BONE_BLOCK:
618  case E_BLOCK_BOOKCASE:
619  case E_BLOCK_BRICK:
622  case E_BLOCK_CLAY:
623  case E_BLOCK_COAL_ORE:
624  case E_BLOCK_COBBLESTONE:
626  case E_BLOCK_CONCRETE:
631  case E_BLOCK_DIAMOND_ORE:
632  case E_BLOCK_DIRT:
633  case E_BLOCK_DISPENSER:
637  case E_BLOCK_DROPPER:
639  case E_BLOCK_EMERALD_ORE:
640  case E_BLOCK_END_BRICKS:
641  case E_BLOCK_END_STONE:
642  case E_BLOCK_FROSTED_ICE:
643  case E_BLOCK_FURNACE:
644  case E_BLOCK_GLASS:
645  case E_BLOCK_GLOWSTONE:
646  case E_BLOCK_GOLD_BLOCK:
647  case E_BLOCK_GOLD_ORE:
648  case E_BLOCK_GRASS:
649  case E_BLOCK_GRAVEL:
653  case E_BLOCK_HAY_BALE:
656  case E_BLOCK_ICE:
657  case E_BLOCK_IRON_BLOCK:
658  case E_BLOCK_IRON_ORE:
660  case E_BLOCK_JUKEBOX:
661  case E_BLOCK_LAPIS_BLOCK:
662  case E_BLOCK_LAPIS_ORE:
666  case E_BLOCK_LOG:
668  case E_BLOCK_MAGMA:
669  case E_BLOCK_MELON:
670  case E_BLOCK_MOB_SPAWNER:
672  case E_BLOCK_MYCELIUM:
673  case E_BLOCK_NETHERRACK:
677  case E_BLOCK_NEW_LOG:
678  case E_BLOCK_NOTE_BLOCK:
679  case E_BLOCK_OBSERVER:
680  case E_BLOCK_OBSIDIAN:
682  case E_BLOCK_PACKED_ICE:
684  case E_BLOCK_PLANKS:
686  case E_BLOCK_PUMPKIN:
700  case E_BLOCK_SAND:
701  case E_BLOCK_SANDSTONE:
703  case E_BLOCK_SPONGE:
706  case E_BLOCK_STONE:
710  case E_BLOCK_WOOL:
711  case E_BLOCK_YELLOW_GLAZED_TERRACOTTA: return true;
712  default: return false;
713  }
714 }
715 
716 
717 
718 
719 
721 {
722  // TODO: Nether Fire too.
723 
724  return a_Block == E_BLOCK_FIRE;
725 }
726 
727 
728 
729 
730 
732 {
733 #ifdef __clang__
734 #pragma clang diagnostic push
735 #pragma clang diagnostic ignored "-Wfloat-equal"
736 #endif
737 
738  // GetHardness returns exactly 0 for one hit break blocks:
739  return GetHardness(Block) == 0;
740 
741 #ifdef __clang__
742 #pragma clang diagnostic pop
743 #endif
744 }
745 
746 
747 
748 
749 
751 {
752  // Blocks that break when pushed by piston:
753  switch (Block)
754  {
755  case E_BLOCK_ACACIA_DOOR:
757  case E_BLOCK_AIR:
758  case E_BLOCK_BED:
759  case E_BLOCK_BEETROOTS:
760  case E_BLOCK_BIG_FLOWER:
761  case E_BLOCK_BIRCH_DOOR:
766  case E_BLOCK_CACTUS:
767  case E_BLOCK_CAKE:
768  case E_BLOCK_CARROTS:
771  case E_BLOCK_COBWEB:
772  case E_BLOCK_COCOA_POD:
773  case E_BLOCK_CROPS:
775  case E_BLOCK_DANDELION:
777  case E_BLOCK_DEAD_BUSH:
778  case E_BLOCK_DRAGON_EGG:
779  case E_BLOCK_FIRE:
780  case E_BLOCK_FLOWER:
781  case E_BLOCK_FLOWER_POT:
784  case E_BLOCK_HEAD:
787  case E_BLOCK_IRON_DOOR:
790  case E_BLOCK_JUNGLE_DOOR:
791  case E_BLOCK_LADDER:
792  case E_BLOCK_LAVA:
793  case E_BLOCK_LEAVES:
794  case E_BLOCK_LEVER:
798  case E_BLOCK_LILY_PAD:
801  case E_BLOCK_MELON:
802  case E_BLOCK_MELON_STEM:
803  case E_BLOCK_NETHER_WART:
804  case E_BLOCK_OAK_DOOR:
807  case E_BLOCK_POTATOES:
808  case E_BLOCK_PUMPKIN:
818  case E_BLOCK_REEDS:
819  case E_BLOCK_SAPLING:
820  case E_BLOCK_SIGN_POST:
821  case E_BLOCK_SNOW:
822  case E_BLOCK_SPRUCE_DOOR:
827  case E_BLOCK_TALL_GRASS:
828  case E_BLOCK_TORCH:
829  case E_BLOCK_TRAPDOOR:
830  case E_BLOCK_TRIPWIRE:
832  case E_BLOCK_VINES:
833  case E_BLOCK_WALLSIGN:
834  case E_BLOCK_WATER:
838  case E_BLOCK_YELLOW_SHULKER_BOX: return true;
839  default: return false;
840  }
841 }
842 
843 
844 
845 
846 
848 {
849  // Blocks that block rain or snow's passage:
850  switch (Block)
851  {
852  case E_BLOCK_SIGN_POST:
854  case E_BLOCK_WALLSIGN:
855  case E_BLOCK_WALL_BANNER: return true;
856  default: return IsSolid(Block);
857  }
858 }
859 
860 
861 
862 
863 
865 {
866  // Skylight dispersant blocks:
867  switch (Block)
868  {
869  case E_BLOCK_COBWEB:
870  case E_BLOCK_LEAVES: return true;
871  default: return GetSpreadLightFalloff(Block) > 1;
872  }
873 }
874 
875 
876 
877 
878 
880 {
881  return (
882  (a_BlockType == E_BLOCK_ICE) ||
883  (a_BlockType == E_BLOCK_LEAVES) ||
884  (!IsTransparent(a_BlockType) && (a_BlockType != E_BLOCK_PACKED_ICE))
885  );
886 }
887 
888 
889 
890 
891 
893 {
894  // Nonsolid blocks:
895  switch (Block)
896  {
899  case E_BLOCK_AIR:
900  case E_BLOCK_BEETROOTS:
901  case E_BLOCK_BIG_FLOWER:
903  case E_BLOCK_CARPET:
904  case E_BLOCK_CARROTS:
907  case E_BLOCK_COBWEB:
908  case E_BLOCK_CROPS:
909  case E_BLOCK_DANDELION:
910  case E_BLOCK_DEAD_BUSH:
912  case E_BLOCK_END_GATEWAY:
913  case E_BLOCK_END_PORTAL:
914  case E_BLOCK_END_ROD:
915  case E_BLOCK_FIRE:
916  case E_BLOCK_FLOWER:
919  case E_BLOCK_LADDER:
920  case E_BLOCK_LAVA:
921  case E_BLOCK_LEVER:
923  case E_BLOCK_MELON_STEM:
925  case E_BLOCK_POTATOES:
927  case E_BLOCK_RAIL:
934  case E_BLOCK_SAPLING:
935  case E_BLOCK_SIGN_POST:
936  case E_BLOCK_SNOW:
942  case E_BLOCK_SUGARCANE:
943  case E_BLOCK_TALL_GRASS:
944  case E_BLOCK_TORCH:
945  case E_BLOCK_TRIPWIRE:
947  case E_BLOCK_VINES:
948  case E_BLOCK_WALLSIGN:
949  case E_BLOCK_WALL_BANNER:
950  case E_BLOCK_WATER:
952  case E_BLOCK_WOODEN_PRESSURE_PLATE: return false;
953  default: return true;
954  }
955 }
956 
957 
958 
959 
960 
962 {
963  // Transparent blocks:
964  switch (Block)
965  {
966  case E_BLOCK_ACACIA_DOOR:
972  case E_BLOCK_AIR:
973  case E_BLOCK_ANVIL:
974  case E_BLOCK_BARRIER:
975  case E_BLOCK_BEACON:
976  case E_BLOCK_BED:
977  case E_BLOCK_BEETROOTS:
978  case E_BLOCK_BIG_FLOWER:
979  case E_BLOCK_BIRCH_DOOR:
980  case E_BLOCK_BIRCH_FENCE:
990  case E_BLOCK_CACTUS:
991  case E_BLOCK_CAKE:
992  case E_BLOCK_CARPET:
993  case E_BLOCK_CARROTS:
994  case E_BLOCK_CAULDRON:
995  case E_BLOCK_CHEST:
1000  case E_BLOCK_COBWEB:
1001  case E_BLOCK_COCOA_POD:
1002  case E_BLOCK_CROPS:
1004  case E_BLOCK_DANDELION:
1005  case E_BLOCK_DARK_OAK_DOOR:
1010  case E_BLOCK_DEAD_BUSH:
1011  case E_BLOCK_DETECTOR_RAIL:
1012  case E_BLOCK_DRAGON_EGG:
1014  case E_BLOCK_ENDER_CHEST:
1015  case E_BLOCK_END_GATEWAY:
1016  case E_BLOCK_END_PORTAL:
1018  case E_BLOCK_END_ROD:
1019  case E_BLOCK_FARMLAND:
1020  case E_BLOCK_FENCE:
1021  case E_BLOCK_FIRE:
1022  case E_BLOCK_FLOWER:
1023  case E_BLOCK_FLOWER_POT:
1024  case E_BLOCK_FROSTED_ICE:
1025  case E_BLOCK_GLASS:
1026  case E_BLOCK_GLASS_PANE:
1027  case E_BLOCK_GLOWSTONE:
1028  case E_BLOCK_GRASS_PATH:
1031  case E_BLOCK_HEAD:
1033  case E_BLOCK_HOPPER:
1034  case E_BLOCK_ICE:
1037  case E_BLOCK_IRON_BARS:
1038  case E_BLOCK_IRON_DOOR:
1039  case E_BLOCK_IRON_TRAPDOOR:
1041  case E_BLOCK_JUNGLE_DOOR:
1042  case E_BLOCK_JUNGLE_FENCE:
1045  case E_BLOCK_LADDER:
1046  case E_BLOCK_LAVA:
1047  case E_BLOCK_LEAVES:
1048  case E_BLOCK_LEVER:
1052  case E_BLOCK_LILY_PAD:
1054  case E_BLOCK_LIT_FURNACE:
1056  case E_BLOCK_MELON_STEM:
1057  case E_BLOCK_MOB_SPAWNER:
1060  case E_BLOCK_NETHER_PORTAL:
1061  case E_BLOCK_NETHER_WART:
1062  case E_BLOCK_NEW_LEAVES:
1063  case E_BLOCK_OAK_DOOR:
1066  case E_BLOCK_OBSERVER:
1069  case E_BLOCK_PISTON:
1072  case E_BLOCK_POTATOES:
1073  case E_BLOCK_POWERED_RAIL:
1074  case E_BLOCK_PUMPKIN_STEM:
1076  case E_BLOCK_PURPUR_SLAB:
1077  case E_BLOCK_PURPUR_STAIRS:
1078  case E_BLOCK_QUARTZ_STAIRS:
1079  case E_BLOCK_RAIL:
1085  case E_BLOCK_REDSTONE_WIRE:
1086  case E_BLOCK_RED_MUSHROOM:
1091  case E_BLOCK_SAPLING:
1092  case E_BLOCK_SEA_LANTERN:
1093  case E_BLOCK_SIGN_POST:
1094  case E_BLOCK_SNOW:
1095  case E_BLOCK_SPRUCE_DOOR:
1096  case E_BLOCK_SPRUCE_FENCE:
1099  case E_BLOCK_STAINED_GLASS:
1104  case E_BLOCK_STICKY_PISTON:
1106  case E_BLOCK_STONE_BUTTON:
1108  case E_BLOCK_STONE_SLAB:
1109  case E_BLOCK_SUGARCANE:
1110  case E_BLOCK_TALL_GRASS:
1111  case E_BLOCK_TNT:
1112  case E_BLOCK_TORCH:
1113  case E_BLOCK_TRAPDOOR:
1114  case E_BLOCK_TRAPPED_CHEST:
1115  case E_BLOCK_TRIPWIRE:
1116  case E_BLOCK_TRIPWIRE_HOOK:
1117  case E_BLOCK_VINES:
1118  case E_BLOCK_WALLSIGN:
1119  case E_BLOCK_WALL_BANNER:
1120  case E_BLOCK_WATER:
1122  case E_BLOCK_WOODEN_BUTTON:
1124  case E_BLOCK_WOODEN_SLAB:
1125  case E_BLOCK_YELLOW_SHULKER_BOX: return true;
1126  default: return false;
1127  }
1128 }
1129 
1130 
1131 
1132 
1133 
1135 {
1136  // Blocks, which a spectator is allowed to interact with:
1137  switch (Block)
1138  {
1139  case E_BLOCK_BEACON:
1140  case E_BLOCK_BREWING_STAND:
1141  case E_BLOCK_CHEST:
1142  case E_BLOCK_DISPENSER:
1143  case E_BLOCK_DROPPER:
1144  case E_BLOCK_HOPPER: return true;
1145  default: return false;
1146  }
1147 }
1148 
1149 
1150 
1151 
1152 
1154 {
1155  // Block heights:
1156  switch (Block)
1157  {
1158  case E_BLOCK_ACACIA_FENCE: return 1.5;
1159  case E_BLOCK_ACACIA_FENCE_GATE: return 1.5;
1160  case E_BLOCK_BED: return 0.5625; // 9 pixels
1161  case E_BLOCK_BIRCH_FENCE: return 1.5;
1162  case E_BLOCK_BIRCH_FENCE_GATE: return 1.5;
1163  case E_BLOCK_CAKE: return 0.5; // 8 pixels
1164  case E_BLOCK_DARK_OAK_FENCE: return 1.5;
1165  case E_BLOCK_DARK_OAK_FENCE_GATE: return 1.5;
1166  case E_BLOCK_ENCHANTMENT_TABLE: return 0.75; // 12 pixels
1167  // case E_BLOCK_FARMLAND: return 0.9375; // prevents trampling for mobs (#2015) and older clients (MC-85162)
1168  case E_BLOCK_FENCE: return 1.5;
1169  case E_BLOCK_JUNGLE_FENCE: return 1.5;
1170  case E_BLOCK_JUNGLE_FENCE_GATE: return 1.5;
1171  case E_BLOCK_OAK_FENCE_GATE: return 1.5;
1172  case E_BLOCK_PURPUR_SLAB: return 0.5;
1173  case E_BLOCK_RED_SANDSTONE_SLAB: return 0.5;
1174  case E_BLOCK_SNOW: return 0.125; // one layer is 1 / 8 (2 pixels) tall
1175  case E_BLOCK_SPRUCE_FENCE: return 1.5;
1176  case E_BLOCK_SPRUCE_FENCE_GATE: return 1.5;
1177  case E_BLOCK_STONE_SLAB: return 0.5;
1178  case E_BLOCK_WOODEN_SLAB: return 0.5;
1179  default: return 1;
1180  }
1181 }
1182 
1183 
1184 
1185 
1186 
1188 {
1189  // Block hardness:
1190  switch (Block)
1191  {
1192  case E_BLOCK_ACACIA_DOOR: return 3.0f;
1193  case E_BLOCK_ACACIA_FENCE: return 2.0f;
1194  case E_BLOCK_ACACIA_FENCE_GATE: return 2.0f;
1195  case E_BLOCK_ACACIA_WOOD_STAIRS: return 2.0f;
1196  case E_BLOCK_ACTIVATOR_RAIL: return 0.7f;
1197  case E_BLOCK_ACTIVE_COMPARATOR: return 0.0f;
1198  case E_BLOCK_AIR: return 0.0f;
1199  case E_BLOCK_ANVIL: return 5.0f;
1200  case E_BLOCK_BARRIER: return INFINITY;
1201  case E_BLOCK_BEACON: return 3.0f;
1202  case E_BLOCK_BED: return 0.2f;
1203  case E_BLOCK_BEDROCK: return INFINITY;
1204  case E_BLOCK_BEETROOTS: return 0.0f;
1205  case E_BLOCK_BIG_FLOWER: return 0.0f;
1206  case E_BLOCK_BIRCH_DOOR: return 3.0f;
1207  case E_BLOCK_BIRCH_FENCE: return 2.0f;
1208  case E_BLOCK_BIRCH_FENCE_GATE: return 2.0f;
1209  case E_BLOCK_BIRCH_WOOD_STAIRS: return 2.0f;
1210  case E_BLOCK_BLACK_GLAZED_TERRACOTTA: return 1.4f;
1211  case E_BLOCK_BLACK_SHULKER_BOX: return 2.0f;
1212  case E_BLOCK_BLOCK_OF_COAL: return 5.0f;
1213  case E_BLOCK_BLOCK_OF_REDSTONE: return 5.0f;
1214  case E_BLOCK_BLUE_GLAZED_TERRACOTTA: return 1.4f;
1215  case E_BLOCK_BLUE_SHULKER_BOX: return 2.0f;
1216  case E_BLOCK_BONE_BLOCK: return 2.0f;
1217  case E_BLOCK_BOOKCASE: return 1.5f;
1218  case E_BLOCK_BREWING_STAND: return 0.5f;
1219  case E_BLOCK_BRICK: return 2.0f;
1220  case E_BLOCK_BRICK_STAIRS: return 2.0f;
1221  case E_BLOCK_BROWN_GLAZED_TERRACOTTA: return 1.4f;
1222  case E_BLOCK_BROWN_MUSHROOM: return 0.0f;
1223  case E_BLOCK_BROWN_SHULKER_BOX: return 2.0f;
1224  case E_BLOCK_CACTUS: return 0.4f;
1225  case E_BLOCK_CAKE: return 0.5f;
1226  case E_BLOCK_CARPET: return 0.1f;
1227  case E_BLOCK_CARROTS: return 0.0f;
1228  case E_BLOCK_CAULDRON: return 2.0f;
1229  case E_BLOCK_CHAIN_COMMAND_BLOCK: return INFINITY;
1230  case E_BLOCK_CHEST: return 2.5f;
1231  case E_BLOCK_CHORUS_FLOWER: return 0.4f;
1232  case E_BLOCK_CHORUS_PLANT: return 0.4f;
1233  case E_BLOCK_CLAY: return 0.6f;
1234  case E_BLOCK_COAL_ORE: return 3.0f;
1235  case E_BLOCK_COBBLESTONE: return 2.0f;
1236  case E_BLOCK_COBBLESTONE_STAIRS: return 2.0f;
1237  case E_BLOCK_COBBLESTONE_WALL: return 2.0f;
1238  case E_BLOCK_COBWEB: return 4.0f;
1239  case E_BLOCK_COCOA_POD: return 0.2f;
1240  case E_BLOCK_COMMAND_BLOCK: return INFINITY;
1241  case E_BLOCK_CONCRETE: return 1.8f;
1242  case E_BLOCK_CONCRETE_POWDER: return 0.5f;
1243  case E_BLOCK_CRAFTING_TABLE: return 2.5f;
1244  case E_BLOCK_CROPS: return 0.0f;
1245  case E_BLOCK_CYAN_GLAZED_TERRACOTTA: return 1.4f;
1246  case E_BLOCK_CYAN_SHULKER_BOX: return 2.0f;
1247  case E_BLOCK_DANDELION: return 0.0f;
1248  case E_BLOCK_DARK_OAK_DOOR: return 3.0f;
1249  case E_BLOCK_DARK_OAK_FENCE: return 2.0f;
1250  case E_BLOCK_DARK_OAK_FENCE_GATE: return 2.0f;
1251  case E_BLOCK_DARK_OAK_WOOD_STAIRS: return 2.0f;
1252  case E_BLOCK_DAYLIGHT_SENSOR: return 0.2f;
1253  case E_BLOCK_DEAD_BUSH: return 0.0f;
1254  case E_BLOCK_DETECTOR_RAIL: return 0.7f;
1255  case E_BLOCK_DIAMOND_BLOCK: return 5.0f;
1256  case E_BLOCK_DIAMOND_ORE: return 3.0f;
1257  case E_BLOCK_DIRT: return 0.5f;
1258  case E_BLOCK_DISPENSER: return 3.5f;
1259  case E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB: return 2.0f;
1260  case E_BLOCK_DOUBLE_STONE_SLAB: return 2.0f;
1261  case E_BLOCK_DOUBLE_WOODEN_SLAB: return 2.0f;
1262  case E_BLOCK_DRAGON_EGG: return 3.0f;
1263  case E_BLOCK_DROPPER: return 3.5f;
1264  case E_BLOCK_EMERALD_BLOCK: return 5.0f;
1265  case E_BLOCK_EMERALD_ORE: return 3.0f;
1266  case E_BLOCK_ENCHANTMENT_TABLE: return 5.0f;
1267  case E_BLOCK_ENDER_CHEST: return 22.5f;
1268  case E_BLOCK_END_BRICKS: return 0.8f;
1269  case E_BLOCK_END_GATEWAY: return INFINITY;
1270  case E_BLOCK_END_PORTAL: return INFINITY;
1271  case E_BLOCK_END_PORTAL_FRAME: return INFINITY;
1272  case E_BLOCK_END_ROD: return 0.0f;
1273  case E_BLOCK_END_STONE: return 3.0f;
1274  case E_BLOCK_FARMLAND: return 0.6f;
1275  case E_BLOCK_FENCE: return 2.0f;
1276  case E_BLOCK_FIRE: return 0.0f;
1277  case E_BLOCK_FLOWER: return 0.0f;
1278  case E_BLOCK_FLOWER_POT: return 0.0f;
1279  case E_BLOCK_FROSTED_ICE: return 0.5f;
1280  case E_BLOCK_FURNACE: return 3.5f;
1281  case E_BLOCK_GLASS: return 0.3f;
1282  case E_BLOCK_GLASS_PANE: return 0.3f;
1283  case E_BLOCK_GLOWSTONE: return 0.3f;
1284  case E_BLOCK_GOLD_BLOCK: return 3.0f;
1285  case E_BLOCK_GOLD_ORE: return 3.0f;
1286  case E_BLOCK_GRASS: return 0.6f;
1287  case E_BLOCK_GRASS_PATH: return 0.6f;
1288  case E_BLOCK_GRAVEL: return 0.6f;
1289  case E_BLOCK_GRAY_GLAZED_TERRACOTTA: return 1.4f;
1290  case E_BLOCK_GRAY_SHULKER_BOX: return 2.0f;
1291  case E_BLOCK_GREEN_GLAZED_TERRACOTTA: return 1.4f;
1292  case E_BLOCK_GREEN_SHULKER_BOX: return 2.0f;
1293  case E_BLOCK_HARDENED_CLAY: return 1.25f;
1294  case E_BLOCK_HAY_BALE: return 0.5f;
1295  case E_BLOCK_HEAD: return 1.0f;
1296  case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE: return 0.5f;
1297  case E_BLOCK_HOPPER: return 3.0f;
1298  case E_BLOCK_HUGE_BROWN_MUSHROOM: return 0.2f;
1299  case E_BLOCK_HUGE_RED_MUSHROOM: return 0.2f;
1300  case E_BLOCK_ICE: return 0.5f;
1301  case E_BLOCK_INACTIVE_COMPARATOR: return 0.0f;
1302  case E_BLOCK_INVERTED_DAYLIGHT_SENSOR: return 0.2f;
1303  case E_BLOCK_IRON_BARS: return 5.0f;
1304  case E_BLOCK_IRON_BLOCK: return 5.0f;
1305  case E_BLOCK_IRON_DOOR: return 5.0f;
1306  case E_BLOCK_IRON_ORE: return 3.0f;
1307  case E_BLOCK_IRON_TRAPDOOR: return 5.0f;
1308  case E_BLOCK_JACK_O_LANTERN: return 1.0f;
1309  case E_BLOCK_JUKEBOX: return 2.0f;
1310  case E_BLOCK_JUNGLE_DOOR: return 3.0f;
1311  case E_BLOCK_JUNGLE_FENCE: return 2.0f;
1312  case E_BLOCK_JUNGLE_FENCE_GATE: return 2.0f;
1313  case E_BLOCK_JUNGLE_WOOD_STAIRS: return 2.0f;
1314  case E_BLOCK_LADDER: return 0.4f;
1315  case E_BLOCK_LAPIS_BLOCK: return 3.0f;
1316  case E_BLOCK_LAPIS_ORE: return 3.0f;
1317  case E_BLOCK_LAVA: return 100.0f;
1318  case E_BLOCK_LEAVES: return 0.2f;
1319  case E_BLOCK_LEVER: return 0.5f;
1320  case E_BLOCK_LIGHT_BLUE_GLAZED_TERRACOTTA: return 1.4f;
1321  case E_BLOCK_LIGHT_BLUE_SHULKER_BOX: return 2.0f;
1322  case E_BLOCK_LIGHT_GRAY_GLAZED_TERRACOTTA: return 1.4f;
1323  case E_BLOCK_LIGHT_GRAY_SHULKER_BOX: return 2.0f;
1324  case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE: return 0.5f;
1325  case E_BLOCK_LILY_PAD: return 0.0f;
1326  case E_BLOCK_LIME_GLAZED_TERRACOTTA: return 1.4f;
1327  case E_BLOCK_LIME_SHULKER_BOX: return 2.0f;
1328  case E_BLOCK_LIT_FURNACE: return 3.5f;
1329  case E_BLOCK_LOG: return 2.0f;
1330  case E_BLOCK_MAGENTA_GLAZED_TERRACOTTA: return 1.4f;
1331  case E_BLOCK_MAGENTA_SHULKER_BOX: return 2.0f;
1332  case E_BLOCK_MAGMA: return 0.5f;
1333  case E_BLOCK_MELON: return 1.0f;
1334  case E_BLOCK_MELON_STEM: return 0.0f;
1335  case E_BLOCK_MOB_SPAWNER: return 5.0f;
1336  case E_BLOCK_MOSSY_COBBLESTONE: return 2.0f;
1337  case E_BLOCK_MYCELIUM: return 0.6f;
1338  case E_BLOCK_NETHERRACK: return 0.4f;
1339  case E_BLOCK_NETHER_BRICK: return 2.0f;
1340  case E_BLOCK_NETHER_BRICK_FENCE: return 2.0f;
1341  case E_BLOCK_NETHER_BRICK_STAIRS: return 2.0f;
1342  case E_BLOCK_NETHER_PORTAL: return INFINITY;
1343  case E_BLOCK_NETHER_QUARTZ_ORE: return 3.0f;
1344  case E_BLOCK_NETHER_WART: return 0.0f;
1345  case E_BLOCK_NETHER_WART_BLOCK: return 1.0f;
1346  case E_BLOCK_NEW_LEAVES: return 0.2f;
1347  case E_BLOCK_NEW_LOG: return 2.0f;
1348  case E_BLOCK_NOTE_BLOCK: return 0.8f;
1349  case E_BLOCK_OAK_DOOR: return 3.0f;
1350  case E_BLOCK_OAK_FENCE_GATE: return 2.0f;
1351  case E_BLOCK_OAK_WOOD_STAIRS: return 2.0f;
1352  case E_BLOCK_OBSERVER: return 3.5f;
1353  case E_BLOCK_OBSIDIAN: return 50.0f;
1354  case E_BLOCK_ORANGE_GLAZED_TERRACOTTA: return 1.4f;
1355  case E_BLOCK_ORANGE_SHULKER_BOX: return 2.0f;
1356  case E_BLOCK_PACKED_ICE: return 0.5f;
1357  case E_BLOCK_PINK_GLAZED_TERRACOTTA: return 1.4f;
1358  case E_BLOCK_PINK_SHULKER_BOX: return 2.0f;
1359  case E_BLOCK_PISTON: return 0.5f;
1360  case E_BLOCK_PISTON_EXTENSION: return 0.5f;
1361  case E_BLOCK_PISTON_MOVED_BLOCK: return INFINITY;
1362  case E_BLOCK_PLANKS: return 2.0f;
1363  case E_BLOCK_POTATOES: return 0.0f;
1364  case E_BLOCK_POWERED_RAIL: return 0.7f;
1365  case E_BLOCK_PRISMARINE_BLOCK: return 1.5f;
1366  case E_BLOCK_PUMPKIN: return 1.0f;
1367  case E_BLOCK_PUMPKIN_STEM: return 0.0f;
1368  case E_BLOCK_PURPLE_GLAZED_TERRACOTTA: return 1.4f;
1369  case E_BLOCK_PURPLE_SHULKER_BOX: return 2.0f;
1370  case E_BLOCK_PURPUR_BLOCK: return 1.5f;
1371  case E_BLOCK_PURPUR_DOUBLE_SLAB: return 2.0f;
1372  case E_BLOCK_PURPUR_PILLAR: return 1.5f;
1373  case E_BLOCK_PURPUR_SLAB: return 2.0f;
1374  case E_BLOCK_PURPUR_STAIRS: return 1.5f;
1375  case E_BLOCK_QUARTZ_BLOCK: return 0.8f;
1376  case E_BLOCK_QUARTZ_STAIRS: return 0.8f;
1377  case E_BLOCK_RAIL: return 0.7f;
1378  case E_BLOCK_REDSTONE_LAMP_OFF: return 0.3f;
1379  case E_BLOCK_REDSTONE_LAMP_ON: return 0.3f;
1380  case E_BLOCK_REDSTONE_ORE: return 3.0f;
1381  case E_BLOCK_REDSTONE_ORE_GLOWING: return 0.625f;
1382  case E_BLOCK_REDSTONE_REPEATER_OFF: return 0.0f;
1383  case E_BLOCK_REDSTONE_REPEATER_ON: return 0.0f;
1384  case E_BLOCK_REDSTONE_TORCH_OFF: return 0.0f;
1385  case E_BLOCK_REDSTONE_TORCH_ON: return 0.0f;
1386  case E_BLOCK_REDSTONE_WIRE: return 0.0f;
1387  case E_BLOCK_RED_GLAZED_TERRACOTTA: return 1.4f;
1388  case E_BLOCK_RED_MUSHROOM: return 0.0f;
1389  case E_BLOCK_RED_NETHER_BRICK: return 2.0f;
1390  case E_BLOCK_RED_SANDSTONE: return 0.8f;
1391  case E_BLOCK_RED_SANDSTONE_SLAB: return 2.0f;
1392  case E_BLOCK_RED_SANDSTONE_STAIRS: return 0.8f;
1393  case E_BLOCK_RED_SHULKER_BOX: return 2.0f;
1394  case E_BLOCK_REPEATING_COMMAND_BLOCK: return INFINITY;
1395  case E_BLOCK_SAND: return 0.5f;
1396  case E_BLOCK_SANDSTONE: return 0.8f;
1397  case E_BLOCK_SANDSTONE_STAIRS: return 0.8f;
1398  case E_BLOCK_SAPLING: return 0.0f;
1399  case E_BLOCK_SEA_LANTERN: return 0.3f;
1400  case E_BLOCK_SIGN_POST: return 1.0f;
1401  case E_BLOCK_SILVERFISH_EGG: return 0.75f;
1402  case E_BLOCK_SLIME_BLOCK: return 0.0f;
1403  case E_BLOCK_SNOW: return 0.1f;
1404  case E_BLOCK_SNOW_BLOCK: return 0.2f;
1405  case E_BLOCK_SOULSAND: return 0.5f;
1406  case E_BLOCK_SPONGE: return 0.6f;
1407  case E_BLOCK_SPRUCE_DOOR: return 3.0f;
1408  case E_BLOCK_SPRUCE_FENCE: return 2.0f;
1409  case E_BLOCK_SPRUCE_FENCE_GATE: return 2.0f;
1410  case E_BLOCK_SPRUCE_WOOD_STAIRS: return 2.0f;
1411  case E_BLOCK_STAINED_CLAY: return 4.2f;
1412  case E_BLOCK_STAINED_GLASS: return 0.3f;
1413  case E_BLOCK_STAINED_GLASS_PANE: return 0.3f;
1414  case E_BLOCK_STANDING_BANNER: return 1.0f;
1415  case E_BLOCK_STATIONARY_LAVA: return 100.0f;
1416  case E_BLOCK_STATIONARY_WATER: return 100.0f;
1417  case E_BLOCK_STICKY_PISTON: return 0.5f;
1418  case E_BLOCK_STONE: return 1.5f;
1419  case E_BLOCK_STONE_BRICKS: return 1.5f;
1420  case E_BLOCK_STONE_BRICK_STAIRS: return 1.5f;
1421  case E_BLOCK_STONE_BUTTON: return 0.5f;
1422  case E_BLOCK_STONE_PRESSURE_PLATE: return 0.5f;
1423  case E_BLOCK_STONE_SLAB: return 2.0f;
1424  case E_BLOCK_STRUCTURE_BLOCK: return INFINITY;
1425  case E_BLOCK_STRUCTURE_VOID: return 0.0f;
1426  case E_BLOCK_SUGARCANE: return 0.0f;
1427  case E_BLOCK_TALL_GRASS: return 0.0f;
1428  case E_BLOCK_TNT: return 0.0f;
1429  case E_BLOCK_TORCH: return 0.0f;
1430  case E_BLOCK_TRAPDOOR: return 3.0f;
1431  case E_BLOCK_TRAPPED_CHEST: return 2.5f;
1432  case E_BLOCK_TRIPWIRE: return 0.0f;
1433  case E_BLOCK_TRIPWIRE_HOOK: return 0.0f;
1434  case E_BLOCK_VINES: return 0.2f;
1435  case E_BLOCK_WALLSIGN: return 1.0f;
1436  case E_BLOCK_WALL_BANNER: return 1.0f;
1437  case E_BLOCK_WATER: return 100.0f;
1438  case E_BLOCK_WHITE_GLAZED_TERRACOTTA: return 1.4f;
1439  case E_BLOCK_WHITE_SHULKER_BOX: return 2.0f;
1440  case E_BLOCK_WOODEN_BUTTON: return 0.5f;
1441  case E_BLOCK_WOODEN_PRESSURE_PLATE: return 0.5f;
1442  case E_BLOCK_WOODEN_SLAB: return 2.0f;
1443  case E_BLOCK_WOOL: return 0.8f;
1444  case E_BLOCK_YELLOW_GLAZED_TERRACOTTA: return 1.4f;
1445  case E_BLOCK_YELLOW_SHULKER_BOX: return 2.0f;
1446  default: return 0;
1447  }
1448 }
bool IsBlockMaterialRock(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:332
bool IsBlockMaterialLeaves(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:302
bool IsBlockMaterialVine(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:244
bool IsBlockMaterialIron(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:266
bool IsBlockIce(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:19
bool IsBlockMaterialGourd(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:311
bool IsBlockWater(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:10
bool IsBlockMaterialWood(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:146
bool IsBlockRail(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:67
bool IsBlockLiquid(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:58
bool IsBlockWaterOrIce(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:40
bool IsBlockMaterialPlants(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:209
bool IsBlockFence(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:105
bool IsBlockTypeOfDirt(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:86
bool IsBlockLava(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:49
bool IsBlockShulkerBox(BLOCKTYPE a_BlockType)
Definition: BlockInfo.cpp:137
@ E_BLOCK_ORANGE_GLAZED_TERRACOTTA
Definition: BlockType.h:255
@ E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE
Definition: BlockType.h:163
@ E_BLOCK_REDSTONE_LAMP_OFF
Definition: BlockType.h:138
@ E_BLOCK_WOODEN_BUTTON
Definition: BlockType.h:158
@ E_BLOCK_STAINED_GLASS
Definition: BlockType.h:110
@ E_BLOCK_WHITE_SHULKER_BOX
Definition: BlockType.h:238
@ E_BLOCK_NETHER_BRICK_STAIRS
Definition: BlockType.h:129
@ E_BLOCK_NEW_LEAVES
Definition: BlockType.h:180
@ E_BLOCK_PINK_SHULKER_BOX
Definition: BlockType.h:244
@ E_BLOCK_SPONGE
Definition: BlockType.h:29
@ E_BLOCK_PINK_GLAZED_TERRACOTTA
Definition: BlockType.h:260
@ E_BLOCK_CARROTS
Definition: BlockType.h:156
@ E_BLOCK_REDSTONE_TORCH_ON
Definition: BlockType.h:90
@ E_BLOCK_STONE_PRESSURE_PLATE
Definition: BlockType.h:84
@ E_BLOCK_BLUE_SHULKER_BOX
Definition: BlockType.h:249
@ E_BLOCK_POTATOES
Definition: BlockType.h:157
@ E_BLOCK_GRAY_GLAZED_TERRACOTTA
Definition: BlockType.h:261
@ E_BLOCK_DEAD_BUSH
Definition: BlockType.h:42
@ E_BLOCK_HEAD
Definition: BlockType.h:159
@ E_BLOCK_MELON_STEM
Definition: BlockType.h:120
@ E_BLOCK_OAK_WOOD_STAIRS
Definition: BlockType.h:63
@ E_BLOCK_STANDING_BANNER
Definition: BlockType.h:195
@ E_BLOCK_PURPUR_BLOCK
Definition: BlockType.h:220
@ E_BLOCK_CLAY
Definition: BlockType.h:96
@ E_BLOCK_DARK_OAK_FENCE
Definition: BlockType.h:210
@ E_BLOCK_DAYLIGHT_SENSOR
Definition: BlockType.h:167
@ E_BLOCK_COCOA_POD
Definition: BlockType.h:142
@ E_BLOCK_REDSTONE_REPEATER_ON
Definition: BlockType.h:109
@ E_BLOCK_BREWING_STAND
Definition: BlockType.h:132
@ E_BLOCK_PURPUR_STAIRS
Definition: BlockType.h:222
@ E_BLOCK_FLOWER
Definition: BlockType.h:48
@ E_BLOCK_STICKY_PISTON
Definition: BlockType.h:39
@ E_BLOCK_JACK_O_LANTERN
Definition: BlockType.h:106
@ E_BLOCK_NETHER_PORTAL
Definition: BlockType.h:105
@ E_BLOCK_JUKEBOX
Definition: BlockType.h:99
@ E_BLOCK_BROWN_SHULKER_BOX
Definition: BlockType.h:250
@ E_BLOCK_BONE_BLOCK
Definition: BlockType.h:235
@ E_BLOCK_DOUBLE_WOODEN_SLAB
Definition: BlockType.h:140
@ E_BLOCK_DRAGON_EGG
Definition: BlockType.h:137
@ E_BLOCK_COBBLESTONE_STAIRS
Definition: BlockType.h:81
@ E_BLOCK_DIAMOND_BLOCK
Definition: BlockType.h:67
@ E_BLOCK_WATER
Definition: BlockType.h:18
@ E_BLOCK_TRAPDOOR
Definition: BlockType.h:111
@ E_BLOCK_GRASS_PATH
Definition: BlockType.h:227
@ E_BLOCK_ACTIVATOR_RAIL
Definition: BlockType.h:174
@ E_BLOCK_CHORUS_PLANT
Definition: BlockType.h:218
@ E_BLOCK_STATIONARY_LAVA
Definition: BlockType.h:21
@ E_BLOCK_LIGHT_BLUE_SHULKER_BOX
Definition: BlockType.h:241
@ E_BLOCK_REDSTONE_ORE
Definition: BlockType.h:87
@ E_BLOCK_COAL_ORE
Definition: BlockType.h:26
@ E_BLOCK_SLIME_BLOCK
Definition: BlockType.h:184
@ E_BLOCK_BIRCH_FENCE_GATE
Definition: BlockType.h:203
@ E_BLOCK_DARK_OAK_WOOD_STAIRS
Definition: BlockType.h:183
@ E_BLOCK_FARMLAND
Definition: BlockType.h:72
@ E_BLOCK_REPEATING_COMMAND_BLOCK
Definition: BlockType.h:229
@ E_BLOCK_BURNING_FURNACE
Definition: BlockType.h:75
@ E_BLOCK_BLACK_GLAZED_TERRACOTTA
Definition: BlockType.h:269
@ E_BLOCK_DIAMOND_ORE
Definition: BlockType.h:66
@ E_BLOCK_BRICK_STAIRS
Definition: BlockType.h:123
@ E_BLOCK_ACACIA_FENCE_GATE
Definition: BlockType.h:206
@ E_BLOCK_CAULDRON
Definition: BlockType.h:133
@ E_BLOCK_BRICK
Definition: BlockType.h:55
@ E_BLOCK_STONE_BRICK_STAIRS
Definition: BlockType.h:124
@ E_BLOCK_AIR
Definition: BlockType.h:10
@ E_BLOCK_WOOL
Definition: BlockType.h:45
@ E_BLOCK_CHORUS_FLOWER
Definition: BlockType.h:219
@ E_BLOCK_ENCHANTMENT_TABLE
Definition: BlockType.h:131
@ E_BLOCK_STRUCTURE_VOID
Definition: BlockType.h:236
@ E_BLOCK_LILY_PAD
Definition: BlockType.h:126
@ E_BLOCK_FURNACE
Definition: BlockType.h:73
@ E_BLOCK_SIGN_POST
Definition: BlockType.h:76
@ E_BLOCK_END_PORTAL_FRAME
Definition: BlockType.h:135
@ E_BLOCK_CROPS
Definition: BlockType.h:71
@ E_BLOCK_PRISMARINE_BLOCK
Definition: BlockType.h:187
@ E_BLOCK_GOLD_BLOCK
Definition: BlockType.h:51
@ E_BLOCK_RED_NETHER_BRICK
Definition: BlockType.h:234
@ E_BLOCK_BLOCK_OF_REDSTONE
Definition: BlockType.h:168
@ E_BLOCK_LEAVES
Definition: BlockType.h:28
@ E_BLOCK_OAK_FENCE_GATE
Definition: BlockType.h:122
@ E_BLOCK_STONE_BRICKS
Definition: BlockType.h:113
@ E_BLOCK_PURPUR_PILLAR
Definition: BlockType.h:221
@ E_BLOCK_MOSSY_COBBLESTONE
Definition: BlockType.h:58
@ E_BLOCK_OBSERVER
Definition: BlockType.h:237
@ E_BLOCK_STAINED_GLASS_PANE
Definition: BlockType.h:179
@ E_BLOCK_BEACON
Definition: BlockType.h:153
@ E_BLOCK_SPRUCE_DOOR
Definition: BlockType.h:212
@ E_BLOCK_CARPET
Definition: BlockType.h:190
@ E_BLOCK_MAGENTA_SHULKER_BOX
Definition: BlockType.h:240
@ E_BLOCK_REDSTONE_ORE_GLOWING
Definition: BlockType.h:88
@ E_BLOCK_BLUE_GLAZED_TERRACOTTA
Definition: BlockType.h:265
@ E_BLOCK_BIRCH_WOOD_STAIRS
Definition: BlockType.h:150
@ E_BLOCK_CYAN_SHULKER_BOX
Definition: BlockType.h:247
@ E_BLOCK_FIRE
Definition: BlockType.h:61
@ E_BLOCK_TNT
Definition: BlockType.h:56
@ E_BLOCK_LIME_SHULKER_BOX
Definition: BlockType.h:243
@ E_BLOCK_LAPIS_ORE
Definition: BlockType.h:31
@ E_BLOCK_CHAIN_COMMAND_BLOCK
Definition: BlockType.h:230
@ E_BLOCK_IRON_BLOCK
Definition: BlockType.h:52
@ E_BLOCK_NETHER_WART_BLOCK
Definition: BlockType.h:233
@ E_BLOCK_PURPLE_SHULKER_BOX
Definition: BlockType.h:248
@ E_BLOCK_PISTON_EXTENSION
Definition: BlockType.h:44
@ E_BLOCK_CONCRETE
Definition: BlockType.h:270
@ E_BLOCK_END_ROD
Definition: BlockType.h:217
@ E_BLOCK_CHEST
Definition: BlockType.h:64
@ E_BLOCK_COBWEB
Definition: BlockType.h:40
@ E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB
Definition: BlockType.h:200
@ E_BLOCK_END_BRICKS
Definition: BlockType.h:225
@ E_BLOCK_BIRCH_DOOR
Definition: BlockType.h:213
@ E_BLOCK_CAKE
Definition: BlockType.h:107
@ E_BLOCK_BLOCK_OF_COAL
Definition: BlockType.h:192
@ E_BLOCK_JUNGLE_WOOD_STAIRS
Definition: BlockType.h:151
@ E_BLOCK_LIT_FURNACE
Definition: BlockType.h:74
@ E_BLOCK_LAPIS_BLOCK
Definition: BlockType.h:32
@ E_BLOCK_IRON_DOOR
Definition: BlockType.h:85
@ E_BLOCK_FENCE
Definition: BlockType.h:100
@ E_BLOCK_YELLOW_GLAZED_TERRACOTTA
Definition: BlockType.h:258
@ E_BLOCK_GRASS
Definition: BlockType.h:12
@ E_BLOCK_MAGENTA_GLAZED_TERRACOTTA
Definition: BlockType.h:256
@ E_BLOCK_STONE_SLAB
Definition: BlockType.h:54
@ E_BLOCK_ACACIA_WOOD_STAIRS
Definition: BlockType.h:182
@ E_BLOCK_EMERALD_ORE
Definition: BlockType.h:144
@ E_BLOCK_ORANGE_SHULKER_BOX
Definition: BlockType.h:239
@ E_BLOCK_CACTUS
Definition: BlockType.h:95
@ E_BLOCK_CYAN_GLAZED_TERRACOTTA
Definition: BlockType.h:263
@ E_BLOCK_GLASS_PANE
Definition: BlockType.h:117
@ E_BLOCK_ICE
Definition: BlockType.h:93
@ E_BLOCK_BEETROOTS
Definition: BlockType.h:226
@ E_BLOCK_BEDROCK
Definition: BlockType.h:17
@ E_BLOCK_MELON
Definition: BlockType.h:118
@ E_BLOCK_NETHER_WART
Definition: BlockType.h:130
@ E_BLOCK_LEVER
Definition: BlockType.h:83
@ E_BLOCK_INACTIVE_COMPARATOR
Definition: BlockType.h:165
@ E_BLOCK_SILVERFISH_EGG
Definition: BlockType.h:112
@ E_BLOCK_DOUBLE_STONE_SLAB
Definition: BlockType.h:53
@ E_BLOCK_JUNGLE_DOOR
Definition: BlockType.h:214
@ E_BLOCK_PACKED_ICE
Definition: BlockType.h:193
@ E_BLOCK_TRIPWIRE
Definition: BlockType.h:147
@ E_BLOCK_POWERED_RAIL
Definition: BlockType.h:37
@ E_BLOCK_NEW_LOG
Definition: BlockType.h:181
@ E_BLOCK_OBSIDIAN
Definition: BlockType.h:59
@ E_BLOCK_SOULSAND
Definition: BlockType.h:103
@ E_BLOCK_ACTIVE_COMPARATOR
Definition: BlockType.h:166
@ E_BLOCK_MYCELIUM
Definition: BlockType.h:125
@ E_BLOCK_RED_SANDSTONE_STAIRS
Definition: BlockType.h:199
@ E_BLOCK_SNOW_BLOCK
Definition: BlockType.h:94
@ E_BLOCK_DANDELION
Definition: BlockType.h:47
@ E_BLOCK_SNOW
Definition: BlockType.h:92
@ E_BLOCK_BROWN_MUSHROOM
Definition: BlockType.h:49
@ E_BLOCK_BOOKCASE
Definition: BlockType.h:57
@ E_BLOCK_PISTON_MOVED_BLOCK
Definition: BlockType.h:46
@ E_BLOCK_RED_SANDSTONE
Definition: BlockType.h:198
@ E_BLOCK_IRON_ORE
Definition: BlockType.h:25
@ E_BLOCK_STRUCTURE_BLOCK
Definition: BlockType.h:273
@ E_BLOCK_TRAPPED_CHEST
Definition: BlockType.h:161
@ E_BLOCK_OAK_DOOR
Definition: BlockType.h:77
@ E_BLOCK_PLANKS
Definition: BlockType.h:15
@ E_BLOCK_SPRUCE_FENCE_GATE
Definition: BlockType.h:202
@ E_BLOCK_GRAY_SHULKER_BOX
Definition: BlockType.h:245
@ E_BLOCK_DETECTOR_RAIL
Definition: BlockType.h:38
@ E_BLOCK_GRAVEL
Definition: BlockType.h:23
@ E_BLOCK_REDSTONE_WIRE
Definition: BlockType.h:65
@ E_BLOCK_IRON_BARS
Definition: BlockType.h:116
@ E_BLOCK_HAY_BALE
Definition: BlockType.h:189
@ E_BLOCK_LIGHT_BLUE_GLAZED_TERRACOTTA
Definition: BlockType.h:257
@ E_BLOCK_SPRUCE_WOOD_STAIRS
Definition: BlockType.h:149
@ E_BLOCK_YELLOW_SHULKER_BOX
Definition: BlockType.h:242
@ E_BLOCK_DARK_OAK_FENCE_GATE
Definition: BlockType.h:205
@ E_BLOCK_CONCRETE_POWDER
Definition: BlockType.h:271
@ E_BLOCK_JUNGLE_FENCE_GATE
Definition: BlockType.h:204
@ E_BLOCK_PURPLE_GLAZED_TERRACOTTA
Definition: BlockType.h:264
@ E_BLOCK_PUMPKIN
Definition: BlockType.h:101
@ E_BLOCK_BIG_FLOWER
Definition: BlockType.h:194
@ E_BLOCK_STAINED_CLAY
Definition: BlockType.h:177
@ E_BLOCK_ANVIL
Definition: BlockType.h:160
@ E_BLOCK_HARDENED_CLAY
Definition: BlockType.h:191
@ E_BLOCK_HUGE_BROWN_MUSHROOM
Definition: BlockType.h:114
@ E_BLOCK_COMMAND_BLOCK
Definition: BlockType.h:152
@ E_BLOCK_SUGARCANE
Definition: BlockType.h:97
@ E_BLOCK_WOODEN_PRESSURE_PLATE
Definition: BlockType.h:86
@ E_BLOCK_SANDSTONE
Definition: BlockType.h:34
@ E_BLOCK_HUGE_RED_MUSHROOM
Definition: BlockType.h:115
@ E_BLOCK_VINES
Definition: BlockType.h:121
@ E_BLOCK_EMERALD_BLOCK
Definition: BlockType.h:148
@ E_BLOCK_TORCH
Definition: BlockType.h:60
@ E_BLOCK_GREEN_SHULKER_BOX
Definition: BlockType.h:251
@ E_BLOCK_BLACK_SHULKER_BOX
Definition: BlockType.h:253
@ E_BLOCK_SPRUCE_FENCE
Definition: BlockType.h:207
@ E_BLOCK_REDSTONE_TORCH_OFF
Definition: BlockType.h:89
@ E_BLOCK_GOLD_ORE
Definition: BlockType.h:24
@ E_BLOCK_STONE
Definition: BlockType.h:11
@ E_BLOCK_END_GATEWAY
Definition: BlockType.h:228
@ E_BLOCK_LIGHT_GRAY_GLAZED_TERRACOTTA
Definition: BlockType.h:262
@ E_BLOCK_NETHER_QUARTZ_ORE
Definition: BlockType.h:170
@ E_BLOCK_LIGHT_GRAY_SHULKER_BOX
Definition: BlockType.h:246
@ E_BLOCK_GREEN_GLAZED_TERRACOTTA
Definition: BlockType.h:267
@ E_BLOCK_WOODEN_SLAB
Definition: BlockType.h:141
@ E_BLOCK_SEA_LANTERN
Definition: BlockType.h:188
@ E_BLOCK_NOTE_BLOCK
Definition: BlockType.h:35
@ E_BLOCK_LADDER
Definition: BlockType.h:78
@ E_BLOCK_DARK_OAK_DOOR
Definition: BlockType.h:216
@ E_BLOCK_REEDS
Definition: BlockType.h:98
@ E_BLOCK_BED
Definition: BlockType.h:36
@ E_BLOCK_RED_MUSHROOM
Definition: BlockType.h:50
@ E_BLOCK_ACACIA_DOOR
Definition: BlockType.h:215
@ E_BLOCK_DIRT
Definition: BlockType.h:13
@ E_BLOCK_SANDSTONE_STAIRS
Definition: BlockType.h:143
@ E_BLOCK_QUARTZ_BLOCK
Definition: BlockType.h:172
@ E_BLOCK_NETHERRACK
Definition: BlockType.h:102
@ E_BLOCK_LOG
Definition: BlockType.h:27
@ E_BLOCK_SAPLING
Definition: BlockType.h:16
@ E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE
Definition: BlockType.h:162
@ E_BLOCK_HOPPER
Definition: BlockType.h:171
@ E_BLOCK_ACACIA_FENCE
Definition: BlockType.h:211
@ E_BLOCK_DROPPER
Definition: BlockType.h:176
@ E_BLOCK_REDSTONE_REPEATER_OFF
Definition: BlockType.h:108
@ E_BLOCK_ENDER_CHEST
Definition: BlockType.h:145
@ E_BLOCK_END_PORTAL
Definition: BlockType.h:134
@ E_BLOCK_GLOWSTONE
Definition: BlockType.h:104
@ E_BLOCK_RAIL
Definition: BlockType.h:79
@ E_BLOCK_SAND
Definition: BlockType.h:22
@ E_BLOCK_DISPENSER
Definition: BlockType.h:33
@ E_BLOCK_IRON_TRAPDOOR
Definition: BlockType.h:186
@ E_BLOCK_MAGMA
Definition: BlockType.h:232
@ E_BLOCK_PURPUR_DOUBLE_SLAB
Definition: BlockType.h:223
@ E_BLOCK_LIME_GLAZED_TERRACOTTA
Definition: BlockType.h:259
@ E_BLOCK_STONE_BUTTON
Definition: BlockType.h:91
@ E_BLOCK_GLASS
Definition: BlockType.h:30
@ E_BLOCK_REDSTONE_LAMP_ON
Definition: BlockType.h:139
@ E_BLOCK_PUMPKIN_STEM
Definition: BlockType.h:119
@ E_BLOCK_INVERTED_DAYLIGHT_SENSOR
Definition: BlockType.h:197
@ E_BLOCK_FLOWER_POT
Definition: BlockType.h:155
@ E_BLOCK_TRIPWIRE_HOOK
Definition: BlockType.h:146
@ E_BLOCK_WHITE_GLAZED_TERRACOTTA
Definition: BlockType.h:254
@ E_BLOCK_END_STONE
Definition: BlockType.h:136
@ E_BLOCK_STATIONARY_WATER
Definition: BlockType.h:19
@ E_BLOCK_COBBLESTONE_WALL
Definition: BlockType.h:154
@ E_BLOCK_PURPUR_SLAB
Definition: BlockType.h:224
@ E_BLOCK_BROWN_GLAZED_TERRACOTTA
Definition: BlockType.h:266
@ E_BLOCK_MOB_SPAWNER
Definition: BlockType.h:62
@ E_BLOCK_NETHER_BRICK_FENCE
Definition: BlockType.h:128
@ E_BLOCK_RED_SANDSTONE_SLAB
Definition: BlockType.h:201
@ E_BLOCK_QUARTZ_STAIRS
Definition: BlockType.h:173
@ E_BLOCK_RED_SHULKER_BOX
Definition: BlockType.h:252
@ E_BLOCK_WALLSIGN
Definition: BlockType.h:82
@ E_BLOCK_BIRCH_FENCE
Definition: BlockType.h:208
@ E_BLOCK_BARRIER
Definition: BlockType.h:185
@ E_BLOCK_LAVA
Definition: BlockType.h:20
@ E_BLOCK_NETHER_BRICK
Definition: BlockType.h:127
@ E_BLOCK_FROSTED_ICE
Definition: BlockType.h:231
@ E_BLOCK_PISTON
Definition: BlockType.h:43
@ E_BLOCK_CRAFTING_TABLE
Definition: BlockType.h:68
@ E_BLOCK_WALL_BANNER
Definition: BlockType.h:196
@ E_BLOCK_RED_GLAZED_TERRACOTTA
Definition: BlockType.h:268
@ E_BLOCK_TALL_GRASS
Definition: BlockType.h:41
@ E_BLOCK_JUNGLE_FENCE
Definition: BlockType.h:209
@ E_BLOCK_COBBLESTONE
Definition: BlockType.h:14
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:44
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:41
static float GetBlockHeight(BLOCKTYPE Block)
Block's height.
Definition: BlockInfo.cpp:1153
static float GetHardness(BLOCKTYPE Block)
Block's hardness.
Definition: BlockInfo.cpp:1187
static bool IsUseableBySpectator(BLOCKTYPE Block)
Can a spectator interact with this block?
Definition: BlockInfo.cpp:1134
static bool CanBeTerraformed(BLOCKTYPE Block)
Can a finisher change it?
Definition: BlockInfo.cpp:575
static bool IsSolid(BLOCKTYPE Block)
Is this block solid (player cannot walk through)?
Definition: BlockInfo.cpp:892
static NIBBLETYPE GetSpreadLightFalloff(BLOCKTYPE Block)
How much light do the blocks consume?
Definition: BlockInfo.cpp:447
static bool IsSnowable(BLOCKTYPE Block)
Definition: BlockInfo.cpp:879
static bool FullyOccupiesVoxel(BLOCKTYPE Block)
Does this block fully occupy its voxel - is it a 'full' block?
Definition: BlockInfo.cpp:606
static NIBBLETYPE GetLightValue(BLOCKTYPE Block)
How much light do the blocks emit on their own?
Definition: BlockInfo.cpp:411
static bool IsClickedThrough(BLOCKTYPE a_Block)
Does the client pretend the block doesn't exist when clicking? For example, digging a fire will hit t...
Definition: BlockInfo.cpp:720
static bool IsTransparent(BLOCKTYPE Block)
Is a block transparent? (https://minecraft.wiki/w/Opacity)
Definition: BlockInfo.cpp:961
static bool IsPistonBreakable(BLOCKTYPE Block)
Can a piston break this block?
Definition: BlockInfo.cpp:750
static bool IsOneHitDig(BLOCKTYPE Block)
Is a block destroyed after a single hit? Warning: IsOneHitDig does not take into account enchantments...
Definition: BlockInfo.cpp:731
static bool IsRainBlocker(BLOCKTYPE Block)
Does this block block the passage of rain?
Definition: BlockInfo.cpp:847
static bool IsSkylightDispersant(BLOCKTYPE Block)
Does this block disperse sky light? (only relevant for transparent blocks)
Definition: BlockInfo.cpp:864