mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Added a Nullcheck
This commit is contained in:
parent
f0d7585fd9
commit
51de083209
1 changed files with 2 additions and 1 deletions
|
@ -37,7 +37,8 @@ public class PosUtil{
|
|||
}
|
||||
|
||||
public static int getMetadata(BlockPos pos, IBlockAccess world){
|
||||
return getBlock(pos, world).getMetaFromState(world.getBlockState(pos));
|
||||
Block block = getBlock(pos, world);
|
||||
return block != null ? getBlock(pos, world).getMetaFromState(world.getBlockState(pos)) : 0;
|
||||
}
|
||||
|
||||
public static BlockPos offset(BlockPos pos, int x, int y, int z){
|
||||
|
|
Loading…
Reference in a new issue