Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some additional solid checks #713

Merged
merged 1 commit into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ javaVersion=21
useJavaToolChains=true

#The currently running forge.
forgeVersion=21.1.72
forgeVersion=21.1.84

fmlRange=[4,)
forgeRange=[21.0.143,)
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/ldtteam/structurize/util/BlockUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static void checkOrInit()
{
BuiltInRegistries.BLOCK.stream()
.filter(BlockUtils::canBlockSurviveWithoutSupport)
.filter(block -> !block.defaultBlockState().isAir() && !(block instanceof LiquidBlock) && !block.builtInRegistryHolder().is(ModTags.WEAK_SOLID_BLOCKS))
.filter(block -> !block.defaultBlockState().canBeReplaced() && block.hasCollision && !block.defaultBlockState().isAir() && !(block instanceof LiquidBlock) && !block.builtInRegistryHolder().is(ModTags.WEAK_SOLID_BLOCKS))
.forEach(trueSolidBlocks::add);
}
}
Expand Down Expand Up @@ -802,6 +802,11 @@ public static boolean isWeakSolidBlock(final BlockState blockState)
return blockState.isRandomlyTicking();
}

if (blockState.canBeReplaced() || !blockState.getBlock().hasCollision)
{
return false;
}

final Block block = blockState.getBlock();
return block.builtInRegistryHolder().is(ModTags.WEAK_SOLID_BLOCKS) && canBlockSurviveWithoutSupport(block);
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/META-INF/accesstransformer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ public net.minecraft.client.KeyMapping clickCount
# itemHandler
public net.minecraft.world.entity.decoration.GlowItemFrame getFrameItemStack()Lnet/minecraft/world/item/ItemStack;
public net.minecraft.world.entity.decoration.ItemFrame getFrameItemStack()Lnet/minecraft/world/item/ItemStack;

public net.minecraft.world.level.block.state.BlockBehaviour hasCollision # hasCollision
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this? i mean if it isnt avaiable through sth else

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's the most efficient way to access it nicely.

Loading