PaintNinja / VariableSpawnerHardness

Make Minecraft spawners harder to break depending on your difficulty.
MIT License
1 stars 2 forks source link

Suggestion: Backport 1.4 to 1.20.1 Fabric | Introduce tags for spawners #10

Open HaipaDev opened 7 months ago

HaipaDev commented 7 months ago

Hey so I noticed there is indeed a config in newer version since 1.3, but they are not ported to Fabric, you might have missed it Also a suggestion I have is making the detection of the spawner block for hardness check be based on tags, because modded spawners like More Spawners do not work (would be even better if you had a list of blocks, so each one can be tweaked separately, but I know thats reaching

PaintNinja commented 2 months ago

Regarding configs:

Fabric doesn't have a config API and I haven't had time to look into third-party Fabric-specific config libraries. I'll leave this issue open until that's sorted though.

Regarding tags, mod support:

Vanilla doesn't have a tag for spawners that I can use unfortunately, so I check if the block is a vanilla spawner block or something based on it. Looking at the More Spawners mod's source code, it doesn't seem to use a single tag for spawners either and all of its spawner blocks are unique blocks that are not based on Vanilla's, which is why it's not working.

If the dev of the more spawners mod changed their spawner blocks to inherit vanilla's, it should start working.

Checking against a list of blocks is a possibility, but would hurt performance quite a lot, because I have to check the block type every punch for the block breaking animation to look correct. Checking against one type is alright, but going through a whole list of them every time can start adding up quickly (imagine having to check a list of blocks per punch, for every player currently punching a block on a server) :/