fix placing cable in fluid removing fluid

This commit is contained in:
Darkere
2022-05-26 15:11:36 +02:00
committed by Raoul
parent 20a4e4868b
commit e7d6e1ae6f
2 changed files with 4 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Changed ### Changed
- Improved Performance for grid updates - Improved Performance for grid updates
- Improved waterlogging to behave more like vanilla
## [v1.10.2] - 2022-03-26 ## [v1.10.2] - 2022-03-26

View File

@@ -6,9 +6,9 @@ import com.refinedmods.refinedstorage.api.network.node.INetworkNodeProxy;
import com.refinedmods.refinedstorage.apiimpl.network.node.cover.Cover; import com.refinedmods.refinedstorage.apiimpl.network.node.cover.Cover;
import com.refinedmods.refinedstorage.apiimpl.network.node.cover.CoverType; import com.refinedmods.refinedstorage.apiimpl.network.node.cover.CoverType;
import com.refinedmods.refinedstorage.block.shape.ShapeCache; import com.refinedmods.refinedstorage.block.shape.ShapeCache;
import com.refinedmods.refinedstorage.blockentity.CableBlockEntity;
import com.refinedmods.refinedstorage.capability.NetworkNodeProxyCapability; import com.refinedmods.refinedstorage.capability.NetworkNodeProxyCapability;
import com.refinedmods.refinedstorage.render.ConstantsCable; import com.refinedmods.refinedstorage.render.ConstantsCable;
import com.refinedmods.refinedstorage.blockentity.CableBlockEntity;
import com.refinedmods.refinedstorage.util.BlockUtils; import com.refinedmods.refinedstorage.util.BlockUtils;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
@@ -165,7 +165,8 @@ public class CableBlock extends NetworkNodeBlock implements SimpleWaterloggedBlo
@Nullable @Nullable
@Override @Override
public BlockState getStateForPlacement(BlockPlaceContext ctx) { public BlockState getStateForPlacement(BlockPlaceContext ctx) {
return getState(defaultBlockState(), ctx.getLevel(), ctx.getClickedPos()); FluidState fluidState = ctx.getLevel().getFluidState(ctx.getClickedPos());
return getState(defaultBlockState().setValue(WATERLOGGED, fluidState.getType() == Fluids.WATER), ctx.getLevel(), ctx.getClickedPos());
} }
@Override @Override