Function rename
This commit is contained in:
parent
9e789c9fc3
commit
72403f47ba
1 changed files with 9 additions and 9 deletions
|
@ -27,21 +27,21 @@ public class BoneMealItemMixin {
|
|||
private static final Mutable POS = new Mutable();
|
||||
|
||||
@Inject(method = "useOnBlock", at = @At("HEAD"), cancellable = true)
|
||||
private void onUse(ItemUsageContext context, CallbackInfoReturnable<ActionResult> info) {
|
||||
private void beOnUse(ItemUsageContext context, CallbackInfoReturnable<ActionResult> info) {
|
||||
World world = context.getWorld();
|
||||
BlockPos blockPos = context.getBlockPos();
|
||||
if (!world.isClient) {
|
||||
if (world.getBlockState(blockPos).isIn(BlockTagRegistry.END_GROUND)) {
|
||||
boolean consume = false;
|
||||
if (world.getBlockState(blockPos).getBlock() == Blocks.END_STONE) {
|
||||
BlockState nylium = getNylium(world, blockPos);
|
||||
BlockState nylium = beGetNylium(world, blockPos);
|
||||
if (nylium != null) {
|
||||
BlocksHelper.setWithoutUpdate(world, blockPos, nylium);
|
||||
consume = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
consume = growGrass(world, blockPos);
|
||||
consume = beGrowGrass(world, blockPos);
|
||||
}
|
||||
if (consume) {
|
||||
if (!context.getPlayer().isCreative())
|
||||
|
@ -54,7 +54,7 @@ public class BoneMealItemMixin {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean growGrass(World world, BlockPos pos) {
|
||||
private boolean beGrowGrass(World world, BlockPos pos) {
|
||||
int y1 = pos.getY() + 3;
|
||||
int y2 = pos.getY() - 3;
|
||||
boolean result = false;
|
||||
|
@ -67,7 +67,7 @@ public class BoneMealItemMixin {
|
|||
POS.setY(y);
|
||||
BlockPos down = POS.down();
|
||||
if (world.isAir(POS) && !world.isAir(down)) {
|
||||
BlockState grass = getGrassState(world, down);
|
||||
BlockState grass = beGetGrassState(world, down);
|
||||
if (grass != null) {
|
||||
BlocksHelper.setWithoutUpdate(world, POS, grass);
|
||||
result = true;
|
||||
|
@ -79,7 +79,7 @@ public class BoneMealItemMixin {
|
|||
return result;
|
||||
}
|
||||
|
||||
private BlockState getGrassState(World world, BlockPos pos) {
|
||||
private BlockState beGetGrassState(World world, BlockPos pos) {
|
||||
BlockState state = world.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
if (block == BlockRegistry.END_MOSS || block == BlockRegistry.END_MYCELIUM) {
|
||||
|
@ -91,7 +91,7 @@ public class BoneMealItemMixin {
|
|||
return null;
|
||||
}
|
||||
|
||||
private void shuffle(Random random) {
|
||||
private void beShuffle(Random random) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
int j = random.nextInt(4);
|
||||
Direction d = DIR[i];
|
||||
|
@ -100,8 +100,8 @@ public class BoneMealItemMixin {
|
|||
}
|
||||
}
|
||||
|
||||
private BlockState getNylium(World world, BlockPos pos) {
|
||||
shuffle(world.random);
|
||||
private BlockState beGetNylium(World world, BlockPos pos) {
|
||||
beShuffle(world.random);
|
||||
for (Direction dir : DIR) {
|
||||
BlockState state = world.getBlockState(pos.offset(dir));
|
||||
if (BlocksHelper.isEndNylium(state))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue