Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix randomTicks for BlockTau #2007

Open
wants to merge 1 commit into
base: 1.20.1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions src/main/java/wayoftime/bloodmagic/common/block/BlockTau.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import java.util.List;
import java.util.Random;

import net.minecraft.util.RandomSource;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.CropBlock;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.phys.AABB;
import net.minecraft.core.BlockPos;
Expand Down Expand Up @@ -60,7 +60,8 @@ public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos,
/**
* Performs a random tick on a block.
*/
public void randomTick(BlockState state, ServerLevel worldIn, BlockPos pos, Random random)
@Override
public void randomTick(BlockState state, ServerLevel worldIn, BlockPos pos, RandomSource random)
{
if (!worldIn.isAreaLoaded(pos, 1))
return; // Forge: prevent loading unloaded chunks when checking neighbor's light
Expand Down Expand Up @@ -110,14 +111,8 @@ public void randomTick(BlockState state, ServerLevel worldIn, BlockPos pos, Rand
}
}

/**
* Whether this IGrowable can grow
*/
public boolean isValidBonemealTarget(BlockGetter worldIn, BlockPos pos, BlockState state, boolean isClient)
{
return !this.isMaxAge(state);
}

//REVIEW: method not called. Add @override and change Random to RandomSource
public boolean isBonemealSuccess(Level worldIn, Random rand, BlockPos pos, BlockState state)
{
return false;
Expand Down