mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-30 16:28:00 +01:00
Fix error ticking sprout blocks
This commit is contained in:
parent
4e88d84524
commit
e196b3c226
1 changed files with 9 additions and 3 deletions
|
@ -54,13 +54,19 @@ public class SproutBlock extends CropBlock implements TintedBlock {
|
||||||
@Override
|
@Override
|
||||||
public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) {
|
public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) {
|
||||||
super.randomTick(state, world, pos, random);
|
super.randomTick(state, world, pos, random);
|
||||||
onGrow(world, world.getBlockState(pos), pos);
|
state = world.getBlockState(pos);
|
||||||
|
if (state.isOf(this)) {
|
||||||
|
onGrow(world, state, pos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applyGrowth(World world, BlockPos pos, BlockState state) {
|
public void applyGrowth(World world, BlockPos pos, BlockState state) {
|
||||||
super.applyGrowth(world, pos, state);
|
super.applyGrowth(world, pos, state);
|
||||||
onGrow(world, world.getBlockState(pos), pos);
|
state = world.getBlockState(pos);
|
||||||
|
if (state.isOf(this)) {
|
||||||
|
onGrow(world, world.getBlockState(pos), pos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -81,7 +87,7 @@ public class SproutBlock extends CropBlock implements TintedBlock {
|
||||||
|
|
||||||
protected void mature(World world, BlockState state, BlockPos pos) {
|
protected void mature(World world, BlockState state, BlockPos pos) {
|
||||||
state = matureState.get();
|
state = matureState.get();
|
||||||
world.setBlockState(pos, matureState.get());
|
world.setBlockState(pos, state);
|
||||||
BlockSoundGroup group = state.getSoundGroup();
|
BlockSoundGroup group = state.getSoundGroup();
|
||||||
world.playSound(null, pos, group.getPlaceSound(), SoundCategory.BLOCKS, group.getVolume(), group.getPitch());
|
world.playSound(null, pos, group.getPlaceSound(), SoundCategory.BLOCKS, group.getVolume(), group.getPitch());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue