diff options
Diffstat (limited to '')
-rw-r--r-- | src/Items/ItemBanner.h | 4 | ||||
-rw-r--r-- | src/Items/ItemBed.h | 5 | ||||
-rw-r--r-- | src/Items/ItemBigFlower.h | 5 | ||||
-rw-r--r-- | src/Items/ItemDoor.h | 5 | ||||
-rw-r--r-- | src/Items/ItemDye.h | 6 | ||||
-rw-r--r-- | src/Items/ItemEyeOfEnder.h | 4 | ||||
-rw-r--r-- | src/Items/ItemHoe.h | 5 | ||||
-rw-r--r-- | src/Items/ItemShears.h | 5 |
8 files changed, 29 insertions, 10 deletions
diff --git a/src/Items/ItemBanner.h b/src/Items/ItemBanner.h index a404af336..551c41429 100644 --- a/src/Items/ItemBanner.h +++ b/src/Items/ItemBanner.h @@ -40,7 +40,9 @@ private: { ASSERT((a_BlockEntity.GetBlockType() == E_BLOCK_STANDING_BANNER) || (a_BlockEntity.GetBlockType() == E_BLOCK_WALL_BANNER)); - static_cast<cBannerEntity &>(a_BlockEntity).SetBaseColor(static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage)); + cBannerEntity & BannerEntity = static_cast<cBannerEntity &>(a_BlockEntity); + BannerEntity.SetBaseColor(static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage)); + BannerEntity.SetCustomName(a_HeldItem.m_CustomName); return false; }); diff --git a/src/Items/ItemBed.h b/src/Items/ItemBed.h index a2e254171..77818e7c7 100644 --- a/src/Items/ItemBed.h +++ b/src/Items/ItemBed.h @@ -27,7 +27,10 @@ public: auto & World = *a_Player.GetWorld(); BLOCKTYPE HeadType; NIBBLETYPE HeadMeta; - World.GetBlockTypeMeta(HeadPosition, HeadType, HeadMeta); + if (!World.GetBlockTypeMeta(HeadPosition, HeadType, HeadMeta)) + { + return false; + } // Vanilla only allows beds to be placed into air. // Check if there is empty space for the "head" block: diff --git a/src/Items/ItemBigFlower.h b/src/Items/ItemBigFlower.h index cbdecbed7..a135a220d 100644 --- a/src/Items/ItemBigFlower.h +++ b/src/Items/ItemBigFlower.h @@ -29,7 +29,10 @@ public: const auto TopPos = a_PlacePosition.addedY(1); BLOCKTYPE TopType; NIBBLETYPE TopMeta; - World.GetBlockTypeMeta(TopPos, TopType, TopMeta); + if (!World.GetBlockTypeMeta(TopPos, TopType, TopMeta)) + { + return false; + } if (!cBlockHandler::For(TopType).DoesIgnoreBuildCollision(World, a_HeldItem, TopPos, TopMeta, a_ClickedBlockFace, false)) { diff --git a/src/Items/ItemDoor.h b/src/Items/ItemDoor.h index 6538a5bef..f28d3ad36 100644 --- a/src/Items/ItemDoor.h +++ b/src/Items/ItemDoor.h @@ -54,7 +54,10 @@ public: { BLOCKTYPE TopType; NIBBLETYPE TopMeta; - World.GetBlockTypeMeta(UpperBlockPosition, TopType, TopMeta); + if (!World.GetBlockTypeMeta(UpperBlockPosition, TopType, TopMeta)) + { + return false; + } if (!cBlockHandler::For(TopType).DoesIgnoreBuildCollision(World, a_HeldItem, UpperBlockPosition, TopMeta, a_ClickedBlockFace, false)) { diff --git a/src/Items/ItemDye.h b/src/Items/ItemDye.h index 636a1b477..b0f00b9ba 100644 --- a/src/Items/ItemDye.h +++ b/src/Items/ItemDye.h @@ -54,10 +54,12 @@ public: // Cocoa (brown dye) can be planted on jungle logs: BLOCKTYPE BlockType; NIBBLETYPE BlockMeta; - a_World->GetBlockTypeMeta(a_ClickedBlockPos, BlockType, BlockMeta); // Check if the block that the player clicked is a jungle log. - if ((BlockType != E_BLOCK_LOG) || ((BlockMeta & 0x03) != E_META_LOG_JUNGLE)) + if ( + !a_World->GetBlockTypeMeta(a_ClickedBlockPos, BlockType, BlockMeta) || + ((BlockType != E_BLOCK_LOG) || ((BlockMeta & 0x03) != E_META_LOG_JUNGLE)) + ) { return false; } diff --git a/src/Items/ItemEyeOfEnder.h b/src/Items/ItemEyeOfEnder.h index fc6fac336..414d81c39 100644 --- a/src/Items/ItemEyeOfEnder.h +++ b/src/Items/ItemEyeOfEnder.h @@ -35,8 +35,8 @@ public: { BLOCKTYPE FacingBlock; NIBBLETYPE FacingMeta; - a_World->GetBlockTypeMeta(a_ClickedBlockPos, FacingBlock, FacingMeta); - if (FacingBlock == E_BLOCK_END_PORTAL_FRAME) + + if (a_World->GetBlockTypeMeta(a_ClickedBlockPos, FacingBlock, FacingMeta) && (FacingBlock == E_BLOCK_END_PORTAL_FRAME)) { // Fill the portal frame. E_META_END_PORTAL_EYE is the bit for holding the eye of ender. if ((FacingMeta & E_META_END_PORTAL_FRAME_EYE) != E_META_END_PORTAL_FRAME_EYE) diff --git a/src/Items/ItemHoe.h b/src/Items/ItemHoe.h index 2bca5f5ca..503047328 100644 --- a/src/Items/ItemHoe.h +++ b/src/Items/ItemHoe.h @@ -46,7 +46,10 @@ public: // Can only transform dirt or grass blocks: BLOCKTYPE BlockType; NIBBLETYPE BlockMeta; - a_World->GetBlockTypeMeta(a_ClickedBlockPos, BlockType, BlockMeta); + if (!a_World->GetBlockTypeMeta(a_ClickedBlockPos, BlockType, BlockMeta)) + { + return false; + } if ((BlockType != E_BLOCK_DIRT) && (BlockType != E_BLOCK_GRASS)) { return false; diff --git a/src/Items/ItemShears.h b/src/Items/ItemShears.h index 5f8e9e2f1..00504884c 100644 --- a/src/Items/ItemShears.h +++ b/src/Items/ItemShears.h @@ -32,7 +32,10 @@ public: { BLOCKTYPE Block; NIBBLETYPE BlockMeta; - a_World->GetBlockTypeMeta(a_ClickedBlockPos, Block, BlockMeta); + if (!a_World->GetBlockTypeMeta(a_ClickedBlockPos, Block, BlockMeta)) + { + return false; + } if ((Block == E_BLOCK_LEAVES) || (Block == E_BLOCK_NEW_LEAVES)) { |