From 920ba2f0c36e60ee9961a10a186fbad5bcbd78ab Mon Sep 17 00:00:00 2001 From: Danila Bolshakov Date: Tue, 13 Dec 2016 11:41:38 +0300 Subject: [PATCH 1/2] Add progress bar --- src/main/java/gregtech/common/GT_Proxy.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 34c317c8..f2c7d0c6 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -4,6 +4,7 @@ import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.IFuelHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.eventhandler.Event.Result; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; @@ -1682,9 +1683,11 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public void activateOreDictHandler() { this.mOreDictActivated = true; + ProgressManager.ProgressBar progressBar = ProgressManager.push("Register materials", mEvents.size()); OreDictEventContainer tEvent; for (Iterator i$ = this.mEvents.iterator(); i$.hasNext(); registerRecipes(tEvent)) { tEvent = (OreDictEventContainer) i$.next(); + progressBar.step(tEvent.mMaterial.toString()); } } From 60704cca7f95aa7435a8ba184d350182147d623e Mon Sep 17 00:00:00 2001 From: Danila Bolshakov Date: Tue, 13 Dec 2016 11:50:01 +0300 Subject: [PATCH 2/2] forgot check null --- src/main/java/gregtech/common/GT_Proxy.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index f2c7d0c6..02fd3b02 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -1687,7 +1687,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { OreDictEventContainer tEvent; for (Iterator i$ = this.mEvents.iterator(); i$.hasNext(); registerRecipes(tEvent)) { tEvent = (OreDictEventContainer) i$.next(); - progressBar.step(tEvent.mMaterial.toString()); + + progressBar.step(tEvent.mMaterial == null ? "" : tEvent.mMaterial.toString()); } }