Jade ๐Ÿ”

Jade ๐Ÿ”

155M Downloads

Causing lag with FallingTree mod

ImpulsiveLass opened this issue ยท 13 comments

commented

To display the progress of breaking a block on the Jade GUI, this mod gets the hardness of the block/finds how long with the given tool to break the block, just by looking at the block.

A number of mods that allow you to instantly break a large number of wood or ores have a setting to at least partially consider the added time to break the block based on the original block.

I.E. it may add 0.5 of the time to break for extra blocks, so if a tree is 10 logs tall it will be 1 + 9(0.5) times longer to break.

Jade calls for this to be calculated when targeting the given block with the correct tool.

This is not an issue for small little trees and veins but if there is a larger tree, lets say 100 logs, Jade will make the game shit itself as it keeps calculating/recalculating how much to progress the bar, especially if another tree sprouts up and the logs are touching, or another player or entity is adding more blocks for whatever reason.

commented

eh,

I made it so the breaking time is constant from a config value (I removed the scan for the block count)

this is 16 furthest blocks a break at x/8 speed within a +/- 8 x/z , infinite y range
https://streamable.com/4azyrm

commented

Which other mod? I suggest you report to that mod first

commented

I don't know what you are talking about

commented

I feel like I explained the issue quite thoroughly,

Jade wants to know how long it takes to break a block

other mod adds math to the process

Jade calls it to do the math constantly and the game explodes

commented

A myriad of mods, there is no reason to report this to other mods. Can I disable this setting on Jade? I'm not sure how jade gets the time to break the block but maybe it should ignore multipliers from other blocks?

commented

You can disable it in plugin settings

commented

if you mean
"breaking_progress": false,

This doesn't work, it still calculates it behind internally, just doesn't display it, I know it is jade, removing it fixes the lag.

https://streamable.com/0dqhm4

commented

No, Jade does not calculate it internally. Since you refuse to tell me the exact mod, how can I reproduce the problem?

commented

Use FallingTree and Jade

use a config like

{
  "trees": {
    "allowedLogs": [
      "#craftcompat:alllogs",
      "biomeswevegone:brown_mushroom_stem",
      "biomeswevegone:white_mushroom_stem",
      "deep_aether:yagroot_roots",
      "minecraft:mangrove_roots",
      "minecraft:mushroom_stem",
      "quark:glow_shroom_stem",
      "spelunkery:cave_mushroom_stem"
    ],
    "deniedLogs": [],
    "allowedLeaves": [
      "#forge:leaves",
      "#immersive_weathering:leaf_piles",
      "alexscaves:pewen_branch",
      "alexscaves:thornwood_branch",
      "ancient_aether:blue_skyroot_pine_leaves",
      "outer_end:azure_leaves"
    ],
    "allowedNonDecayLeaves": [
      "aether_redux:cloud_cap_block",
      "aether_redux:cloudcap_spores",
      "aether_redux:jellyshroom_jelly_block",
      "biomeswevegone:allium_petal_block",
      "biomeswevegone:green_mushroom_block",
      "biomeswevegone:pink_allium_petal_block",
      "biomeswevegone:rose_petal_block",
      "biomeswevegone:weeping_milkcap_mushroom_block",
      "biomeswevegone:white_allium_petal_block",
      "biomeswevegone:wood_blewit_mushroom_block",
      "deep_aether:lightcap_mushroom_block",
      "gardens_of_the_dead:blightwart_block",
      "luminous_nether:goldmushroom",
      "minecraft:brown_mushroom_block",
      "minecraft:nether_wart_block",
      "minecraft:red_mushroom_block",
      "minecraft:shroomlight",
      "minecraft:warped_wart_block",
      "netherexp:shroomblight",
      "netherexp:shroomnight",
      "outer_end:azure_stamen",
      "quark:glow_shroom_block",
      "spelunkery:conk_fungus_block",
      "spelunkery:inkcap_mushroom_block",
      "spelunkery:milly_bubcap_block",
      "spelunkery:mushgloom_block",
      "spelunkery:phosphor_fungus_block",
      "spelunkery:phosphor_shroomlight",
      "spelunkery:portabella_block",
      "spelunkery:white_inkcap_mushroom_block"
    ],
    "deniedLeaves": [],
    "breakMode": "INSTANTANEOUS",
    "detectionMode": "WHOLE_TREE",
    "maxScanSize": 100000,
    "maxSize": 100000,
    "maxLeafDistanceFromLog": 15,
    "maxSizeAction": "CUT",
    "breakOrder": "FURTHEST_FIRST",
    "minimumLeavesAroundRequired": 0,
    "includePersistentLeavesInRequiredCount": true,
    "treeBreaking": true,
    "leavesBreaking": true,
    "leavesBreakingForceRadius": 0,
    "allowMixedLogs": true,
    "breakNetherTreeWarts": true,
    "breakMangroveRoots": true,
    "searchAreaRadius": -1,
    "allowedAdjacentBlocks": [],
    "adjacentStopMode": "STOP_ALL"
  },
  "tools": {
    "allowed": [],
    "denied": [],
    "preserve": false,
    "ignoreTools": false,
    "damageMultiplicand": 1.0,
    "damageRounding": "ROUND_DOWN",
    "speedMultiplicand": 0.5,
    "forceToolUsage": false
  },
  "player": {
    "allowedTags": []
  },
  "enchantment": {
    "registerEnchant": false,
    "registerSpecificEnchant": false,
    "hideEnchant": false,
    "requireEnchantment": false
  },
  "sneakMode": "SNEAK_DISABLE",
  "breakInCreative": false,
  "lootInCreative": true,
  "notificationMode": "ACTION_BAR"
}

find a very large tree like mangroves entangled (or spawn a big cube of logs, 10x10x10 should do) and look at a log with axe in hand

commented

This happens in the harvest tool display. When it is working (at every frame), it calls Block#getDestroyProgress to know if the target block is breakable or not, and FallingTree modifies this method.

It is an optimization issue of FallingTree. They can cache the scan results to improve it. There is no point to optimize it on Jade's side, because even if Jade is not installed, you will still get lag when you are destorying the block.

EDIT: at every tick, not every frame

commented

yes but one frame vs every frame is a big difference, the setting in jade should prevent Block#getDestroyProgress from being called, instead of only stopping it from being displayed

It looks like its used in drawBreakingProgress only right? I believe it should return there but then how come it still lags from looking at it with jade?

I have the setting disabled in jade here
https://streamable.com/fznft4

commented

Please see my previous replies