RakambdaOrg / FallingTree

Minecraft mod to make the trees fall in one cut
https://www.curseforge.com/minecraft/mc-mods/falling-tree
GNU Lesser General Public License v3.0
84 stars 32 forks source link

Trees not falling properly if axe breaks on the same block destroy that would cut the tree #727

Closed fisher60 closed 3 months ago

fisher60 commented 4 months ago

Describe the bug

Summary

If you cut a tree and your axe's health bar is on its last block destroy, the axe and log will both be destroyed, but the tree will not properly fall. The tree will still be standing with only that single block destroyed

Minecraft version

1.21

Fabric API version

Latest(?)

Mod version

1.21 latest(?)

Configuration

{
  "trees": {
    "allowedLogs": [],
    "deniedLogs": [],
    "allowedLeaves": [],
    "allowedNonDecayLeaves": [],
    "deniedLeaves": [],
    "breakMode": "FALL_ITEM",
    "detectionMode": "ABOVE_CUT",
    "maxScanSize": 500,
    "maxSize": 100,
    "maxLeafDistanceFromLog": 15,
    "maxSizeAction": "ABORT",
    "breakOrder": "LOWEST_FIRST",
    "minimumLeavesAroundRequired": 1,
    "includePersistentLeavesInRequiredCount": true,
    "treeBreaking": true,
    "leavesBreaking": true,
    "leavesBreakingForceRadius": 0,
    "allowMixedLogs": false,
    "breakNetherTreeWarts": true,
    "breakMangroveRoots": true,
    "searchAreaRadius": -1,
    "allowedAdjacentBlocks": [],
    "adjacentStopMode": "STOP_ALL",
    "spawnItemsAtBreakPoint": false
  },
  "tools": {
    "allowed": [],
    "denied": [],
    "preserve": false,
    "ignoreTools": false,
    "damageMultiplicand": 1.0,
    "damageRounding": "ROUND_DOWN",
    "speedMultiplicand": 0.0,
    "forceToolUsage": false
  },
  "player": {
    "allowedTags": []
  },
  "enchantment": {
    "requireEnchantment": false
  },
  "sneakMode": "SNEAK_DISABLE",
  "breakInCreative": false,
  "lootInCreative": true,
  "notificationMode": "ACTION_BAR"
}

Relevant log output

No log appears to be generated for this event/issue.
Rakambda commented 4 months ago

That's intended behavior, if your axe cannot handle the damage, it'll cut only what it can.

Setting damageMultiplicand=0 will apply 1 damage regardless of the tree size though so it might "solve" your case.

fisher60 commented 4 months ago

Thank you for the response. Should damageMultiplicand=0 be the default config then? From a user-perspective this behavior is unexpected since you cut down the tree and would expect it to fall but are left with a floating tree instead.

One large benefit of this mod is that it largely removes floating trees in the world, but having trees remain on an axe break causes floating trees to continue to be a common issue.

Rakambda commented 4 months ago

Default will stay at 1. The default settigns are set in a way that are not too cheaty (you break 100 logs, you get 100 damage, just remvoes teh hassle of moving around). As per the "unexplected", you should have had a message in the chat or in the action bar saying the tool was about to break if i recall correctly.

fisher60 commented 4 months ago

In my instance there are no indications that this behavior will occur aside from knowing that the axe is about to break based on its health bar. I only utilize this as a server-side mod though.

Though I understand the reasoning for having the value as 1, I would argue that the primary purpose of this mod is to enable a very "cheaty" feature since the default settings allow quickly mowing down entire forests with only a small handful of axes.

Rakambda commented 4 months ago

I'll try to check the warning thing if it somehow doesn't pop up in that special case. Even if playing on a server a message should appear above the xp bar though.

That's one way to see it. It is cheaty in any case, just the default settings makes it more penalizing. There's plenty of settings for player to play with if they see things ddifferently and want to adapt it to their liking. Cannot satisfy everyone with the default so I set it as my way of thinking arbirtrarily.

fisher60 commented 4 months ago

Yeah, that makes sense to me. It is quite over-powered to run around with a single axe that can deforest entire chunks.

I would expect the "correct" behavior to be that damage is scaled based on how many blocks are broken at once, but if a log is broken while an axe is on its last health, I would still expect the tree to fall, rather than produce a floating tree.

This solves the issue of the mod not becoming too "cheaty" since axe health can still deteriorate more quickly from cutting down trees and floating trees would not be created when the axe is low health.

This does create the issue that the last hit from an axe is technically much more powerful than that of a full-health axe, but I feel it would create better user experience since the more realistic behavior is that a tree falls when its base is chopped.

Rakambda commented 4 months ago

Ok so for the message, I guess it didn't appear because tools.preserve is set to false. So the mod doesn't try to save yoru tool, and therefore doesn't warn you.

I'm not a big fan of the difference of behavior. However, what could be done, is replace that preserve boolean with a more controlled setting (names are not what they'll be) :

fisher60 commented 4 months ago

I would really appreciate these options for that setting.

Rakambda commented 4 months ago

I haven't tested it at all, kinda a rough draft. Though if you want to try it, here you go : https://github.com/RakambdaOrg/FallingTree/actions/runs/9930699571 (at the bottom in the artifacts section, need to unzip)

Description of what it should do is here for now : https://github.com/RakambdaOrg/FallingTree/pull/728/files#diff-47c7c17c3984bbbc6204a1718d51a4faba6e6eef9bb8ad7c9fd6c5857c16b1cbR70