From 5111628ba5b60aa5c9191ff6a09573920ac50e9c Mon Sep 17 00:00:00 2001 From: Howaner Date: Tue, 30 Sep 2014 19:49:42 +0200 Subject: Fixed 1.8 doors. --- src/Blocks/BlockDoor.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index 0ff8bcfc8..7e46feec4 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -173,7 +173,20 @@ public: /** Returns true if the specified blocktype is any kind of door */ inline static bool IsDoor(BLOCKTYPE a_Block) { - return (a_Block == E_BLOCK_WOODEN_DOOR) || (a_Block == E_BLOCK_IRON_DOOR); + switch (a_Block) + { + case E_BLOCK_ACACIA_DOOR: + case E_BLOCK_BIRCH_DOOR: + case E_BLOCK_DARK_OAK_DOOR: + case E_BLOCK_IRON_DOOR: + case E_BLOCK_JUNGLE_DOOR: + case E_BLOCK_SPRUCE_DOOR: + case E_BLOCK_WOODEN_DOOR: + { + return true; + } + } + return false; } -- cgit v1.2.3 From 83973520c8492225e5ea02ebfd0a5d47b7e35f85 Mon Sep 17 00:00:00 2001 From: Howaner Date: Tue, 30 Sep 2014 20:04:49 +0200 Subject: Fixed iron trapdoors --- src/Blocks/BlockTrapdoor.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockTrapdoor.h b/src/Blocks/BlockTrapdoor.h index 41256ae55..d3f3c9a38 100644 --- a/src/Blocks/BlockTrapdoor.h +++ b/src/Blocks/BlockTrapdoor.h @@ -29,6 +29,11 @@ public: virtual void OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override { + if (m_BlockType == E_BLOCK_IRON_TRAPDOOR) + { + return; + } + // Flip the ON bit on/off using the XOR bitwise operation NIBBLETYPE Meta = (a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ) ^ 0x04); a_ChunkInterface.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta); -- cgit v1.2.3 From 425df6b69490e29b367c62476a125aa84bbcbcc5 Mon Sep 17 00:00:00 2001 From: Howaner Date: Tue, 30 Sep 2014 20:31:27 +0200 Subject: Fixed 1.8 dirt types --- src/Blocks/BlockDirt.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockDirt.h b/src/Blocks/BlockDirt.h index 60d81db72..b6d762dcf 100644 --- a/src/Blocks/BlockDirt.h +++ b/src/Blocks/BlockDirt.h @@ -21,7 +21,15 @@ public: virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override { - a_Pickups.push_back(cItem(E_BLOCK_DIRT, 1, 0)); + if (a_BlockMeta == E_META_DIRT_COARSE) + { + // Drop the coarse block (dirt, meta 1) + a_Pickups.Add(E_BLOCK_DIRT, 1, 1); + } + else + { + a_Pickups.Add(E_BLOCK_DIRT, 1, 0); + } } -- cgit v1.2.3 From 7d3016c7adc1a2d88447acfaf6c642ab25028a35 Mon Sep 17 00:00:00 2001 From: Howaner Date: Tue, 30 Sep 2014 20:59:59 +0200 Subject: Code improvements --- src/Blocks/BlockDirt.h | 4 ++-- src/Blocks/BlockDoor.h | 5 ++++- src/Blocks/BlockTrapdoor.h | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockDirt.h b/src/Blocks/BlockDirt.h index b6d762dcf..19f889372 100644 --- a/src/Blocks/BlockDirt.h +++ b/src/Blocks/BlockDirt.h @@ -24,11 +24,11 @@ public: if (a_BlockMeta == E_META_DIRT_COARSE) { // Drop the coarse block (dirt, meta 1) - a_Pickups.Add(E_BLOCK_DIRT, 1, 1); + a_Pickups.Add(E_BLOCK_DIRT, 1, E_META_DIRT_COARSE); } else { - a_Pickups.Add(E_BLOCK_DIRT, 1, 0); + a_Pickups.Add(E_BLOCK_DIRT, 1, E_META_DIRT_NORMAL); } } diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index 7e46feec4..92ad8da12 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -185,8 +185,11 @@ public: { return true; } + default: + { + return false; + } } - return false; } diff --git a/src/Blocks/BlockTrapdoor.h b/src/Blocks/BlockTrapdoor.h index d3f3c9a38..8c96de0f1 100644 --- a/src/Blocks/BlockTrapdoor.h +++ b/src/Blocks/BlockTrapdoor.h @@ -31,6 +31,7 @@ public: { if (m_BlockType == E_BLOCK_IRON_TRAPDOOR) { + // Iron doors can only be toggled by redstone, not by right-clicking return; } -- cgit v1.2.3