diff --git a/src/main/java/ru/betterend/blocks/BlockEndLotusStem.java b/src/main/java/ru/betterend/blocks/BlockEndLotusStem.java index 991fdbee..45c0a53c 100644 --- a/src/main/java/ru/betterend/blocks/BlockEndLotusStem.java +++ b/src/main/java/ru/betterend/blocks/BlockEndLotusStem.java @@ -8,6 +8,7 @@ import net.minecraft.block.ShapeContext; import net.minecraft.block.Waterloggable; import net.minecraft.fluid.FluidState; import net.minecraft.fluid.Fluids; +import net.minecraft.item.ItemPlacementContext; import net.minecraft.state.StateManager; import net.minecraft.state.property.BooleanProperty; import net.minecraft.state.property.Properties; @@ -41,7 +42,14 @@ public class BlockEndLotusStem extends BlockBase implements Waterloggable { public FluidState getFluidState(BlockState state) { return (Boolean) state.get(WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state); } - + + @Override + public BlockState getPlacementState(ItemPlacementContext ctx) { + WorldAccess worldAccess = ctx.getWorld(); + BlockPos blockPos = ctx.getBlockPos(); + return this.getDefaultState().with(WATERLOGGED, worldAccess.getFluidState(blockPos).getFluid() == Fluids.WATER); + } + public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom) { if ((Boolean) state.get(WATERLOGGED)) { world.getFluidTickScheduler().schedule(pos, Fluids.WATER, Fluids.WATER.getTickRate(world));