Skip to content

Commit

Permalink
Don't allow unpacking blocks where they cannot survive. For example u…
Browse files Browse the repository at this point in the history
…npacking a torch on a chest
  • Loading branch information
pupnewfster committed Mar 3, 2024
1 parent cfd5410 commit b8eddc1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/mekanism/common/attachments/BlockData.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ public boolean tryPlaceIntoWorld(Level level, BlockPos pos, @Nullable Player pla
// the cardboard box and will instead leave it how it was when the box was initially put on
//Adjust the state based on neighboring blocks to ensure double chests properly become single chests again
BlockState adjustedState = Block.updateFromNeighbourShapes(blockState, level, pos);
if (adjustedState.isAir()) {
//If the block cannot be unpacked in this position, don't allow it to be unpacked
return false;
}

FluidState fluidState = adjustedState.getFluidState();
FluidType fluidType = fluidState.getFluidType();
Expand Down

0 comments on commit b8eddc1

Please sign in to comment.