Bonemeal mixin fix
This commit is contained in:
parent
66c2506fa3
commit
47ba04c177
1 changed files with 14 additions and 11 deletions
|
@ -37,6 +37,7 @@ public class BoneMealItemMixin {
|
|||
if (!world.isClient) {
|
||||
BlockPos offseted = blockPos.offset(context.getSide());
|
||||
boolean endBiome = world.getBiome(offseted).getCategory() == Category.THEEND;
|
||||
//boolean skip = false;
|
||||
|
||||
if (world.getBlockState(blockPos).isIn(EndTags.END_GROUND)) {
|
||||
boolean consume = false;
|
||||
|
@ -48,33 +49,35 @@ public class BoneMealItemMixin {
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (!world.getBlockState(offseted).equals(Blocks.WATER)) {
|
||||
info.cancel();
|
||||
}
|
||||
else if (!world.getFluidState(offseted).isEmpty() && endBiome) {
|
||||
if (!world.getFluidState(offseted).isEmpty() && endBiome) {
|
||||
if (world.getBlockState(offseted).equals(Blocks.WATER)) {
|
||||
consume = beGrowWaterGrass(world, blockPos);
|
||||
}
|
||||
/*else {
|
||||
skip = true;
|
||||
}*/
|
||||
}
|
||||
else {
|
||||
consume = beGrowGrass(world, blockPos);
|
||||
}
|
||||
}
|
||||
if (consume) {
|
||||
if (!context.getPlayer().isCreative())
|
||||
if (!context.getPlayer().isCreative()) {
|
||||
context.getStack().decrement(1);
|
||||
}
|
||||
world.syncWorldEvent(2005, blockPos, 0);
|
||||
info.setReturnValue(ActionResult.SUCCESS);
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
else if (!world.getBlockState(offseted).equals(Blocks.WATER)) {
|
||||
info.cancel();
|
||||
}
|
||||
else if (!world.getFluidState(offseted).isEmpty() && endBiome) {
|
||||
if (world.getBlockState(offseted).equals(Blocks.WATER)) {
|
||||
info.setReturnValue(ActionResult.FAIL);
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean beGrowGrass(World world, BlockPos pos) {
|
||||
int y1 = pos.getY() + 3;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue