RichBoundsLocation - 1.13 Swimming (Kelp Plants)

Checks slightly lower for the block since swimming above water may exceed +1 y
This commit is contained in:
CaptainObvious0 2019-03-13 18:29:53 -05:00 committed by GitHub
parent f91edebd70
commit 29d7015d3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 0 deletions

View File

@ -483,6 +483,17 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition
}
return nodeBelow;
}
/**
* Get existing or create.
* @return
*/
public IBlockCacheNode getOrCreateBlockCacheNodeBelowLiq() {
if (nodeBelow == null) {
nodeBelow = blockCache.getOrCreateBlockCacheNode(blockX, blockY - 1.2, blockZ, false);
}
return nodeBelow;
}
/**
* Gets the type id.
@ -507,6 +518,18 @@ public class RichBoundsLocation implements IGetBukkitLocation, IGetBlockPosition
}
return nodeBelow.getType();
}
/**
* Gets the type id slighly lower.
*
* @return the type id below
*/
public Material getTypeIdBelowLiq() {
if (nodeBelow == null) {
getOrCreateBlockCacheNodeBelowLiq();
}
return nodeBelow.getType();
}
/**
* Gets the data.