mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 19:58:34 +01:00
made the shovel only convert to grass if it's around grass already
This commit is contained in:
parent
e83777fe14
commit
8996cf9690
1 changed files with 7 additions and 2 deletions
|
@ -45,8 +45,13 @@ public class ItemShovelNA extends ItemSpade implements IModItem, IModelProvider
|
||||||
|
|
||||||
if (state.getBlock() instanceof BlockDirt) {
|
if (state.getBlock() instanceof BlockDirt) {
|
||||||
if (worldIn.getBlockState(pos.up()).getMaterial() == Material.AIR) {
|
if (worldIn.getBlockState(pos.up()).getMaterial() == Material.AIR) {
|
||||||
worldIn.setBlockState(pos, Blocks.GRASS.getDefaultState());
|
for (EnumFacing dir : EnumFacing.HORIZONTALS) {
|
||||||
damage = 5;
|
if (worldIn.getBlockState(pos.offset(dir)).getBlock() == Blocks.GRASS) {
|
||||||
|
worldIn.setBlockState(pos, Blocks.GRASS.getDefaultState());
|
||||||
|
damage = 5;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int range = player.isSneaking() ? 0 : 1;
|
int range = player.isSneaking() ? 0 : 1;
|
||||||
|
|
Loading…
Reference in a new issue