diff options
Diffstat (limited to 'src/Java')
9 files changed, 146 insertions, 80 deletions
diff --git a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java index ca231dbd63..d5e016bbf8 100644 --- a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java +++ b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java @@ -47,6 +47,10 @@ public class AutoMap<V> implements Iterable<V>, Cloneable, Serializable { return set(object); } + public synchronized V add(V object){ + return set(object); + } + public synchronized V set(V object){ if (object == null) { return null; @@ -90,15 +94,19 @@ public class AutoMap<V> implements Iterable<V>, Cloneable, Serializable { return true; } + private final Class getMapType() { + Class<? extends Object> g = mInternalMap.get(0).getClass(); + return g; + } + public synchronized V[] toArray() { - Collection<V> col = this.mInternalMap.values(); - V[] val = (V[]) new Object[col.size()]; - int counter = 0; - for (V i : col) { - val[counter] = i; - counter++; + /*Collection<V> col = this.mInternalMap.values(); + List<V> abcList = new ArrayList<V>(); + for (V g : col) { + abcList.add(g); } - return val; + return (V[]) abcList.toArray();*/ + return (V[]) new AutoArray(this).getGenericArray(); } public synchronized final int getInternalID() { @@ -106,10 +114,35 @@ public class AutoMap<V> implements Iterable<V>, Cloneable, Serializable { } public synchronized final boolean remove(V value) { + value.getClass(); if (this.mInternalMap.containsValue(value)) { return this.mInternalMap.remove(mInternalNameMap.get(""+value.hashCode()), value); } return false; } + + private class AutoArray<E> { + + private final V[] arr; + public final int length; + + public AutoArray(AutoMap aMap) { + this.arr = (V[]) java.lang.reflect.Array.newInstance(aMap.getMapType(), aMap.size()); + this.length = aMap.size(); + } + private V get(int i) { + return arr[i]; + } + private void set(int i, V e) { + arr[i] = e; + } + protected V[] getGenericArray() { + return arr; + } + @Override + public String toString() { + return Arrays.toString(arr); + } + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 04c1cf34cc..2427815295 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -39,6 +39,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; @@ -265,6 +266,10 @@ GT_MetaTileEntity_MultiBlockBase { private final String aRequiresCoreModule = "1x Core Module"; private final String aRequiresMaint = "1x Maintanence Hatch";*/ + public final static String TAG_HIDE_HATCHES = "TAG_HIDE_HATCHES"; + public final static String TAG_HIDE_POLLUTION = "TAG_HIDE_POLLUTION"; + public final static String TAG_HIDE_MACHINE_TYPE = "TAG_HIDE_MACHINE_TYPE"; + @Override public final String[] getDescription() { /*if (aCachedToolTip != null) { @@ -287,22 +292,62 @@ GT_MetaTileEntity_MultiBlockBase { String aRequiresCoreModule = "1x Core Module"; String aRequiresMaint = "1x Maintanence Hatch"; - String[] x = getTooltip(); - //Add Stock Tooltip to bottom of list - String[] z; - if (getPollutionPerTick(null) > 0) { - z = new String[] { - aRequiresMaint, - aRequiresCoreModule, - aRequiresMuffler, - getPollutionTooltip(), - getMachineTooltip()}; + String[] x = getTooltip(); + + //Filter List, toggle switches, rebuild map without flags + boolean showHatches = true; + boolean showMachineType = true; + boolean showPollution = getPollutionPerTick(null) > 0; + AutoMap<String> aTempMap = new AutoMap<String>(); + for (int ee = 0; ee < x.length; ee++) { + String hh = x[ee]; + if (hh.equals(TAG_HIDE_HATCHES)) { + showHatches = false; + } + else if (hh.equals(TAG_HIDE_POLLUTION)) { + showPollution = false; + } + else if (hh.equals(TAG_HIDE_MACHINE_TYPE)) { + showMachineType = false; + } + else { + aTempMap.put(x[ee]); + } } - else { - z = new String[] { - aRequiresMaint, - aRequiresCoreModule, - getMachineTooltip(),}; + //Rebuild + x = new String[aTempMap.size()]; + for (int ee = 0; ee < x.length; ee++) { + x[ee] = aTempMap.get(ee); + } + + + //Assemble ordered map for misc tooltips + AutoMap<String> aOrderedMap = new AutoMap<String>(); + if (showHatches) { + aOrderedMap.put(aRequiresMaint); + aOrderedMap.put(aRequiresCoreModule); + if (showPollution) { + aOrderedMap.put(aRequiresMuffler); + } + } + + if (showMachineType) { + aOrderedMap.put(getMachineTooltip()); + } + + if (showPollution) { + aOrderedMap.put(getPollutionTooltip()); + } + + + + + + //Add Stock Tooltip to bottom of list + String[] z; + z = new String[aOrderedMap.size()]; + for (int ee = 0; ee < z.length; ee++) { + z[ee] = aOrderedMap.get(ee); } int a2, a3; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java index b3366df96b..54323d8c2e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java @@ -86,8 +86,8 @@ extends GregtechMetaCasingBlocksAbstract { case 2: return TexturesGtBlock.TEXTURE_ORGANIC_PANEL_A_GLOWING.getIcon(); //Coke Oven Casing Tier 2 - case 3: - return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); + case 3: + return TexturesGtBlock.TEXTURE_METAL_PANEL_A.getIcon(); //Material Press Casings case 4: return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java index 6515589905..eca02d290e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java @@ -70,13 +70,11 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase { "Only uses 75% of the eu/t normally required", "Processes five items per voltage tier", "Size: 3x3x3 (Hollow)", + "Supply Depot. Casings (10 at least!)", "Controller (front centered)", - "1x Input Bus (anywhere)", - "1x Output Bus (anywhere)", - "1x Energy Hatch (anywhere)", - "1x Maintenance Hatch (anywhere)", - "1x Muffler (anywhere)", - "Supply Depot. Casings for the rest (10 at least!)" + "1x Input Bus", + "1x Output Bus", + "1x Energy Hatch", }; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java index d90b88e4d8..c549cf9216 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java @@ -65,15 +65,13 @@ extends GregtechMeta_MultiBlockBase { "Size: nx3xn [WxHxL] (Hollow)", "n can be 3, 5 or 7", "Max Size required to process Plasma recipes", + mCasingName+"s (10 at least!)", "Controller (top centered)", - "1x Input Bus (anywhere)", - "1x Output Bus (anywhere)", - "1x Input Hatch (anywhere)", - "1x Output Hatch (anywhere)", - "1x Energy Hatch (anywhere)", - "1x Muffler Hatch (anywhere)", - "1x Maintenance Hatch (Back Center)", - mCasingName+"s for the rest", + "1x Input Bus", + "1x Output Bus", + "1x Input Hatch", + "1x Output Hatch", + "1x Energy Hatch", }; } @@ -85,10 +83,10 @@ extends GregtechMeta_MultiBlockBase { @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == 0 || aSide == 1) { - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.getIndexFromPage(2, 1)], + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[mCasingTextureID], new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Default_Active : TexturesGtBlock.Overlay_Machine_Controller_Default)}; } - return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[TAE.getIndexFromPage(2, 1)]}; + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[mCasingTextureID]}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java index 7472b71a95..064dc8372b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java @@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; import static gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes; import static gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes_GT; +import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; @@ -28,6 +29,7 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta public static int CASING_TEXTURE_ID; public static String mCryoFuelName = "Gelid Cryotheum"; public static String mCasingName = "Advanced Cryogenic Casing"; + public static String mHatchName = "Cryotheum Hatch"; public static FluidStack mFuelStack; public GregtechMetaTileEntity_IndustrialVacuumFreezer(final int aID, final String aName, final String aNameRegional) { @@ -36,6 +38,7 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10); mCryoFuelName = mFuelStack.getLocalizedName(); mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 10); + mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 967); } public GregtechMetaTileEntity_IndustrialVacuumFreezer(final String aName) { @@ -44,6 +47,7 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10); mCryoFuelName = mFuelStack.getLocalizedName(); mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 10); + mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 967); } public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { @@ -63,21 +67,19 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta if (mCryoFuelName.toLowerCase().contains(".")) { mCryoFuelName = FluidUtils.getFluidStack("cryotheum", 1).getLocalizedName(); } + if (mHatchName.toLowerCase().contains(".name")) { + mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 967); + } return new String[]{ - "Controller Block for the Advanced Cryogenic Freezer", - "Super cools hot ingots and cells", - "Processes four Vacuum Freezer Recipes at 200% speed", + "Factory Grade Advanced Vacuum Freezer", + "Speed: 200% | Eu Usage: 100% | Parallel: 4", "Consumes 1L of "+mCryoFuelName+"/t during operation", - "Size(WxHxD): 3x3x3 (Hollow)", - mCasingName+"s for the rest (10 at least!)", - "Controller (Front centered)", - "1x Input Bus", - "1x Output Bus", - "1x Input Hatch", - "1x Output Hatch (optional)", - "1x Energy Hatch", - }; + "Constructed exactly the same as a normal Vacuum Freezer", + "Use "+mCasingName+"s (10 at least!)", + "1x " + mHatchName + " (Required)", + "TAG_HIDE_HATCHES" + }; } public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java index e4f984ee18..f10350eaee 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java @@ -103,21 +103,14 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 968); } - return new String[] { "Controller Block for the Advanced Electric Blast Furnace", - "120% faster than using an equal tier EBF", "Only uses 90% of the eu/t normally required", - "Processes upto 8 recipes at once", - "Consumes 10L of " + mHotFuelName + "/s during operation", - "Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)", - "Each 1800K over the min. Heat Capacity allows for one upgraded overclock", - "Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%", - "Size(WxHxD): 3x4x3 (Hollow), Controller (Front middle bottom)", - "16x Heating Coils (Two middle Layers, hollow)", - "1x " + mHatchName, - "1x Input Hatch/Bus", - "1x Output Hatch/Bus (Bottom Layer)", - "1x Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing),", - " Recovery scales with Muffler Hatch tier", mCasingName + "s for the rest", - "1x Energy Hatch", + return new String[] { + "Factory Grade Advanced Blast Furnace", + "Speed: 120% | Eu Usage: 90% | Parallel: 8", + "Consumes 10L of " + mHotFuelName + " per second during operation", + "Constructed exactly the same as a normal EBF", + "Use "+mCasingName+"s (10 at least!)", + "1x " + mHatchName + " (Required)", + "TAG_HIDE_HATCHES" }; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java index 8abf506e55..7dfdbf75d6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java @@ -47,15 +47,12 @@ extends GregtechMeta_MultiBlockBase { if (mCasingName.contains("gt.blockcasings")) { mCasingName = ItemList.Casing_RobustTungstenSteel.get(1).getDisplayName(); } - return new String[]{ - "Controller Block for the Advanced Implosion Compressor", - "Processes upto ((Tier/2)+1) recipes at once", - "Size(WxHxD): 3x3x3 (Hollow)", - mCasingName+"s (10 at least!)", - "Controller (Front centered)", - "1x Input Bus", - "1x Output Bus", - "1x Energy Hatch", + return new String[]{ + "Factory Grade Advanced Implosion Compressor", + "Speed: 100% | Eu Usage: 100% | Parallel: ((Tier/2)+1)", + "Constructed exactly the same as a normal Implosion Compressor", + "Use "+mCasingName+"s (10 at least!)", + "TAG_HIDE_HATCHES" }; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCryogenicFreezer.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCryogenicFreezer.java index 213b6f0ccb..65f3e41911 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCryogenicFreezer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCryogenicFreezer.java @@ -17,10 +17,10 @@ public class GregtechIndustrialCryogenicFreezer { private static void run1() { Logger.INFO("Gregtech 5 Content | Registering Advanced GT Multiblock replacements."); - GregtechItemList.Machine_Adv_BlastFurnace.set(new GregtechMetaTileEntity_Adv_EBF(963, "multimachine.adv.blastfurnace", "[Factory Grade] Adv. EBF").getStackForm(1L)); - GregtechItemList.Machine_Adv_ImplosionCompressor.set(new GregtechMetaTileEntity_Adv_Implosion(964, "multimachine.adv.implosioncompressor", "[Factory Grade] Adv. Implosion Compressor").getStackForm(1L)); - GregtechItemList.Industrial_Cryogenic_Freezer.set(new GregtechMetaTileEntity_IndustrialVacuumFreezer(910, "multimachine.adv.industrialfreezer", "[Factory Grade] Cryogenic Freezer").getStackForm(1L)); - GregtechItemList.FusionComputer_UV2.set(new GregtechMetaTileEntity_Adv_Fusion_MK4(965, "fusioncomputer.tier.09", "FusionTek MK IV").getStackForm(1L)); + GregtechItemList.Machine_Adv_BlastFurnace.set(new GregtechMetaTileEntity_Adv_EBF(963, "multimachine.adv.blastfurnace", "Volcanus").getStackForm(1L)); + GregtechItemList.Machine_Adv_ImplosionCompressor.set(new GregtechMetaTileEntity_Adv_Implosion(964, "multimachine.adv.implosioncompressor", "Density^2").getStackForm(1L)); + GregtechItemList.Industrial_Cryogenic_Freezer.set(new GregtechMetaTileEntity_IndustrialVacuumFreezer(910, "multimachine.adv.industrialfreezer", "Cryogenic Freezer").getStackForm(1L)); + GregtechItemList.FusionComputer_UV2.set(new GregtechMetaTileEntity_Adv_Fusion_MK4(965, "fusioncomputer.tier.09", "FusionTech MK IV").getStackForm(1L)); } } |