From 33b9c5dc6dae42fb6fc33283ded888a8001e5394 Mon Sep 17 00:00:00 2001 From: hle0 <91701075+hle0@users.noreply.github.com> Date: Thu, 7 Nov 2024 18:05:47 -0500 Subject: Fix cChunkMap issues below with coords below y=0 (#5397) * return false in cChunkMap::GetBlockTypeMeta if requested height is invalid * add checks to users of cWorld::GetBlockTypeMeta * add checks for invalid height to cChunkMap::GetBlock and cChunkMap::GetBlockMeta * add hle0 to CONTRIBUTORS * Fix merge conflict with isValidHeight * Add initialisation contract and fulfil it. --------- Co-authored-by: Alexander Harkness --- src/Items/ItemEyeOfEnder.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Items/ItemEyeOfEnder.h') 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) -- cgit v1.2.3