mirror of
https://github.com/GTNewHorizons/bdlib.git
synced 2026-11-18 11:29:31 +00:00
Fixed BlockRef crash on dedicated servers (bdew/generators#26)
This commit is contained in:
1 parent
be3a1cf2aa
commit
35b3a77582
1 file changed
+1
-1
@@ -18,7 +18,7 @@ import net.minecraftforge.common.util.ForgeDirection
|
||||
import scala.reflect.ClassTag
|
||||
|
||||
case class BlockRef(x: Int, y: Int, z: Int) {
|
||||
def isValid(w: IBlockAccess) = y >= 0 && y < w.getHeight
|
||||
def isValid(w: IBlockAccess) = y >= 0 && y < 256 // hardcoded because getHeight is unavailable on servers :(
|
||||
|
||||
def block(w: IBlockAccess) = if (isValid(w)) Option(w.getBlock(x, y, z)) else None
|
||||
def tile(w: IBlockAccess) = if (isValid(w)) Option(w.getTileEntity(x, y, z)) else None
|
||||
|
||||
Reference in new issue
Block a user