Tech Reborn

Tech Reborn

30M Downloads

Jackhammer skipped blocks are hardcoded for some blocks

KonSola5 opened this issue ยท 6 comments

commented

Describe the bug
Blocks skipped by Jackhammer are:

  • Air,
  • Liquids,
  • c:ores,
  • Obsidian and Crying Obsidian
  • Ancient Debris
  • Redstone Ore

public static boolean JackHammerSkippedBlocks(BlockState blockState){
if (blockState.isAir()) {
return true;
}
if (blockState.isLiquid()) {
return true;
}
if (blockState.isIn(ConventionalBlockTags.ORES)) {
return true;
}
if (blockState.isOf(Blocks.OBSIDIAN) || blockState.isOf(Blocks.CRYING_OBSIDIAN)){
return true;
}
if (blockState.isOf(Blocks.ANCIENT_DEBRIS)){
return true;
}
return blockState.getBlock() instanceof RedstoneOreBlock;
}

That means that if someone would like additional "hard" blocks to be skipped, one would need to add their block to c:ores, which is quite unintuitive.

Can be fixed by creating a tag that contains all the blocks that Jackhammer skips, and checking whether the block is tagged as such.

Steps to Reproduce
Steps to reproduce the behavior:
Coding issue.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information with the version):

  • Minecraft: Any (though 1.19.3 brought an improvement replacing the instanceof check for OreBlocks with a c:ores tag check)
  • Mod Loader: Fabric

Logs
None

Additional context
Add any other context about the problem here.

commented

The tag is there for a reason - adding #minecraft:sand to #c:sand when there are two separate tags would be pointless, with #c:sand not including Suspicious Sand on purpose.

EDIT: After glancing onto the Fabric repository, c:sand is not a default convention tag.

Alternative idea: A "negative" tag, containing blocks skipped by Jackhammer, evaluated before the mineable tag.

commented

Cool, although here's a thing:
Sands and Sandstones should totally have c or minecraft tags.
(To make it compatible out-of-the-box with other mods that add Sands/Sandstones, such as Ad Astra).

.addOptional(new Identifier("minecraft", "sand"))
.addOptional(new Identifier("minecraft", "red_sand"))
.addOptional(new Identifier("minecraft", "sandstone"))
.addOptional(new Identifier("minecraft", "red_sandstone"))

commented

#minecraft:sand contains suspicious sand also. Which shouldn't be broken by Jackhammer, IMHO.

image

commented

Though breaking of Suspicious Sand with the Jackhammer can be fine (it's a block which you need to be careful to not destroy it by accident)

And Jackhammer skipping it kinda kills the "carefulness" part.

TR is not usually played alone, together with vanilla Minecraft only, it's usually played in big packs.

commented

Sand tags:
sand
Suspicious Sand Tags:
sus_sand

Aka c:sand can be used there.

commented

This will perfectly work until somebody will decide to add #minecraft:sand to #c:sand.
Modpack author can add some modded sand to #techreborn:jackhammer_mineable