diff options
| author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-03-12 05:08:33 +0000 |
|---|---|---|
| committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-03-12 05:08:33 +0000 |
| commit | dbe1827984f9dd1e87d500882c541181bdaeb542 (patch) | |
| tree | 10f60a2559121185f97c73b4b37152424068c5a8 /src/Java/gtPlusPlus/xmod/galacticraft/handler | |
| parent | 6093c5e76fad9cb1ec8a44e7a638c0350f11e952 (diff) | |
| download | GT5-Unofficial-dbe1827984f9dd1e87d500882c541181bdaeb542.tar.gz GT5-Unofficial-dbe1827984f9dd1e87d500882c541181bdaeb542.tar.bz2 GT5-Unofficial-dbe1827984f9dd1e87d500882c541181bdaeb542.zip | |
+ Added framework for additional Oil chemistry in future updates.
+ Added additional processes for obtaining Kerosene.
% Mild rebalance to GT++ Rocket Fuels.
% Swapped Coal by-products (Coal Tar, Coal Tar Oil and Sulfuric Coal Tar Oil) from Gas Turbine fuel to Semifluid fuel.
% Allowed ItemPackages to register themselves to the onLoadComplete() event.
$ Fixed GT++ Rocket Fuels being unusable in Rocket Engines.
$ Fixed Tooltip on GC Fuel loader when the GC-ASM is not active.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/galacticraft/handler')
| -rw-r--r-- | src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java b/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java index 58331c4300..64f1cfbe23 100644 --- a/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java +++ b/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java @@ -1,6 +1,8 @@ package gtPlusPlus.xmod.galacticraft.handler; import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.LinkedHashMap; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.block.Block; @@ -18,7 +20,7 @@ public class HandlerTooltip_GC { private static Block mBlock; private static Class<?> oMainClass; private static Class<?> oFuelLoaderClass; - private static String[] mFuelNames; + private static HashMap <Integer, String> mFuelNames; @SubscribeEvent public void onItemTooltip(ItemTooltipEvent event) { @@ -30,8 +32,7 @@ public class HandlerTooltip_GC { if (GCBlocks != null) { oMainClass = GCBlocks; - Class<?> GCFuelLoader = Class - .forName("micdoodle8.mods.galacticraft.core.blocks.BlockFuelLoader"); + Class<?> GCFuelLoader = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.blocks.BlockFuelLoader"); if (GCFuelLoader != null) { oFuelLoaderClass = GCFuelLoader; @@ -49,24 +50,26 @@ public class HandlerTooltip_GC { } catch (Throwable t) { } } - if (mFuelNames == null || mFuelNames.length == 0) { - mFuelNames = new String[RocketFuels.mValidRocketFuels.size()]; - int slot = 0; - for (Fluid f : RocketFuels.mValidRocketFuels.values()) { - mFuelNames[slot++] = f.getLocalizedName(); + + if (mFuelNames == null || mFuelNames.isEmpty()) { + mFuelNames = new LinkedHashMap<Integer, String>(); + for (int aMapKey : RocketFuels.mValidRocketFuels.keySet()) { + Fluid aFuel = RocketFuels.mValidRocketFuels.get(aMapKey); + if (aFuel != null) { + mFuelNames.put(aMapKey, aFuel.getLocalizedName()); + } } - } - if (mItemBlock != null) { + } + if (mItemBlock != null && !mFuelNames.isEmpty()) { Item aTempItem = event.itemStack.getItem(); Block aTempBlock = Block.getBlockFromItem(aTempItem); - if (aTempItem == mItemBlock || oFuelLoaderClass.isInstance(aTempBlock) - || event.itemStack.getUnlocalizedName().toLowerCase().contains("fuelloader")) { - int aTier = 0; - for (String s : mFuelNames) { - if (s != null) { - event.toolTip.add("Tier "+aTier+": "+s); + if (aTempItem == mItemBlock || oFuelLoaderClass.isInstance(aTempBlock) || event.itemStack.getUnlocalizedName().toLowerCase().contains("fuelloader")) { + for (int aMapKey : mFuelNames.keySet()) { + String aFuel = mFuelNames.get(aMapKey); + if (aFuel != null) { + event.toolTip.add("Tier "+(aMapKey+1)+": "+aFuel); } - } + } } } } |
