mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-10-25 20:22:23 +00:00
Update TooltipHandlerBurnTime.java
After performance profiling I found
TileEntityFurnace.getItemBurnTime(item);
is computationaly expensive. It occupied almost a cpu core forever, because NEI starts a task thread every few seconds and this line of code keep iteraing through all the furnance recipe in GTNH. Besides, usually the result of this computation is not useful.
Add thread name check will help performance and will not influence the player.
if (!Thread.currentThread().getName().startsWith("Client Thread")) return false;
This commit is contained in:
1 parent
ea5786c266
commit
3093ea6180
1 file changed
+1
@@ -51,6 +51,7 @@ public class TooltipHandlerBurnTime implements ITooltipCallback {
|
||||
|
||||
@Override
|
||||
public boolean shouldHandleItem(ItemStack item) {
|
||||
if (!Thread.currentThread().getName().startsWith("Client Thread")) return false;
|
||||
int time = TileEntityFurnace.getItemBurnTime(item);
|
||||
return time > 0 || isStirlingGen(item);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user