Skip to content

Commit 6abb52d

Browse files
authored
Some additional solid checks (#713)
Check if not replaceable/no collision for solidness too
1 parent e077e0c commit 6abb52d

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ javaVersion=21
1212
useJavaToolChains=true
1313

1414
#The currently running forge.
15-
forgeVersion=21.1.72
15+
forgeVersion=21.1.84
1616

1717
fmlRange=[4,)
1818
forgeRange=[21.0.143,)

src/main/java/com/ldtteam/structurize/util/BlockUtils.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public static void checkOrInit()
110110
{
111111
BuiltInRegistries.BLOCK.stream()
112112
.filter(BlockUtils::canBlockSurviveWithoutSupport)
113-
.filter(block -> !block.defaultBlockState().isAir() && !(block instanceof LiquidBlock) && !block.builtInRegistryHolder().is(ModTags.WEAK_SOLID_BLOCKS))
113+
.filter(block -> !block.defaultBlockState().canBeReplaced() && block.hasCollision && !block.defaultBlockState().isAir() && !(block instanceof LiquidBlock) && !block.builtInRegistryHolder().is(ModTags.WEAK_SOLID_BLOCKS))
114114
.forEach(trueSolidBlocks::add);
115115
}
116116
}
@@ -802,6 +802,11 @@ public static boolean isWeakSolidBlock(final BlockState blockState)
802802
return blockState.isRandomlyTicking();
803803
}
804804

805+
if (blockState.canBeReplaced() || !blockState.getBlock().hasCollision)
806+
{
807+
return false;
808+
}
809+
805810
final Block block = blockState.getBlock();
806811
return block.builtInRegistryHolder().is(ModTags.WEAK_SOLID_BLOCKS) && canBlockSurviveWithoutSupport(block);
807812
}

src/main/resources/META-INF/accesstransformer.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ public net.minecraft.client.KeyMapping clickCount
2525
# itemHandler
2626
public net.minecraft.world.entity.decoration.GlowItemFrame getFrameItemStack()Lnet/minecraft/world/item/ItemStack;
2727
public net.minecraft.world.entity.decoration.ItemFrame getFrameItemStack()Lnet/minecraft/world/item/ItemStack;
28+
29+
public net.minecraft.world.level.block.state.BlockBehaviour hasCollision # hasCollision

0 commit comments

Comments
 (0)