summaryrefslogtreecommitdiffstats
path: root/src/Blocks
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-06-28 21:04:34 +0200
committerMattes D <github@xoft.cz>2015-06-28 21:04:34 +0200
commitfe81a0dcde1466c846ef7afe5356e051a4e3cc1d (patch)
tree458160137feb67c73766b1249bc8d686c2c29e3a /src/Blocks
parentuse atomic for state, to avoid torn reads (diff)
parentAdded a size check for portals. (diff)
downloadcuberite-fe81a0dcde1466c846ef7afe5356e051a4e3cc1d.tar
cuberite-fe81a0dcde1466c846ef7afe5356e051a4e3cc1d.tar.gz
cuberite-fe81a0dcde1466c846ef7afe5356e051a4e3cc1d.tar.bz2
cuberite-fe81a0dcde1466c846ef7afe5356e051a4e3cc1d.tar.lz
cuberite-fe81a0dcde1466c846ef7afe5356e051a4e3cc1d.tar.xz
cuberite-fe81a0dcde1466c846ef7afe5356e051a4e3cc1d.tar.zst
cuberite-fe81a0dcde1466c846ef7afe5356e051a4e3cc1d.zip
Diffstat (limited to 'src/Blocks')
-rw-r--r--src/Blocks/BlockFire.h14
-rw-r--r--src/Blocks/WorldInterface.h12
2 files changed, 26 insertions, 0 deletions
diff --git a/src/Blocks/BlockFire.h b/src/Blocks/BlockFire.h
index ec752885a..3f75455da 100644
--- a/src/Blocks/BlockFire.h
+++ b/src/Blocks/BlockFire.h
@@ -121,6 +121,20 @@ public:
}
}
+ int PortalHeight = MaxY - Y - 1;
+ int PortalWidth = XZP - XZM + 1;
+ if ((PortalHeight < a_WorldInterface.GetMinNetherPortalHeight()) || (PortalHeight > a_WorldInterface.GetMaxNetherPortalHeight()))
+ {
+ // The portal isn't high enough, or is too high
+ return;
+ }
+
+ if ((PortalWidth < a_WorldInterface.GetMinNetherPortalWidth()) || (PortalWidth > a_WorldInterface.GetMaxNetherPortalWidth()))
+ {
+ // The portal isn't wide enough, or is too wide
+ return;
+ }
+
for (int Height = Y + 1; Height <= MaxY - 1; Height++) // Loop through boundary to set portal blocks
{
for (int Width = XZM; Width <= XZP; Width++)
diff --git a/src/Blocks/WorldInterface.h b/src/Blocks/WorldInterface.h
index 44c118195..826df7034 100644
--- a/src/Blocks/WorldInterface.h
+++ b/src/Blocks/WorldInterface.h
@@ -55,6 +55,18 @@ public:
/** Returns true if it is raining, stormy or snowing at the specified location. This takes into account biomes. */
virtual bool IsWeatherWetAt(int a_BlockX, int a_BlockZ) = 0;
+ /** Returns or sets the minumim or maximum netherportal width */
+ virtual int GetMinNetherPortalWidth(void) const = 0;
+ virtual int GetMaxNetherPortalWidth(void) const = 0;
+ virtual void SetMinNetherPortalWidth(int a_NewMinWidth) = 0;
+ virtual void SetMaxNetherPortalWidth(int a_NewMaxWidth) = 0;
+
+ /** Returns or sets the minumim or maximum netherportal height */
+ virtual int GetMinNetherPortalHeight(void) const = 0;
+ virtual int GetMaxNetherPortalHeight(void) const = 0;
+ virtual void SetMinNetherPortalHeight(int a_NewMinHeight) = 0;
+ virtual void SetMaxNetherPortalHeight(int a_NewMaxHeight) = 0;
+
/** Returns the world height at the specified coords; waits for the chunk to get loaded / generated */
virtual int GetHeight(int a_BlockX, int a_BlockZ) = 0;