[Suggestion] Compatibility with Better With Mods "Hardcore Lumber"
Arakhor opened this issue ยท 14 comments
Better With Mods is one of the most popular survival enhancing mods. Because BWM makes it so making planks requires an ax, it also changes "punching tree" mechanic to drop planks instead of logs. The result is that it is virtually impossible to progress with both mods loaded.
Perfect solution, if achievable, would be to make Dynamic Trees drop the number of planks specified in BWM config, for each log that would normally drop.
If not, I suggest using the default value of 1 bark, 2 sawdust and 2 planks per log.
Thank you for your time.
A few questions:
- How does BWM handle trees harvested with tnt and creeper explosions?
- Are axes are the only way to get logs with BWM?
- How should the tree be harvested if the rooty dirt block is dug out instead of cutting the wood?
- Does BWM have a forge IMC to get the value for number of planks dropped per log?
Been a while since I contributed but
- When broken by explosions it should break apart into bark, sawdust and planks
- Any axe-like thing works (anything with axe as the tool level, which is quite a bit of headache considering things like tconstruct)
- The very bottom most block of the tree and the soil underneath are very hard to break (think obsidian) to encourage leaving stumps behind when clearing forests. There is another item that removes these stumps, called the stump remover.
- I think it doesn't right now, but it could probably be added easily if you don't want to add a soft dependency.
I'm not sure how many of these could be done by doing modifications on our side.
Hey, I am working on putting this into BWM directly but the fireBlockHarvest in your removedByPlayer is not getting the harvester correctly. If you can fix that I can make it work from my end ;)
Note to self.. don't just copy from Vanilla code without investigating every.. last.. argument. :)
I think I may have a solution for 75% of the problem.
In BlockBranch#removedByPlayer(...) I call ...ForgeEventFactory.fireBlockHarvesting(...) after a player chops down a tree or cuts a branch. This was done specifically to support other mods. The call contains a list of all the drops that would normally be created after the volume summation and all the fancy crap plus a reference to the player(for tool checks). If BWM hooked into that event it could modify the drop list however it pleases and my mod will happily drop whatever you want. Using this method should allow for the least amount of dependencies for both mods(probably none). If I change something on my side it most likely won't break your side.
For explosion harvesting this might require a little more thought. There's no event that I'm aware of for when a block is exploded that can be used to modify drops. I might have to whip something up.
The rooty dirt block in DynamicTrees is also VERY hard to remove by hand, any tool, or even explosions. This was done this way to encourage proper harvesting methods. The rooty dirt block turns back to plain dirt on it's own once there's no tree above it. But it is still breakable by hand(like obsidian) provided the player has great patience. This can probably be solved in time too but it's not the main issue.
I was just looking over BWMs LogHarvestEvent code. It looks like it already should work. If it doesn't then it should only be a slight modification to get it on track.
I think I see where the hang up is in BWM.. In harvestLog(...) this condition:
boolean isLog = logs.stream().filter(stack -> stack.isItemEqual(new ItemStack(block, 1, OreDictionary.WILDCARD_VALUE))).findAny().isPresent();
is checking the block from the blockstate that was harvested to see if it's a oreDict version of a log.. that won't work for my mod because my branch blocks are not registered as logs(nor should they be). If isLog was true when my BlockBranch is detected then everything might just work as intended. SawInteraction might trip us up though. :/
I might be able to register the BlockBranch itemBlock as an "logWood" ore. There may be unforeseen consequences to that though.
I'm not a coder so my input might not be valuable, but trying to contribute I just wrote a Crafttweaker script to add your blocks to "logWood" oredictionary, which unfortunately caused them to drop nothing at all.
Can anyone give confirmation as to whether or not this is working? I see that better with mods has made some changes.