Skip to content

Commit

Permalink
Fix: only destroy glass blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Gegy committed Nov 19, 2024
1 parent e48abb1 commit bc3dfb8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.neoforged.neoforge.common.Tags;
import net.neoforged.neoforge.network.PacketDistributor;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -244,7 +245,7 @@ private static void findNeighboursOfTypeAndDestroy(GameScheduler scheduler, Serv
for (Direction direction : Direction.values()) {
BlockPos relative = pos.relative(direction);
BlockState blockState = world.getBlockState(relative);
if (!blockState.isAir()) {
if (!blockState.isAir() && blockState.is(Tags.Blocks.GLASS_BLOCKS)) {
if (blockType == null) {
blockType = blockState.getBlock();
}
Expand Down

0 comments on commit bc3dfb8

Please sign in to comment.