89 if ((MaxY != 0) && (newY == Y + 1))
107 for (
int checkBorder = FoundObsidianY + 1; checkBorder <= MaxY - 1; checkBorder++)
127 int X1 = X + 1, Z1 = Z + 1, X2 = X - 1, Z2 = Z - 1;
142 int PortalHeight = MaxY - Y - 1;
143 int PortalWidth = a_Scratch.
XZP - a_Scratch.
XZM + 1;
156 for (
int Height = Y + 1; Height <= MaxY - 1; Height++)
158 for (
int Width = a_Scratch.
XZM; Width <= a_Scratch.
XZP; Width++)
160 if (a_Scratch.
Dir == 1)
177 bool FoundFrameXP =
false, FoundFrameXM =
false;
182 if ((Value == -1) || (ValueTwo == -1))
187 else if ((Value != MaxY) && (ValueTwo != MaxY))
192 a_Scratch.
XZP = X1 - 1;
197 if ((Value == -1) || (ValueTwo == -1))
202 else if ((Value != MaxY) && (ValueTwo != MaxY))
207 a_Scratch.
XZM = X2 + 1;
209 return (FoundFrameXP && FoundFrameXM);
216 bool FoundFrameZP =
false, FoundFrameZM =
false;
221 if ((Value == -1) || (ValueTwo == -1))
226 else if ((Value != MaxY) && (ValueTwo != MaxY))
231 a_Scratch.
XZP = Z1 - 1;
236 if ((Value == -1) || (ValueTwo == -1))
241 else if ((Value != MaxY) && (ValueTwo != MaxY))
246 a_Scratch.
XZM = Z2 + 1;
248 return (FoundFrameZP && FoundFrameZM);
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
virtual bool DoesIgnoreBuildCollision(const cWorld &a_World, const cItem &a_HeldItem, const Vector3i a_Position, const NIBBLETYPE a_Meta, const eBlockFace a_ClickedBlockFace, const bool a_ClickedDirectly) const override
Checks if the player can build "inside" this block.
static bool FindPortalSliceZ(int X, int Y, int Z1, int Z2, int MaxY, cChunkInterface &a_ChunkInterface, Scratch &a_Scratch)
Evaluates if coords are a portal going ZP / ZM; returns true if so, and writes boundaries to variable...
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
Returns the base colour ID of the block, as will be represented on a map, as per documentation: https...
static void FindAndSetPortalFrame(int X, int Y, int Z, cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, Scratch &a_Scratch)
Finds entire frame in any direction with the coordinates of a base block and fills hole with nether p...
static bool FindPortalSliceX(int X1, int X2, int Y, int Z, int MaxY, cChunkInterface &a_ChunkInterface, Scratch &a_Scratch)
Evaluates if coordinates are a portal going XP / XM; returns true if so, and writes boundaries to var...
static int FindObsidianCeiling(int X, int Y, int Z, cChunkInterface &a_ChunkInterface, int MaxY=0)
Traces along YP until it finds an obsidian block, returns Y difference or 0 if no portal,...
virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem *const a_Tool) const override
Returns the pickups that would result if the block was mined by a_Digger using a_Tool.
static bool EvaluatePortalBorder(int X, int FoundObsidianY, int Z, int MaxY, cChunkInterface &a_ChunkInterface)
Evaluates if coords have a valid border on top, based on MaxY.
virtual void OnPlaced(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) const override
Called by cWorld::SetBlock() after the block has been set.
int XZP
Portal boundary and direction variables.
constexpr cBlockHandler(BLOCKTYPE a_BlockType)
void SetBlock(Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Sets the block at the specified coords to the specified value.
BLOCKTYPE GetBlock(Vector3i a_Pos)
virtual int GetMaxNetherPortalWidth(void) const =0
virtual int GetMinNetherPortalWidth(void) const =0
Returns or sets the minumim or maximum netherportal width.
virtual int GetMinNetherPortalHeight(void) const =0
Returns or sets the minumim or maximum netherportal height.
virtual int GetMaxNetherPortalHeight(void) const =0
virtual eDimension GetDimension(void) const =0
This class bridges a vector of cItem for safe access via Lua.