Oh The Biomes You'll Go Refabricated

Oh The Biomes You'll Go Refabricated

11M Downloads

[Bug]: Please add requiresCorrectToolForDrops to custom blocks

purejosh opened this issue · 1 comments

commented

Minecraft Version

1.19.2

BYG Version

2.0.0.10

Terrablender Version

2.0.1.125

Mod Loader

Fabric

Mod Loader Version

0.14.9

Bug Severity

Major

What happened?

The following is a transcript from the dev of Emerald Tools. Essentially, many custom blocks are not registered with requiresCorrectToolForDrops, which causes some custom tools to not know how to handle them, as well as allows the block to be broken and dropped by using your hand.

.purejosh — Today at 5:51 PM
I really only tested on the Scoria Stone, the other variants I can't definitively speak for.

.purejosh — Today at 5:51 PM
I just checked the byg jar that I have installed, and those tags are in the right folder. That's so weird.

kwpugh — Today at 5:59 PM
hmmm, I think it might be because the author did not assign any mining level to the blocks

.purejosh — Today at 6:00 PM
Oh, interesting.

kwpugh — Today at 6:01 PM
can you break those blocks by hand?

.purejosh — Today at 6:02 PM
I haven't tried, let me see.

.purejosh — Today at 6:09 PM
It can break by hand, and it's slightly faster than wood.

kwpugh — Today at 6:09 PM
break stone by hand, that does not seem consistent with everything else, right?

.purejosh — Today at 6:13 PM
Not at all lol. definitely shouldn't be allowed to break stone by hand. It drops the scoria stone too, which is even worse.

kwpugh — Today at 6:26 PM
the author put a lot of the block in needs_iron_tool.json and need_diamond_tool.json. I think a bunch also need to be in the needs_wood_tool.json or needs_stone_tool.json

if a block is not added to tag, fabric will default it to mining level -1 (break by hand) for tools that check for a block's mining level before breaking it, which my hammers do.

.purejosh — Today at 6:36 PM
Gotcha! Thanks for the details, it's good to know these things now that I'm starting to mod myself.

kwpugh — Today at 7:11 PM
so, I believe the problem with scoria, soapstone, and a few others is that that are not give the

   private static BlockRegistryObject<Block> createScoria(String id) {
        return createBlock(() -> new Block(BlockBehaviour.Properties.of(Material.STONE, MaterialColor.TERRACOTTA_RED).sound(SoundType.STONE).strength(1.5f, 6.0f)), id);
    } 

..requiresCorrectToolForDrops() item setting when registered. My hammer checks that the block requires a tool to break and that it is within the mining level. The author would need to address that, I cannot.

the mods other blocks are correctly assigned and break correctly

  private static BlockRegistryObject<Block> createRedRock(String id) {
        return createBlock(() -> new Block(BlockBehaviour.Properties.of(Material.STONE, MaterialColor.TERRACOTTA_ORANGE).requiresCorrectToolForDrops().sound(SoundType.STONE).strength(1.5f, 6.0f)), id);
    }

without the
.requiresCorrectToolForDrops()
item setting, the block can be broken by hand with drops given. I do not think that is what the author intended.

latest.log

No logs to post.

Did you isolate BYG?

I tried BYG alone

commented

Hey Corgi, will this resolve all of the stone type blocks that aren't tagged as pickaxe breaking? I only see two line changes, and I'm not sure about it.