Potential optimization regarding bamboo rendering
The bug
Bamboo is responsible for a lot of unnecessary lag caused by it running a particularly expensive calculation for every single bamboo block in a given chunk, despite said calculation always returning 1.0F. As such, the rendering of bamboo could be optimised considerably simply by providing 1.0F directly rather than requiring it to be calculated each time.
How to fix
The FastBamboo mod for 1.14 (https://www.curseforge.com/minecraft/mc-mods/fast-bamboo) contains a fix for this issue, but does not seem to have been updated for around three years. RandomPatches (https://www.curseforge.com/minecraft/mc-mods/randompatches-forge) also contains a fix for this alongside other bugs such as MC-13187, but itself does not seem to have been updated past 1.16.
Further notes
I am reporting this as a bug since several other tickets regarding unoptimised code have been made and subsequently fixed (MC-33383, MC-41407, MC-217303, MC-233950), so this probably doesn't count as a feature request.
Created Issue:
Potential optimization regarding bamboo rendering
The bug
Bamboo is responsible for a lot of unnecessary lag caused by it running a particularly expensive calculation for every single bamboo block in a given chunk, despite said calculation always returning 1.0F. As such, the rendering of bamboo could be optimised considerably simply by providing 1.0F directly rather than requiring it to be calculated each time.
How to fix
The FastBamboo mod for 1.14 (https://www.curseforge.com/minecraft/mc-mods/fast-bamboo) contains a fix for this issue, but does not seem to have been updated for around three years. Either way, a mod shouldn't be needed for something like this.
Further notes
I am reporting this as a bug since several other tickets regarding un optimised code have been made and subsequently fixed (
MC-33383,MC-217303,MC-233950), so this probably doesn't count as a feature request.
The bug
Bamboo is responsible for a lot of unnecessary lag caused by it running a particularly expensive calculation for every single bamboo block in a given chunk, despite said calculation always returning 1.0F. As such, the rendering of bamboo could be optimised considerably simply by providing 1.0F directly rather than requiring it to be calculated each time.
How to fix
The FastBamboo mod for 1.14 (https://www.curseforge.com/minecraft/mc-mods/fast-bamboo) contains a fix for this issue, but does not seem to have been updated for around three years.
Either way, a mod shouldn't be needed for something like this.Further notes
I am reporting this as a bug since several other tickets regarding un
optimised code have been made and subsequently fixed (MC-,33383MC-217303,MC-233950), so this probably doesn't count as a feature request.The bug
Bamboo is responsible for a lot of unnecessary lag caused by it running a particularly expensive calculation for every single bamboo block in a given chunk, despite said calculation always returning 1.0F. As such, the rendering of bamboo could be optimised considerably simply by providing 1.0F directly rather than requiring it to be calculated each time.
How to fix
The FastBamboo mod for 1.14 (https://www.curseforge.com/minecraft/mc-mods/fast-bamboo) contains a fix for this issue, but does not seem to have been updated for around three years. RandomPatches (https://www.curseforge.com/minecraft/mc-mods/randompatches-forge) also contains a fix for this alongside other bugs such as MC-13187, but itself does not seem to have been updated past 1.16.
Further notes
I am reporting this as a bug since several other tickets regarding unoptimised code have been made and subsequently fixed (
MC-33383,MC-41407,MC-217303,MC-233950), so this probably doesn't count as a feature request.
Do you know which method, exactly, always returns 1.0F? As far as I can tell, the only method that returns 1.0F is BambooBlock#getDestroyProgress(...) but that is not always.
It's definitely something in BambooBlock: https://github.com/TridentMC/FastBamboo/blob/master/src/main/resources/fastbamboo.js
Seemingly related to ambient occlusion: https://github.com/TheRandomLabs/RandomPatches/blob/a2a9f19caab38f3f4078bf5acadcca7e300d4788/src/main/java/com/therandomlabs/randompatches/mixin/client/BambooBlockMixin.java
This mod is for an older version though, this method might have been replaced at some point.
The method referred to seems to be net.minecraft.world.level.block.state.BlockBehaviour#getShadeBrightness and it is indeed not overridden.
However it uses net.minecraft.world.level.block.BambooBlock#isCollisionShapeFullBlock and that one is (by now).
Sadly, I don't see an easy win here, but thanks for the report
The underlying issue here was resolved in
MC-227208(1.17 Pre-release 5).