mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-06-02 05:53:38 +02:00
Added a Nullcheck
This commit is contained in:
parent
f0d7585fd9
commit
51de083209
|
@ -37,7 +37,8 @@ public class PosUtil{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getMetadata(BlockPos pos, IBlockAccess world){
|
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){
|
public static BlockPos offset(BlockPos pos, int x, int y, int z){
|
||||||
|
|
Loading…
Reference in a new issue