You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
To improve code efficiency and reduce potential errors, it is recommended to replace the code like ev.mTargetBlockInstance.getBlock()->getName() == "minecraft:air" with an ID comparison.
Describe the solution you'd like
This can be achieved by retrieving the block ID of the "minecraft:air" block using a block registry, and comparing it directly with the block ID of ev.mTargetBlockInstance.getBlock(). By using an ID comparison, the code can avoid the overhead of string comparison to improve performance. Additionally, it can reduce the risk of errors caused by misspelling or variations in block name strings.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
To improve code efficiency and reduce potential errors, it is recommended to replace the code like
ev.mTargetBlockInstance.getBlock()->getName() == "minecraft:air"
with an ID comparison.Describe the solution you'd like
This can be achieved by retrieving the block ID of the "minecraft:air" block using a block registry, and comparing it directly with the block ID of ev.mTargetBlockInstance.getBlock(). By using an ID comparison, the code can avoid the overhead of string comparison to improve performance. Additionally, it can reduce the risk of errors caused by misspelling or variations in block name strings.
The text was updated successfully, but these errors were encountered: