diff options
Diffstat (limited to 'src/Java')
18 files changed, 767 insertions, 108 deletions
diff --git a/src/Java/gregtech/api/util/Recipe_GT.java b/src/Java/gregtech/api/util/Recipe_GT.java index eb8d8f546f..b95f86d46c 100644 --- a/src/Java/gregtech/api/util/Recipe_GT.java +++ b/src/Java/gregtech/api/util/Recipe_GT.java @@ -984,7 +984,8 @@ public class Recipe_GT extends GT_Recipe implements IComparableRecipe{ if (mColumn >= 3) { mColumn = 0; mRow++; - } + } + if (mColumn <= 2 && mRow <= 3) outputStacks.add( (PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( (Object) mNEIMap.get(i), xPos[mColumn++], yPos[mRow])); @@ -1148,7 +1149,8 @@ public class Recipe_GT extends GT_Recipe implements IComparableRecipe{ if (mColumn >= 3) { mColumn = 0; mRow++; - } + } + if (mColumn <= 2 && mRow <= 3) outputStacks.add( (PositionedStack) new GT_NEI_MultiBlockHandler.FixedPositionedStack( (Object) mNEIMap.get(i), xPos[mColumn++], yPos[mRow])); @@ -1359,4 +1361,4 @@ public class Recipe_GT extends GT_Recipe implements IComparableRecipe{ return 0; } -}
\ No newline at end of file +} diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index 2abe195212..0aadef5e4b 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -101,7 +101,7 @@ public class GTplusplus implements ActionListener { CORE.USER_COUNTRY = GeoUtils.determineUsersCountry(); // Handle GT++ Config - ConfigHandler.handleConfigFile(event); + ConfigHandler.handleConfigFile(event); //Check for Dev CORE.DEVENV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); @@ -146,8 +146,8 @@ public class GTplusplus implements ActionListener { proxy.postInit(event); BookHandler.runLater(); Core_Manager.postInit(); - RecipeGen_Recycling.executeGenerators(); - + RecipeGen_Recycling.executeGenerators(); + Logger.INFO("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); Logger.INFO("| Recipes succesfully Loaded: " + RegistrationHandler.recipesSuccess + " | Failed: " + RegistrationHandler.recipesFailed + " |"); @@ -162,7 +162,9 @@ public class GTplusplus implements ActionListener { @EventHandler public void serverStarting(final FMLServerStartingEvent event) { - event.registerServerCommand(new CommandMath()); + + if (CORE.DEVENV) + event.registerServerCommand(new CommandMath()); //Chunk Loading Timer h = ChunkManager.createChunkQueue(); @@ -192,15 +194,15 @@ public class GTplusplus implements ActionListener { public void actionPerformed(final ActionEvent arg0) { } - - + + /** * This {@link EventHandler} is called after the {@link FMLPostInitializationEvent} stages of all loaded mods executes successfully. * {@link #onLoadComplete(FMLLoadCompleteEvent)} exists to inject recipe generation after Gregtech and all other mods are entirely loaded and initialized. * @param event - The {@link EventHandler} object passed through from FML to {@link #GTplusplus()}'s {@link #instance}. */ @Mod.EventHandler - public void onLoadComplete(FMLLoadCompleteEvent event) { + public void onLoadComplete(FMLLoadCompleteEvent event) { RecipeGen_BlastSmelterGT_GTNH.generateGTNHBlastSmelterRecipesFromEBFList(); FishPondFakeRecipe.generateFishPondRecipes(); @@ -217,14 +219,14 @@ public class GTplusplus implements ActionListener { CORE.RA.addMultiblockElectrolyzerRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mDuration, x.mEUt); } } - + //Advanced Vacuum Freezer generation for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sVacuumRecipes.mRecipeList) { - if (x != null && RecipeUtils.doesGregtechRecipeHaveEqualCells(x)) { + if (x != null && RecipeUtils.doesGregtechRecipeHaveEqualCells(x)) { CORE.RA.addAdvancedFreezerRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, (x.mDuration/2), x.mEUt); } } - + } protected void dumpGtRecipeMap(final GT_Recipe_Map r) { @@ -247,11 +249,11 @@ public class GTplusplus implements ActionListener { SegmentAnalytics.isEnabled = CORE.ConfigSwitches.enableUpdateChecker; if (!Utils.isServer() && PlayerUtils.isPlayerAlkalus()){ SegmentAnalytics.isEnabled = true; - } + } new SegmentHelper(); } - private static final boolean setupMaterialBlacklist(){ + private static final boolean setupMaterialBlacklist(){ int ID = 0; Material.invalidMaterials.put(ID++, Materials._NULL); Material.invalidMaterials.put(ID++, Materials.Clay); @@ -260,9 +262,9 @@ public class GTplusplus implements ActionListener { Material.invalidMaterials.put(ID++, Materials.Bronze); Material.invalidMaterials.put(ID++, Materials.Hydrogen); //Infused TC stuff - Material.invalidMaterials.put(ID++, Materials.InfusedAir); - Material.invalidMaterials.put(ID++, Materials.InfusedEarth); - Material.invalidMaterials.put(ID++, Materials.InfusedFire); + Material.invalidMaterials.put(ID++, Materials.InfusedAir); + Material.invalidMaterials.put(ID++, Materials.InfusedEarth); + Material.invalidMaterials.put(ID++, Materials.InfusedFire); Material.invalidMaterials.put(ID++, Materials.InfusedWater); //EIO Materials @@ -288,10 +290,10 @@ public class GTplusplus implements ActionListener { //Non GTNH Materials if (!CORE.GTNH){ //Mithril - Random Dungeon Loot - mGregMatLoader.enableMaterial(Materials.Mithril); - } + mGregMatLoader.enableMaterial(Materials.Mithril); + } //Force - Alloying - mGregMatLoader.enableMaterial(Materials.Force); + mGregMatLoader.enableMaterial(Materials.Force); } -} +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/commands/CommandMath.java b/src/Java/gtPlusPlus/core/commands/CommandMath.java index a05bb42756..6ab0b2cbc6 100644 --- a/src/Java/gtPlusPlus/core/commands/CommandMath.java +++ b/src/Java/gtPlusPlus/core/commands/CommandMath.java @@ -55,8 +55,8 @@ public class CommandMath implements ICommand public void processCommand(final ICommandSender S, final String[] argString){ final World W = S.getEntityWorld(); final EntityPlayer P = CommandUtils.getPlayer(S); - if (!W.isRemote){ - if (P.getDisplayName().toLowerCase().equals("draknyte1") || P.getCommandSenderName().toLowerCase().equals("draknyte1")) { + if (!W.isRemote && P != null){ + if (P.getDisplayName().toLowerCase().equals("draknyte1") || P.getCommandSenderName().toLowerCase().equals("draknyte1")) { String[] prefixes = new String[] { "ingot", "plate", @@ -83,8 +83,8 @@ public class CommandMath implements ICommand "Silver", "Lead", "Aluminium" - }; - AutoMap<EntityItem> itemEntities = new AutoMap<EntityItem>(); + }; + AutoMap<EntityItem> itemEntities = new AutoMap<EntityItem>(); for (String g : prefixes) { for (String s : loots) { itemEntities.put(new EntityItem(W, P.posX, P.posY, P.posZ, ItemUtils.getItemStackOfAmountFromOreDictNoBroken(g+s, 64))); @@ -92,7 +92,7 @@ public class CommandMath implements ICommand for (EntityItem e : itemEntities.values()) { e.lifespan = 30000; } - + } } @@ -194,6 +194,9 @@ public class CommandMath implements ICommand @Override public boolean canCommandSenderUseCommand(final ICommandSender var1){ final EntityPlayer P = CommandUtils.getPlayer(var1); + if (P == null){ + return false; + } if (P.getDisplayName().toLowerCase().equals("draknyte1") || P.getCommandSenderName().toLowerCase().equals("draknyte1")) { return true; } @@ -217,5 +220,4 @@ public class CommandMath implements ICommand return true; } -} - +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 2c09ba1f03..d34e1a1856 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -58,6 +58,7 @@ public class COMPAT_HANDLER { new RECIPES_LaserEngraver(); new RECIPES_Extruder(); + GregtechGeneratorsULV.run(); GregtechEnergyBuffer.run(); GregtechLFTR.run(); GregtechSteamCondenser.run(); diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index e5abd9bbc3..1b2ef19b53 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -76,7 +76,7 @@ public class Material { public Material(String materialName, MaterialState defaultState, short[] rgba, int radiationLevel, MaterialStack[] materialStacks) { this(materialName, defaultState, null, 0, rgba, -1, -1, -1, -1, false, "", radiationLevel, false, materialStacks); - } + } public Material(String materialName, MaterialState defaultState, short[] rgba, int j, int k, int l, int m, int radiationLevel, MaterialStack[] materialStacks){ this(materialName, defaultState, null, 0, rgba, j, k, l, m, false, "", radiationLevel, false, materialStacks); @@ -91,7 +91,7 @@ public class Material { } public Material(final String materialName, final MaterialState defaultState, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, boolean generateCells, final MaterialStack... inputs){ - this(materialName, defaultState, null, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", 0, generateCells, inputs); + this(materialName, defaultState, null, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", 0, generateCells, true, inputs); } public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final int radiationLevel, final MaterialStack... inputs){ @@ -104,17 +104,21 @@ public class Material { public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){ this(materialName, defaultState, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, inputs); - } + } public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, boolean addCells,final MaterialStack... inputs) { - this (materialName, defaultState, null, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, addCells, inputs); + this (materialName, defaultState, null, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, addCells, true, inputs); } public Material(final String materialName, final MaterialState defaultState, final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){ - this (materialName, defaultState, null, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, inputs); + this (materialName, defaultState, null, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, true, inputs); } public Material(final String materialName, final MaterialState defaultState, final TextureSet set, final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, boolean generateCells, final MaterialStack... inputs){ + this (materialName, defaultState, null, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, true, inputs); + } + + public Material(final String materialName, final MaterialState defaultState, final TextureSet set, final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, boolean generateCells, boolean generateFluid, final MaterialStack... inputs){ try { this.unlocalizedName = Utils.sanitizeString(materialName); this.localizedName = materialName; @@ -285,27 +289,32 @@ public class Material { this.vChemicalFormula = "??"; } - - final Materials isValid = Materials.get(this.getLocalizedName()); - if (FluidUtils.getFluidStack(localizedName, 1) != null){ - this.vMoltenFluid = FluidUtils.getFluidStack(localizedName, 1).getFluid(); - } - else if (isValid == null || isValid == Materials._NULL){ - this.vMoltenFluid = this.generateFluid(); - } - else { - if (isValid.mFluid != null){ - this.vMoltenFluid = isValid.mFluid; + if (generateFluid){ + final Materials isValid = Materials.get(this.getLocalizedName()); + if (FluidUtils.getFluidStack(localizedName, 1) != null){ + this.vMoltenFluid = FluidUtils.getFluidStack(localizedName, 1).getFluid(); } - else if (isValid.mGas != null){ - this.vMoltenFluid = isValid.mGas; + else if (isValid == null || isValid == Materials._NULL){ + this.vMoltenFluid = this.generateFluid(); } else { - this.vMoltenFluid = this.generateFluid(); + if (isValid.mFluid != null){ + this.vMoltenFluid = isValid.mFluid; + } + else if (isValid.mGas != null){ + this.vMoltenFluid = isValid.mGas; + } + else { + this.vMoltenFluid = this.generateFluid(); + } } - } - this.vPlasma = this.generatePlasma(); + this.vPlasma = this.generatePlasma(); + } + else { + this.vMoltenFluid = null; + this.vPlasma = null; + } String ratio = ""; if (this.vSmallestRatio != null) { @@ -335,17 +344,17 @@ public class Material { public final TextureSet getTextureSet() { synchronized(this) { return textureSet; - } + } } public TextureSet setTextureSet(TextureSet set) { if (set != null) { - return set; + return set; } else { // build hash table with count AutoMap<Material> sets = new AutoMap<Material>(); - if (this.vMaterialInput != null) { + if (this.vMaterialInput != null) { for (MaterialStack r : this.vMaterialInput) { if (r.getStackMaterial().getTextureSet().mSetName.toLowerCase().contains("fluid")) { sets.put(ELEMENT.getInstance().GOLD); @@ -353,16 +362,16 @@ public class Material { else { sets.put(r.getStackMaterial()); } - } - TextureSet mostUsedTypeTextureSet = (TextureSet) MaterialUtils.getMostCommonTextureSet(new ArrayList<Material>(sets.values())); + } + TextureSet mostUsedTypeTextureSet = (TextureSet) MaterialUtils.getMostCommonTextureSet(new ArrayList<Material>(sets.values())); if (mostUsedTypeTextureSet != null && mostUsedTypeTextureSet instanceof TextureSet) { Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+mostUsedTypeTextureSet.mSetName+"."); return mostUsedTypeTextureSet; - } + } } } Logger.MATERIALS("Set textureset for "+this.localizedName+" to be "+Materials.Iron.mIconSet.mSetName+". [Fallback]"); - return Materials.Iron.mIconSet; + return Materials.Iron.mIconSet; } public final String getLocalizedName(){ @@ -393,7 +402,7 @@ public class Material { final public short[] getRGBA(){ if (this.RGBA != null) { if (this.RGBA.length == 4){ - return this.RGBA; + return this.RGBA; } else { return new short[]{this.RGBA[0], this.RGBA[1], this.RGBA[2], 0}; @@ -561,17 +570,17 @@ public class Material { } public final ItemStack getCrushedCentrifuged(final int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("crushedCentrifuged"+this.unlocalizedName, stacksize); - } + } public final ItemStack getDustPurified(final int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustPure"+this.unlocalizedName, stacksize); } public final ItemStack getDustImpure(final int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustImpure"+this.unlocalizedName, stacksize); - } + } public final boolean hasSolidForm() { if (this.getDust(1) != null || this.getBlock(1) != null || this.getSmallDust(1) != null || this.getTinyDust(1) != null) { return true; - } + } return false; } @@ -596,7 +605,7 @@ public class Material { Logger.INFO("Failed setting slot "+i+", using "+this.localizedName); } } - return temp; + return temp; } return new ItemStack[]{}; } @@ -772,8 +781,8 @@ public class Material { if (a5 != null){ Logger.INFO("Using a pre-defined Fluid from GT. Plasma."); return a5.getFluid(); - } - Logger.INFO("Using null."); + } + Logger.INFO("Using null."); return null; } } @@ -782,37 +791,37 @@ public class Material { if (this.materialState == MaterialState.SOLID){ if (isValid.mFluid != null){ Logger.INFO("Using a pre-defined Fluid from GT. mFluid."); - return isValid.mFluid; - } + return isValid.mFluid; + } else if (isValid.mStandardMoltenFluid != null){ Logger.INFO("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); - return isValid.mStandardMoltenFluid; + return isValid.mStandardMoltenFluid; } } else if (this.materialState == MaterialState.GAS){ if (isValid.mGas != null){ Logger.INFO("Using a pre-defined Fluid from GT. mGas."); - return isValid.mGas; - } + return isValid.mGas; + } } else if (this.materialState == MaterialState.LIQUID || this.materialState == MaterialState.PURE_LIQUID){ if (isValid.mFluid != null){ Logger.INFO("Using a pre-defined Fluid from GT. mFluid."); - return isValid.mFluid; - } + return isValid.mFluid; + } else if (isValid.mGas != null){ Logger.INFO("Using a pre-defined Fluid from GT. mGas."); - return isValid.mGas; + return isValid.mGas; } else if (isValid.mStandardMoltenFluid != null){ Logger.INFO("Using a pre-defined Fluid from GT. mStandardMoltenFluid."); - return isValid.mStandardMoltenFluid; + return isValid.mStandardMoltenFluid; } - } + } Logger.INFO("Generating our own fluid."); //Generate a Cell if we need to - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1) == null){ + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1) == null){ if (this.vGenerateCells){ new BaseItemCell(this); Logger.INFO("Generated a cell for "+this.getUnlocalizedName()); @@ -864,7 +873,7 @@ public class Material { if (this.materialState == MaterialState.ORE){ return null; } - final Materials isValid = Materials.get(this.getLocalizedName()); + final Materials isValid = Materials.get(this.getLocalizedName()); if (!this.vGenerateCells){ return null; @@ -876,8 +885,8 @@ public class Material { } if (isValid.mPlasma != null){ Logger.INFO("Using a pre-defined Plasma from GT."); - return isValid.mPlasma; - } + return isValid.mPlasma; + } Logger.INFO("Generating our own Plasma."); return FluidUtils.addGTPlasma(this); @@ -885,10 +894,10 @@ public class Material { - final public FluidStack getFluid(final int fluidAmount) { + final public FluidStack getFluid(final int fluidAmount) { if (this.vMoltenFluid == null){ return null; - } + } final FluidStack moltenFluid = new FluidStack(this.vMoltenFluid, fluidAmount); return moltenFluid; } @@ -978,4 +987,4 @@ public class Material { } } -} +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java index 5264a16cb8..c6dd1bfeb5 100644 --- a/src/Java/gtPlusPlus/core/recipe/common/CI.java +++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java @@ -1,5 +1,6 @@ package gtPlusPlus.core.recipe.common; +import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -177,7 +178,9 @@ public class CI { public static ItemStack explosiveTNT; public static ItemStack explosiveITNT; - public static void preInit(){ + public static void preInit(){ + //Put these here, because we need them for everything. + new MetaGeneratedGregtechItems(); //Tiered Components component_Plate = new String[]{ diff --git a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java index f8e777dd35..98b02078c6 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java @@ -27,11 +27,11 @@ public class MaterialUtils { @SuppressWarnings({ "rawtypes", "unused" }) private static Class[][] commonTypes = -{{Materials.class, int.class, TextureSet.class, float.class, int.class, - int.class, int.class, int.class, int.class, int.class, int.class, - String.class, int.class, int.class, int.class, int.class, boolean.class, - boolean.class, int.class, int.class, int.class, Dyes.class, int.class, - List.class , List.class}}; + {{Materials.class, int.class, TextureSet.class, float.class, int.class, + int.class, int.class, int.class, int.class, int.class, int.class, + String.class, int.class, int.class, int.class, int.class, boolean.class, + boolean.class, int.class, int.class, int.class, Dyes.class, int.class, + List.class , List.class}}; public static List<?> oreDictValuesForEntry(final String oredictName){ List<?> oredictItemNames; @@ -47,7 +47,7 @@ public class MaterialUtils { public static Material generateMaterialFromGtENUM(final Materials material){ return generateMaterialFromGtENUM(material, null); } - + public static Material generateMaterialFromGtENUM(final Materials material, short[] customRGB){ @SuppressWarnings("deprecation") String name = material.name(); @@ -60,6 +60,7 @@ public class MaterialUtils { final TextureSet iconSet = material.mIconSet; final int durability = material.mDurability; boolean mGenerateCell = false; + boolean mGenerateFluid = true; MaterialState materialState; String chemicalFormula = StringUtils.subscript(Utils.sanitizeString(material.mChemicalFormula)); final Element element = material.mElement; @@ -67,12 +68,12 @@ public class MaterialUtils { if (material.isRadioactive()){ radioactivity = 1; } - + //Weird Blacklist of Bad Chemical Strings if (material.mElement == Element.Pb || material.mElement == Element.Na || material.mElement == Element.Ar){ chemicalFormula = StringUtils.subscript(Utils.sanitizeString(material.mElement.name())); } - + //Determine default state Logger.MATERIALS("[Debug] Setting State of GT generated material. "+material.mDefaultLocalName); if (material.getMolten(1) != null || material.getSolid(1) != null){ @@ -101,8 +102,9 @@ public class MaterialUtils { materialState = MaterialState.PLASMA; }*/ else { - Logger.MATERIALS("[Debug] State set as solid."); + Logger.MATERIALS("[Debug] State set as solid. This material has no alternative states, so for safety we wont generate anything."); materialState = MaterialState.SOLID; + mGenerateFluid = false; } @@ -113,7 +115,7 @@ public class MaterialUtils { if (hasValidRGBA(rgba) || (element == Element.H) || ((material == Materials.InfusedAir) || (material == Materials.InfusedFire) || (material == Materials.InfusedEarth) || (material == Materials.InfusedWater))){ //ModItems.itemBaseDecidust = UtilsItems.generateDecidust(material); //ModItems.itemBaseCentidust = UtilsItems.generateCentidust(material); - return new Material(name, materialState,iconSet, durability, rgba, melting, boiling, protons, neutrons, blastFurnace, chemicalFormula, radioactivity, mGenerateCell); + return new Material(name, materialState,iconSet, durability, rgba, melting, boiling, protons, neutrons, blastFurnace, chemicalFormula, radioactivity, mGenerateCell, mGenerateFluid); } else { Logger.DEBUG_MATERIALS("Failed to generate GT++ material instance for "+material.name() +" | Valid RGB? "+(hasValidRGBA(rgba))); @@ -138,10 +140,10 @@ public class MaterialUtils { return temp; } - public static boolean hasValidRGBA(final short[] rgba){ + public static boolean hasValidRGBA(final short[] rgba){ if (rgba == null || rgba.length < 3 || rgba.length > 4){ return false; - } + } return true; } @@ -182,9 +184,9 @@ public class MaterialUtils { } public static Materials getMaterialByName(String materialName) { - + if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - return (Materials) EnumUtils.getValue(gregtech.api.enums.Materials.class, materialName, false); + return (Materials) EnumUtils.getValue(gregtech.api.enums.Materials.class, materialName, false); } else { for (Materials m : Materials.values()) { @@ -195,7 +197,7 @@ public class MaterialUtils { return null; } } - + @SuppressWarnings("deprecation") public static String getMaterialName(Materials mat){ String mName; @@ -210,14 +212,12 @@ public class MaterialUtils { } return mName; } - + public static TextureSet getMostCommonTextureSet(List<Material> list) { Optional<TextureSet> r = list.stream().map(Material::getTextureSet).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().max(Map.Entry.comparingByValue()).map(Map.Entry::getKey); TextureSet o = (r != null && r.isPresent() && r.get() != null) ? r.get() : null; return o; - } - - } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index f2599db3f0..7d488292f0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -29,7 +29,6 @@ public class HANDLER_GT { public static final List<GTPP_Worldgen> sCustomWorldgenList = new ArrayList<GTPP_Worldgen>(); public static void preInit(){ - new MetaGeneratedGregtechItems(); if (mMaterialProperties != null){ GT_Materials.init(mMaterialProperties); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 48fe94502f..b137e93454 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -313,15 +313,28 @@ public enum GregtechItemList implements GregtechItemContainer { Hatch_Buffer_Dynamo_ULV, Hatch_Buffer_Dynamo_LV, Hatch_Buffer_Dynamo_MV, Hatch_Buffer_Dynamo_HV, Hatch_Buffer_Dynamo_EV, Hatch_Buffer_Dynamo_IV, Hatch_Buffer_Dynamo_LuV, Hatch_Buffer_Dynamo_ZPM, Hatch_Buffer_Dynamo_UV, Hatch_Buffer_Dynamo_MAX, + + //Large Packager Amazon_Warehouse_Controller, Casing_AmazonWarehouse, - //Advanced Vacuum Freezer - Industrial_Cryogenic_Freezer, Casing_AdvancedVacuum, + Hatch_Air_Intake, + //ULV Generators + Generator_Diesel_ULV, Generator_Gas_Turbine_ULV, Generator_Steam_Turbine_ULV, + + + //Advanced GT vanilla Multis + Machine_Adv_BlastFurnace, Casing_Adv_BlastFurnace, + Machine_Adv_ImplosionCompressor, + //Advanced Vacuum Freezer + Industrial_Cryogenic_Freezer, Casing_AdvancedVacuum, + FusionComputer_UV2 + + ; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java new file mode 100644 index 0000000000..c5397b83db --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java @@ -0,0 +1,42 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV; + +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.generators.GT_MetaTileEntity_DieselGenerator; +import net.minecraft.item.ItemStack; + +public class GT_MetaTileEntity_ULV_CombustionGenerator extends GT_MetaTileEntity_DieselGenerator { + public GT_MetaTileEntity_ULV_CombustionGenerator(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier); + } + + public GT_MetaTileEntity_ULV_CombustionGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_ULV_CombustionGenerator(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + @Override + public int getCapacity() { + return 16000; + } + + @Override + public void onConfigLoad() { + this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier." + this.mTier, 95); + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java new file mode 100644 index 0000000000..fe550895a3 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java @@ -0,0 +1,36 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.common.tileentities.generators.GT_MetaTileEntity_GasTurbine; + +public class GT_MetaTileEntity_ULV_GasTurbine extends GT_MetaTileEntity_GasTurbine { + public GT_MetaTileEntity_ULV_GasTurbine(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier); + } + + public GT_MetaTileEntity_ULV_GasTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_ULV_GasTurbine(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + @Override + public int getCapacity() { + return 16000; + } + + @Override + public void onConfigLoad() { + this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, 95); + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java new file mode 100644 index 0000000000..f4d7a33689 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java @@ -0,0 +1,39 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.common.tileentities.generators.GT_MetaTileEntity_SteamTurbine; +import net.minecraftforge.fluids.FluidStack; + +public class GT_MetaTileEntity_ULV_SteamTurbine extends GT_MetaTileEntity_SteamTurbine { + public GT_MetaTileEntity_ULV_SteamTurbine(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier); + } + + public GT_MetaTileEntity_ULV_SteamTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_ULV_SteamTurbine(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + @Override + public int getCapacity() { + return 16000; + } + + @Override + public void onConfigLoad() { + this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + 1); + } +} 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 new file mode 100644 index 0000000000..60c508a2b1 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java @@ -0,0 +1,249 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase { + + + public static int CASING_TEXTURE_ID; + public static String mHotFuelName = "Blazing Pyrotheum"; + public static String mCasingName = "Advanced Blast Furnace Casing"; + + private int mHeatingCapacity = 0; + private int controllerY; + private FluidStack[] pollutionFluidStacks = new FluidStack[]{Materials.CarbonDioxide.getGas(1000), + Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000)}; + + public GregtechMetaTileEntity_Adv_EBF(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10); + mHotFuelName = FluidUtils.getFluidStack("pyrotheum", 1).getLocalizedName(); + mCasingName = GregtechItemList.Casing_AdvancedVacuum.get(1).getDisplayName(); + } + + public GregtechMetaTileEntity_Adv_EBF(String aName) { + super(aName); + CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10); + mHotFuelName = FluidUtils.getFluidStack("pyrotheum", 1).getLocalizedName(); + mCasingName = GregtechItemList.Casing_AdvancedVacuum.get(1).getDisplayName(); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_Adv_EBF(this.mName); + } + + public String[] getDescription() { + return new String[]{ + "Controller Block for the Advanced Electric Blast Furnace", + "Consumes 1L of "+mHotFuelName+"/t during operation", + "Size(WxHxD): 3x4x3 (Hollow), Controller (Front middle bottom)", + "16x Heating Coils (Two middle Layers, hollow)", + "1x Input Hatch/Bus (Any bottom layer casing)", + "1x Output Hatch/Bus (Any bottom layer casing)", + "1x Energy Hatch (Any bottom layer casing)", + "1x Maintenance Hatch (Any bottom layer casing)", + "1x Muffler Hatch (Top middle)", + "1x Output Hatch to recover CO2/CO/SO2 (optional, any top layer casing),", + " Recovery scales with Muffler Hatch tier", + mCasingName+"s for the rest", + "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%", + "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[11], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[11]}; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sBlastRecipes; + } + + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; + } + + public boolean checkRecipe(ItemStack aStack) { + return checkRecipeGeneric(4, 100, 100); //Will have to clone the logic from parent class to handle heating coil tiers. + } + + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + controllerY = aBaseMetaTileEntity.getYCoord(); + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + + this.mHeatingCapacity = 0; + if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) { + return false; + } + if (!aBaseMetaTileEntity.getAirOffset(xDir, 2, zDir)) { + return false; + } + if (!addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 3, zDir), 11)) { + return false; + } + byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir); + switch (tUsedMeta) { + case 0: + this.mHeatingCapacity = 1800; + break; + case 1: + this.mHeatingCapacity = 2700; + break; + case 2: + this.mHeatingCapacity = 3600; + break; + case 3: + this.mHeatingCapacity = 4500; + break; + case 4: + this.mHeatingCapacity = 5400; + break; + case 5: + this.mHeatingCapacity = 7200; + break; + case 6: + this.mHeatingCapacity = 9001; + break; + default: + return false; + } + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if ((i != 0) || (j != 0)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != GregTech_API.sBlockCasings5) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != tUsedMeta) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != GregTech_API.sBlockCasings5) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != tUsedMeta) { + return false; + } + if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j), 11)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != GregTech_API.sBlockCasings1) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 11) { + return false; + } + } + } + } + } + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if ((xDir + i != 0) || (zDir + j != 0)) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j); + if ((!addMaintenanceToMachineList(tTileEntity, 11)) && (!addInputToMachineList(tTileEntity, 11)) && (!addOutputToMachineList(tTileEntity, 11)) && (!addEnergyInputToMachineList(tTileEntity, 11))) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings1) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 11) { + return false; + } + } + } + } + } + return true; + } + + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) { + return 50; + } + + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + @Override + public boolean addOutput(FluidStack aLiquid) { + if (aLiquid == null) return false; + int targetHeight; + FluidStack tLiquid = aLiquid.copy(); + boolean isOutputPollution = false; + for (FluidStack pollutionFluidStack : pollutionFluidStacks) { + if (tLiquid.isFluidEqual(pollutionFluidStack)) { + isOutputPollution = true; + break; + } + } + if (isOutputPollution) { + targetHeight = this.controllerY + 3; + int pollutionReduction = 0; + for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { + if (isValidMetaTileEntity(tHatch)) { + pollutionReduction = 100 - tHatch.calculatePollutionReduction(100); + break; + } + } + tLiquid.amount = tLiquid.amount * (pollutionReduction + 5) / 100; + } else { + targetHeight = this.controllerY; + } + for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { + if (isValidMetaTileEntity(tHatch) && GT_ModHandler.isSteam(aLiquid) ? tHatch.outputsSteam() : tHatch.outputsLiquids()) { + if (tHatch.getBaseMetaTileEntity().getYCoord() == targetHeight) { + int tAmount = tHatch.fill(tLiquid, false); + if (tAmount >= tLiquid.amount) { + return tHatch.fill(tLiquid, true) >= tLiquid.amount; + } else if (tAmount > 0) { + tLiquid.amount = tLiquid.amount - tHatch.fill(tLiquid, true); + } + } + } + } + return false; + } + + @Override + public boolean hasSlotInGUI() { + // TODO Auto-generated method stub + return false; + } + +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java new file mode 100644 index 0000000000..e5b690b7a5 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java @@ -0,0 +1,77 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_FusionComputer; + +import net.minecraft.block.Block; + +public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_FusionComputer { + + public GregtechMetaTileEntity_Adv_Fusion_MK4(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 6); + } + + public GregtechMetaTileEntity_Adv_Fusion_MK4(String aName) { + super(aName); + } + + @Override + public int tier() { + return 9; + } + + @Override + public long maxEUStore() { + return 640010000L * (Math.min(16, this.mEnergyHatches.size())) / 8L; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_Adv_Fusion_MK4(mName); + } + + @Override + public int getCasingMeta() { + return 8; + } + + @Override + public Block getFusionCoil() { + return GregTech_API.sBlockCasings4; + } + + @Override + public int getFusionCoilMeta() { + return 7; + } + + public String[] getDescription() { + return new String[]{ + "HARNESSING THE POWER OF A NEUTRON STAR", + "Fusion Machine Casings MK III around Advanced Fusion Coil Blocks", + "2-16 Input Hatches", + "1-16 Output Hatches", + "1-16 Energy Hatches", + "All Hatches must be UV or better", + "32768 EU/t and 80mio EU Cap per Energy Hatch"}; + } + + @Override + public int tierOverclock() { + return 6; + } + + @Override + public Block getCasing() { + return GregTech_API.sBlockCasings4; + } + + @Override + public IIconContainer getIconOverlay() { + return Textures.BlockIcons.OVERLAY_FUSION3; + } +} 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 new file mode 100644 index 0000000000..fd63e7a356 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java @@ -0,0 +1,135 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; + +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + +import static gregtech.api.GregTech_API.sBlockCasings4; + +public class GregtechMetaTileEntity_Adv_Implosion + extends GregtechMeta_MultiBlockBase { + + private String mCasingName = "Robust Tungstensteel Machine Casing"; + public GregtechMetaTileEntity_Adv_Implosion(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + mCasingName = ItemList.Casing_RobustTungstenSteel.get(1).getDisplayName(); + } + + public GregtechMetaTileEntity_Adv_Implosion(String aName) { + super(aName); + mCasingName = ItemList.Casing_RobustTungstenSteel.get(1).getDisplayName(); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_Adv_Implosion(this.mName); + } + + public String[] getDescription() { + return new String[]{ + "Controller Block for the Advanced Implosion Compressor", + "Size(WxHxD): 3x3x3 (Hollow), Controller (Front centered)", + "1x Input Bus (Any casing)", + "1x Output Bus (Any casing)", + "1x Maintenance Hatch (Any casing)", + "1x Muffler Hatch (Any casing)", + "1x Energy Hatch (Any casing)", + mCasingName+"s for the rest (16 at least!)", + "Causes " + 20 * getPollutionPerTick(null) + " Pollution per second"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[48], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_IMPLOSION_COMPRESSOR)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[48]}; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ImplosionCompressor.png"); + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sImplosionRecipes; + } + + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; + } + + public boolean checkRecipe(final ItemStack aStack) { + return checkRecipeGeneric((GT_Utility.getTier(this.getMaxInputVoltage())/2+1), 100, 100); + } + + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 20) { + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(5)), 10, 1.0F, aX, aY, aZ); + } + } + + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) { + return false; + } + int tAmount = 0; + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + for (int h = -1; h < 2; h++) { + if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); + if ((!addMaintenanceToMachineList(tTileEntity, 48)) && (!addMufflerToMachineList(tTileEntity, 48)) && (!addInputToMachineList(tTileEntity, 48)) && (!addOutputToMachineList(tTileEntity, 48)) && (!addEnergyInputToMachineList(tTileEntity, 48))) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j); + byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); + if ((tBlock != sBlockCasings4) || (tMeta != 0)) { + return false; + } + tAmount++; + } + } + } + } + } + return tAmount >= 16; + } + + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) { + return 250; + } + + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + @Override + public boolean hasSlotInGUI() { + return true; + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV new file mode 100644 index 0000000000..d063d85b1f --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV @@ -0,0 +1,15 @@ + + +public class GregtechGeneratorsULV { + public static void run(){ + + GregtechItemList.Generator_Diesel_ULV.set(new GT_MetaTileEntity_ULV_CombustionGenerator(960, "basicgenerator.diesel.tier.00", "Simple Combustion Generator", 0).getStackForm(1L)); + GregtechItemList.Generator_Gas_Turbine_ULV.set(new GT_MetaTileEntity_ULV_GasTurbine(961, "basicgenerator.gas.tier.00", "Simple Gas Turbine", 0).getStackForm(1L)); + GregtechItemList.Generator_Steam_Turbine_ULV.set(new GT_MetaTileEntity_ULV_SteamTurbine(962, "basicgenerator.steam.tier.00", "Simple Steam Turbine", 0).getStackForm(1L)); + + GT_ModHandler.addCraftingRecipe(GregtechItemList.Generator_Diesel_ULV.get(1L, new Object[0]), bitsd, new Object[]{"PCP", "EME", "GWG", 'M', ItemList.Hull_ULV, 'P', GregtechItemList.Electric_Piston_ULV, 'E', GregtechItemList.Electric_Motor_ULV, 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy), 'G', OrePrefixes.gearGt.get(Materials.Bronze)}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Generator_Gas_Turbine_ULV.get(1L, new Object[0]), bitsd, new Object[]{"CRC", "RMR", aTextMotorWire, 'M', ItemList.Hull_ULV, 'E', GregtechItemList.Electric_Motor_ULV, 'R', OrePrefixes.rotor.get(Materials.Tin), 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy)}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Generator_Steam_Turbine_ULV.get(1L, new Object[0]), bitsd, new Object[]{"PCP", "RMR", aTextMotorWire, 'M', ItemList.Hull_ULV, 'E', GregtechItemList.Electric_Motor_ULV, 'R', OrePrefixes.rotor.get(Materials.Tin), 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy), 'P', OrePrefixes.pipeMedium.get(Materials.Copper)}); + + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV.java new file mode 100644 index 0000000000..1663c9ada4 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV.java @@ -0,0 +1,26 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV.GT_MetaTileEntity_ULV_CombustionGenerator; +import gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV.GT_MetaTileEntity_ULV_GasTurbine; +import gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV.GT_MetaTileEntity_ULV_SteamTurbine; + +import static gtPlusPlus.core.recipe.common.CI.bitsd; + +public class GregtechGeneratorsULV { + public static void run(){ + + GregtechItemList.Generator_Diesel_ULV.set(new GT_MetaTileEntity_ULV_CombustionGenerator(960, "basicgenerator.diesel.tier.00", "Simple Combustion Generator", 0).getStackForm(1L)); + GregtechItemList.Generator_Gas_Turbine_ULV.set(new GT_MetaTileEntity_ULV_GasTurbine(961, "basicgenerator.gas.tier.00", "Simple Gas Turbine", 0).getStackForm(1L)); + GregtechItemList.Generator_Steam_Turbine_ULV.set(new GT_MetaTileEntity_ULV_SteamTurbine(962, "basicgenerator.steam.tier.00", "Simple Steam Turbine", 0).getStackForm(1L)); + + GT_ModHandler.addCraftingRecipe(GregtechItemList.Generator_Diesel_ULV.get(1L, new Object[0]), bitsd, new Object[]{"PCP", "EME", "GWG", 'M', ItemList.Hull_ULV, 'P', GregtechItemList.Electric_Piston_ULV, 'E', GregtechItemList.Electric_Motor_ULV, 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy), 'G', OrePrefixes.gearGt.get(Materials.Bronze)}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Generator_Gas_Turbine_ULV.get(1L, new Object[0]), bitsd, new Object[]{"CRC", "RMR", "EWE", 'M', ItemList.Hull_ULV, 'E', GregtechItemList.Electric_Motor_ULV, 'R', OrePrefixes.rotor.get(Materials.Tin), 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy)}); + GT_ModHandler.addCraftingRecipe(GregtechItemList.Generator_Steam_Turbine_ULV.get(1L, new Object[0]), bitsd, new Object[]{"PCP", "RMR", "EWE", 'M', ItemList.Hull_ULV, 'E', GregtechItemList.Electric_Motor_ULV, 'R', OrePrefixes.rotor.get(Materials.Tin), 'C', OrePrefixes.circuit.get(Materials.Primitive), 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy), 'P', OrePrefixes.pipeMedium.get(Materials.Copper)}); + + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCryogenicFreezer.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCryogenicFreezer.java index f3c52f98c9..07ec16c422 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCryogenicFreezer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCryogenicFreezer.java @@ -3,18 +3,27 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialVacuumFreezer; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_EBF; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_Fusion_MK4; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_Implosion; public class GregtechIndustrialCryogenicFreezer { public static void run() { if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { - Logger.INFO("Gregtech5u Content | Registering Industrial Freezer Multiblock."); run1(); - } - + } } private static void run1() { - GregtechItemList.Industrial_Cryogenic_Freezer.set(new GregtechMetaTileEntity_IndustrialVacuumFreezer(910, "industrialfreezer.controller.tier.single", "Advanced Cryogenic Freezer").getStackForm(1L)); + // Gregtech 4 Multiblock Auto-Crafter + 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] Advanced Blast Furnace").getStackForm(1L)); + GregtechItemList.Machine_Adv_ImplosionCompressor.set(new GregtechMetaTileEntity_Adv_Implosion(964, "multimachine.adv.implosioncompressor", "[Factory Grade] Advanced Implosion Compressor").getStackForm(1L)); + GregtechItemList.Industrial_Cryogenic_Freezer.set(new GregtechMetaTileEntity_IndustrialVacuumFreezer(910, "industrialfreezer.controller.tier.single", "Advanced Cryogenic Freezer").getStackForm(1L)); + GregtechItemList.FusionComputer_UV2.set(new GregtechMetaTileEntity_Adv_Fusion_MK4(965, "fusioncomputer.tier.09", "FusionTek MK IV").getStackForm(1L)); + + } + } |