From 01b8ed5295875262a91b60af878bf2a18c1b7aae Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 3 Apr 2020 08:57:01 +0200 Subject: Pulled the BlockID and BlockInfo headers from Globals.h. (#4591) The BlockID.h file was removed from Globals.h and renamed to BlockType.h (main change) The BlockInfo.h file was removed from Globals.h (main change) The ENUM_BLOCK_ID and ENUM_ITEM_ID enum names were replaced with ENUM_BLOCK_TYPE and ENUM_ITEM_TYPE (cosmetics) The various enums, such as eDimension, eDamageType and eExplosionSource were moved from BlockType.h to Defines.h, together with the helper functions for converting between them and strings (StringToDimension et al.) (minor) Many inline functions were moved from headers to their respective cpp files, so that BlockType.h could be included only into the cpp file, rather than the header. That broke our tests a bit, since they pick bits and pieces out of the main code and provide stubs for the rest; they had to be re-stubbed and re-verified. eMonsterType values are no longer tied to E_ITEM_SPAWN_EGG_META_* values --- src/Blocks/BlockBigFlower.h | 1 + src/Blocks/BlockButton.h | 1 + src/Blocks/BlockCactus.h | 1 + src/Blocks/BlockDoor.h | 1 + src/Blocks/BlockHandler.h | 2 +- src/Blocks/BlockPiston.cpp | 1 + src/Blocks/BlockSlab.h | 2 ++ src/Blocks/BlockStems.h | 2 +- src/Blocks/ChunkInterface.cpp | 1 + src/Blocks/ChunkInterface.h | 7 +++++++ 10 files changed, 17 insertions(+), 2 deletions(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockBigFlower.h b/src/Blocks/BlockBigFlower.h index f81b16bd2..720c8f40a 100644 --- a/src/Blocks/BlockBigFlower.h +++ b/src/Blocks/BlockBigFlower.h @@ -3,6 +3,7 @@ #include "BlockHandler.h" #include "ChunkInterface.h" +#include "../BlockInfo.h" #include "../Items/ItemHandler.h" diff --git a/src/Blocks/BlockButton.h b/src/Blocks/BlockButton.h index 8f90f84e5..10d3569d0 100644 --- a/src/Blocks/BlockButton.h +++ b/src/Blocks/BlockButton.h @@ -1,6 +1,7 @@ #pragma once #include "BlockHandler.h" +#include "../BlockInfo.h" #include "../Chunk.h" #include "Mixins.h" diff --git a/src/Blocks/BlockCactus.h b/src/Blocks/BlockCactus.h index 8c24cda9f..a00f5b6d4 100644 --- a/src/Blocks/BlockCactus.h +++ b/src/Blocks/BlockCactus.h @@ -1,6 +1,7 @@ #pragma once #include "BlockPlant.h" +#include "../BlockInfo.h" diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index 596e69793..ccb34c5a9 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -2,6 +2,7 @@ #pragma once #include "BlockHandler.h" +#include "../BlockInfo.h" #include "../Entities/Player.h" #include "../Chunk.h" #include "Mixins.h" diff --git a/src/Blocks/BlockHandler.h b/src/Blocks/BlockHandler.h index 789ef4dd5..75f6610ce 100644 --- a/src/Blocks/BlockHandler.h +++ b/src/Blocks/BlockHandler.h @@ -2,7 +2,7 @@ #pragma once #include "../Defines.h" - +#include "../Item.h" #include "../BoundingBox.h" diff --git a/src/Blocks/BlockPiston.cpp b/src/Blocks/BlockPiston.cpp index 5c929c4c5..5a18cffac 100644 --- a/src/Blocks/BlockPiston.cpp +++ b/src/Blocks/BlockPiston.cpp @@ -1,6 +1,7 @@ #include "Globals.h" #include "BlockPiston.h" +#include "../BlockInfo.h" #include "../Item.h" #include "../World.h" #include "../Entities/Player.h" diff --git a/src/Blocks/BlockSlab.h b/src/Blocks/BlockSlab.h index a136cd6e0..ef58c243c 100644 --- a/src/Blocks/BlockSlab.h +++ b/src/Blocks/BlockSlab.h @@ -11,7 +11,9 @@ #include "BlockHandler.h" #include "ChunkInterface.h" +#include "../BlockInfo.h" #include "../Entities/Player.h" +#include "../BlockInfo.h" diff --git a/src/Blocks/BlockStems.h b/src/Blocks/BlockStems.h index 0eb091b3c..202d71b19 100644 --- a/src/Blocks/BlockStems.h +++ b/src/Blocks/BlockStems.h @@ -10,7 +10,7 @@ /** Handler for stems from which produce grows in an adjacent block (melon, pumpkin) after it becomes ripe (meta == 7). ProduceBlockType is the blocktype for the produce to be grown. StemPickupType is the item type for the pickup resulting from breaking the stem. */ -template +template class cBlockStemsHandler: public cBlockPlant { diff --git a/src/Blocks/ChunkInterface.cpp b/src/Blocks/ChunkInterface.cpp index eff3f4da9..fd64ee9fc 100644 --- a/src/Blocks/ChunkInterface.cpp +++ b/src/Blocks/ChunkInterface.cpp @@ -6,6 +6,7 @@ #include "WorldInterface.h" #include "../ChunkMap.h" #include "../World.h" +#include "../BlockInfo.h" diff --git a/src/Blocks/ChunkInterface.h b/src/Blocks/ChunkInterface.h index 4ff2fb3fe..345fca4d2 100644 --- a/src/Blocks/ChunkInterface.h +++ b/src/Blocks/ChunkInterface.h @@ -5,10 +5,17 @@ + +// fwd: +class cItem; class cChunkMap; class cWorldInterface; class cPlayer; + + + + class cChunkInterface: public cForEachChunkProvider { -- cgit v1.2.3