Hoes now turn Overgrown Stone into Stone. Closes #1102
This commit is contained in:
parent
a1b36bec78
commit
c57c458e69
2 changed files with 13 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
|||
minecraft_version=1.12
|
||||
forge_version=14.21.0.2379
|
||||
mod_version=7.0.0
|
||||
minecraft_version=1.12.2
|
||||
forge_version=14.23.0.2491
|
||||
mod_version=7.0.1
|
||||
mappings_version=snapshot_nodoc_20170619
|
||||
|
|
|
@ -55,17 +55,23 @@ public class UseHoeEventHandler
|
|||
else if (block instanceof BlockBOPGrass && world.isAirBlock(pos.up()))
|
||||
{
|
||||
result = true;
|
||||
Block dirtBlock = BlockBOPGrass.getDirtBlockState(state).getBlock();
|
||||
IBlockState dirtState = BlockBOPGrass.getDirtBlockState(state);
|
||||
|
||||
if (dirtBlock instanceof BlockBOPDirt)
|
||||
if (dirtState.getBlock() instanceof BlockBOPDirt)
|
||||
{
|
||||
BlockBOPDirt.BOPDirtType dirtType = (BlockBOPDirt.BOPDirtType) BlockBOPGrass.getDirtBlockState(state).getValue(BlockBOPDirt.VARIANT);
|
||||
BlockBOPDirt.BOPDirtType dirtType = (BlockBOPDirt.BOPDirtType) dirtState.getValue(BlockBOPDirt.VARIANT);
|
||||
world.setBlockState(pos, BlockBOPFarmland.paging.getVariantState(dirtType));
|
||||
}
|
||||
else if (dirtBlock instanceof BlockDirt && state.getValue(BlockBOPGrass.VARIANT) != BlockBOPGrass.BOPGrassType.OVERGROWN_STONE)
|
||||
else if (dirtState.getBlock() instanceof BlockDirt)
|
||||
{
|
||||
world.setBlockState(pos, Blocks.FARMLAND.getDefaultState());
|
||||
}
|
||||
else
|
||||
{
|
||||
// There is no associated farmland, so just turn it to its associated dirt
|
||||
// Mostly useful for overgrown grass turning to stone
|
||||
world.setBlockState(pos, dirtState);
|
||||
}
|
||||
}
|
||||
|
||||
if (result)
|
||||
|
|
Loading…
Reference in a new issue