mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
60 lines
2.7 KiB
Diff
60 lines
2.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Fri, 21 Jun 2019 14:37:10 -0500
|
|
Subject: [PATCH] Allow soil to moisten from water directly under it
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
|
index aa1ba8b74ab70b6cede99e4853ac0203f388ab06..7c636d601fde4aeae29cfcca4bf49ea05a8b4f4c 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
|
@@ -50,23 +50,6 @@ public class FarmBlock extends Block {
|
|
return super.updateShape(state, direction, neighborState, world, pos, neighborPos);
|
|
}
|
|
|
|
- @Override
|
|
- public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
|
- BlockState iblockdata1 = world.getBlockState(pos.above());
|
|
-
|
|
- return !iblockdata1.getMaterial().isSolid() || iblockdata1.getBlock() instanceof FenceGateBlock || iblockdata1.getBlock() instanceof MovingPistonBlock;
|
|
- }
|
|
-
|
|
- @Override
|
|
- public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
|
- return !this.defaultBlockState().canSurvive(ctx.getLevel(), ctx.getClickedPos()) ? Blocks.DIRT.defaultBlockState() : super.getStateForPlacement(ctx);
|
|
- }
|
|
-
|
|
- @Override
|
|
- public boolean useShapeForLightOcclusion(BlockState state) {
|
|
- return true;
|
|
- }
|
|
-
|
|
@Override
|
|
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
|
return FarmBlock.SHAPE;
|
|
@@ -145,7 +128,7 @@ public class FarmBlock extends Block {
|
|
|
|
do {
|
|
if (!iterator.hasNext()) {
|
|
- return false;
|
|
+ return ((ServerLevel) world).purpurConfig.farmlandGetsMoistFromBelow && world.getFluidState(pos.relative(Direction.DOWN)).is(FluidTags.WATER); // Purpur
|
|
}
|
|
|
|
blockposition1 = (BlockPos) iterator.next();
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 1849f7970c5356f84a2b50a2a1f1b9742d822c67..8164b35f2c2d80a6b75ac10bd4fe293e47da3eba 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -137,6 +137,11 @@ public class PurpurWorldConfig {
|
|
});
|
|
}
|
|
|
|
+ public boolean farmlandGetsMoistFromBelow = false;
|
|
+ private void farmlandSettings() {
|
|
+ farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
|
+ }
|
|
+
|
|
public boolean signAllowColors = false;
|
|
public boolean signRightClickEdit = false;
|
|
private void signSettings() {
|