From cb9f0c4abfe54ef509165b13881cbd511ce946bb Mon Sep 17 00:00:00 2001 From: Alkalus Date: Wed, 15 Nov 2017 00:50:31 +1000 Subject: + Added 3 alternative recipes for obtaining Zirconium. (Sifting Tin/Cassiterite & Electromagnetic separation of Bauxite.) --- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 427eb19c9a..7f0bc7a8ca 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -52,6 +52,8 @@ public class RECIPES_GREGTECH { cyclotronRecipes(); blastSmelterRecipes(); advancedMixerRecipes(); + sifterRecipes(); + electroMagneticSeperatorRecipes(); addFuels(); } @@ -956,6 +958,49 @@ public class RECIPES_GREGTECH { 500*20); } + private static void sifterRecipes() { + //Zirconium + GT_Values.RA.addSifterRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedTin", 1), + new ItemStack[]{ + ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZinc", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1) + }, + new int[]{10000, 5000, 1500, 1000, 500, 500}, + 20*30, + 60); + + //Zirconium + GT_Values.RA.addSifterRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedCassiterite", 1), + new ItemStack[]{ + ItemUtils.getItemStackOfAmountFromOreDict("dustCassiterite", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyTin", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1) + }, + new int[]{10000, 5000, 1500, 1000, 500, 500}, + 20*30, + 60); + } + + private static void electroMagneticSeperatorRecipes(){ + GT_Values.RA.addElectromagneticSeparatorRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedBauxite", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustBauxite", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustSmallRutile", 1), + ItemUtils.getItemStackOfAmountFromOreDict("nuggetZirconium", 1), + new int[]{10000, 2500, 4000}, + 20*20, + 24); + } + private static void advancedMixerRecipes(){ //HgBa2Ca2Cu3O8 CORE.RA.addMixerRecipe( -- cgit From af9369d63b91b26515a45f7a3419c98e4d6f8f05 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Thu, 16 Nov 2017 17:50:23 +1000 Subject: + Added recipes for Wireless Chargers. $ Fixed exploit using Long-Range mode, temporarily disabled. --- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 47 ++++++++++++++++++ .../gregtech/common/helpers/ChargingHelper.java | 56 +++++++++++----------- .../basic/GregtechMetaWirelessCharger.java | 9 ++-- 3 files changed, 80 insertions(+), 32 deletions(-) (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 124e109f25..a8a4e5ad13 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -1053,6 +1053,53 @@ public class RECIPES_Machines { "plateStainlessSteel",CI.emitter_ULV,"plateStainlessSteel", ItemUtils.getSimpleStack(ModBlocks.blockProjectTable)); } + + //Wireless Chargers + RecipeUtils.addShapedGregtechRecipe( + CI.emitter_LV, CI.circuitTier1, CI.emitter_LV, + CI.component_Plate[3], CI.machineHull_LV, CI.component_Plate[3], + CI.sensor_LV, CI.fieldGenerator_LV, CI.sensor_LV, + GregtechItemList.Charger_LV.get(1)); + RecipeUtils.addShapedGregtechRecipe( + CI.emitter_MV, CI.circuitTier2, CI.emitter_MV, + CI.component_Plate[4], CI.machineHull_MV, CI.component_Plate[4], + CI.sensor_MV, CI.fieldGenerator_MV, CI.sensor_MV, + GregtechItemList.Charger_MV.get(1)); + RecipeUtils.addShapedGregtechRecipe( + CI.emitter_HV, CI.circuitTier3, CI.emitter_HV, + CI.component_Plate[5], CI.machineHull_HV, CI.component_Plate[5], + CI.sensor_HV, CI.fieldGenerator_HV, CI.sensor_HV, + GregtechItemList.Charger_HV.get(1)); + RecipeUtils.addShapedGregtechRecipe( + CI.emitter_EV, CI.circuitTier4, CI.emitter_EV, + CI.component_Plate[6], CI.machineHull_EV, CI.component_Plate[6], + CI.sensor_EV, CI.fieldGenerator_EV, CI.sensor_EV, + GregtechItemList.Charger_EV.get(1)); + RecipeUtils.addShapedGregtechRecipe( + CI.emitter_IV, CI.circuitTier5, CI.emitter_IV, + CI.component_Plate[7], CI.machineHull_IV, CI.component_Plate[7], + CI.sensor_IV, CI.fieldGenerator_IV, CI.sensor_IV, + GregtechItemList.Charger_IV.get(1)); + RecipeUtils.addShapedGregtechRecipe( + CI.emitter_LuV, CI.circuitTier6, CI.emitter_LuV, + CI.component_Plate[8], CI.machineHull_LuV, CI.component_Plate[8], + CI.sensor_LuV, CI.fieldGenerator_LuV, CI.sensor_LuV, + GregtechItemList.Charger_LuV.get(1)); + RecipeUtils.addShapedGregtechRecipe( + CI.emitter_ZPM, CI.circuitTier7, CI.emitter_ZPM, + CI.component_Plate[9], CI.machineHull_ZPM, CI.component_Plate[9], + CI.sensor_ZPM, CI.fieldGenerator_ZPM, CI.sensor_ZPM, + GregtechItemList.Charger_ZPM.get(1)); + RecipeUtils.addShapedGregtechRecipe( + CI.emitter_UV, CI.circuitTier8, CI.emitter_UV, + CI.component_Plate[10], CI.machineHull_UV, CI.component_Plate[10], + CI.sensor_UV, CI.fieldGenerator_UV, CI.sensor_UV, + GregtechItemList.Charger_UV.get(1)); + RecipeUtils.addShapedGregtechRecipe( + CI.emitter_MAX, CI.circuitTier9, CI.emitter_MAX, + CI.component_Plate[11], CI.machineHull_MAX, CI.component_Plate[11], + CI.sensor_MAX, CI.fieldGenerator_MAX, CI.sensor_MAX, + GregtechItemList.Charger_MAX.get(1)); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java index 4a59a621f7..6ff0536c85 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java @@ -42,10 +42,10 @@ public class ChargingHelper { if (mPlayerMan != null){ - //Utils.LOG_INFO("Found Player."); + //Utils.LOG_WARNING("Found Player."); if (Utils.isServer()){ - //Utils.LOG_INFO("Found Server-Side."); + //Utils.LOG_WARNING("Found Server-Side."); mTickTimer++; if (mTickTimer % mTickMultiplier == 0){ @@ -73,10 +73,10 @@ public class ChargingHelper { long mEuUsed = 0; if (mEntityTemp.getMode() == 0){ - if (!LR.isEmpty() && LR.containsKey(mPlayerMan)){ + /*if (!LR.isEmpty() && LR.containsKey(mPlayerMan)){ mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan); mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan); - } + }*/ } else if (mEntityTemp.getMode() == 1){ if (!LO.isEmpty() && LO.containsValue(mPlayerMan)){ @@ -85,10 +85,10 @@ public class ChargingHelper { } } else { - if (!LR.isEmpty() && LR.containsKey(mPlayerMan)){ + /*if (!LR.isEmpty() && LR.containsKey(mPlayerMan)){ mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan); mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan); - } + }*/ if (!LO.isEmpty() && LO.containsValue(mPlayerMan)){ mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan); mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan); @@ -130,7 +130,7 @@ public class ChargingHelper { } catch (Throwable t){ - //Utils.LOG_INFO("State of Wireless Charger changed in an invalid way, this prevented a crash."); + //Utils.LOG_WARNING("State of Wireless Charger changed in an invalid way, this prevented a crash."); if (!mChargerMap.isEmpty()){ for (GregtechMetaWirelessCharger r : mChargerMap.values()){ @@ -183,20 +183,20 @@ public class ChargingHelper { if (mEntity == null){ return false; } - Utils.LOG_INFO("trying to map new player"); + Utils.LOG_WARNING("trying to map new player"); if (mValidPlayers.containsKey(mPlayer)){ - Utils.LOG_INFO("Key contains player already?"); + Utils.LOG_WARNING("Key contains player already?"); return false; } else { - Utils.LOG_INFO("key not found, adding"); + Utils.LOG_WARNING("key not found, adding"); Pair mEntry = new Pair(mEntity, (byte) mEntity.getMode()); if (mValidPlayers.put(mPlayer, mEntry) == null){ - Utils.LOG_INFO("Added a Player to the Tick Map."); + Utils.LOG_WARNING("Added a Player to the Tick Map."); return true; } else { - Utils.LOG_INFO("Tried to add player but it was already there?"); + Utils.LOG_WARNING("Tried to add player but it was already there?"); return false; } } @@ -206,21 +206,21 @@ public class ChargingHelper { if (mEntity == null){ return false; } - Utils.LOG_INFO("trying to remove player from map"); + Utils.LOG_WARNING("trying to remove player from map"); if (mValidPlayers.containsKey(mPlayer)){ - Utils.LOG_INFO("key found, removing"); + Utils.LOG_WARNING("key found, removing"); Pair mEntry = new Pair(mEntity, (byte) mEntity.getMode()); if (mValidPlayers.remove(mPlayer, mEntry)){ - Utils.LOG_INFO("Removed a Player to the Tick Map."); + Utils.LOG_WARNING("Removed a Player to the Tick Map."); return true; } else { - Utils.LOG_INFO("Tried to remove player but it was not there?"); + Utils.LOG_WARNING("Tried to remove player but it was not there?"); return false; } } else { - Utils.LOG_INFO("Key does not contain player?"); + Utils.LOG_WARNING("Key does not contain player?"); return false; } } @@ -267,17 +267,17 @@ public class ChargingHelper { for (ItemStack mTemp : mItems){ mItemSlot++; if (mTemp != null){ - Utils.LOG_INFO("Slot "+mItemSlot+" contains "+mTemp.getDisplayName()); + Utils.LOG_WARNING("Slot "+mItemSlot+" contains "+mTemp.getDisplayName()); } //Is item Electrical if (isItemValid(mTemp)){ - Utils.LOG_INFO("1"); + Utils.LOG_WARNING("1"); //Transfer Limit double mItemEuTLimit = ((IElectricItem) mTemp.getItem()).getTransferLimit(mTemp); //Check if Tile has more or equal EU to what can be transferred into the item. if (mEuStored >= mItemEuTLimit){ - Utils.LOG_INFO("2"); + Utils.LOG_WARNING("2"); double mItemMaxCharge = ((IElectricItem) mTemp.getItem()).getMaxCharge(mTemp); double mitemCurrentCharge = ElectricItem.manager.getCharge(mTemp); @@ -288,7 +288,7 @@ public class ChargingHelper { //Try get charge direct from NBT for GT and IC2 stacks try { - Utils.LOG_INFO("3"); + Utils.LOG_WARNING("3"); if (mTemp.getItem() instanceof GT_MetaGenerated_Tool_01 || mTemp.getItem() instanceof GT_MetaGenerated_Item_01 || mTemp.getItem() instanceof GT_MetaGenerated_Item_02 @@ -326,7 +326,7 @@ public class ChargingHelper { mVoltageIncrease = mItemEuTLimit; } - Utils.LOG_INFO("4"); + Utils.LOG_WARNING("4"); int mMulti; if ((mitemCurrentCharge + (mVoltageIncrease*20)) <= (mItemMaxCharge - (mVoltageIncrease*20))){ @@ -341,15 +341,15 @@ public class ChargingHelper { else { mMulti = 1; } - Utils.LOG_INFO("5"); + Utils.LOG_WARNING("5"); int mMultiVoltage = (int) (mMulti*mVoltageIncrease); if ((mitemCurrentCharge + mMultiVoltage) <= mItemMaxCharge){ - Utils.LOG_INFO("6"); + Utils.LOG_WARNING("6"); if (GT_ModHandler.chargeElectricItem(mTemp, mMultiVoltage, mTier, true, false) == 0){ - Utils.LOG_INFO("6.5"); + Utils.LOG_WARNING("6.5"); for (int i=0; i mitemCurrentCharge){ - Utils.LOG_INFO("7"); + Utils.LOG_WARNING("7"); mEntity.setEUVar((long) (mEuStored-(mVoltage*mMulti))); mEuStored = mEntity.getEUVar(); - Utils.LOG_INFO("Charged "+mTemp.getDisplayName()+" | Slot: "+mItemSlot+" | EU Multiplier: "+mMulti+" | EU/t input: "+mVoltageIncrease+" | EU/t consumed by Tile: "+mVoltage+" | Item Max Charge: "+mItemMaxCharge+" | Item Start Charge: "+mitemCurrentCharge+" | Item New Charge"+ElectricItem.manager.getCharge(mTemp)); + Utils.LOG_WARNING("Charged "+mTemp.getDisplayName()+" | Slot: "+mItemSlot+" | EU Multiplier: "+mMulti+" | EU/t input: "+mVoltageIncrease+" | EU/t consumed by Tile: "+mVoltage+" | Item Max Charge: "+mItemMaxCharge+" | Item Start Charge: "+mitemCurrentCharge+" | Item New Charge"+ElectricItem.manager.getCharge(mTemp)); mChargedItems++; } } @@ -370,7 +370,7 @@ public class ChargingHelper { } else { if (mTemp != null){ - Utils.LOG_INFO("Found Non-Valid item. "+mTemp.getDisplayName()); + Utils.LOG_WARNING("Found Non-Valid item. "+mTemp.getDisplayName()); } } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java index a2714c4bab..0bd3e6b3bd 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java @@ -45,6 +45,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { "Mixed: Provides both 2A of long range and 1A per player locally.", "Mixed mode is more conservative of power and as a result only", "gets half the distances each singular mode gets.", + "Long-Range mode currently disabled.", CORE.GT_Tooltip}; } @@ -158,7 +159,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { this.mMode++; } if (this.mMode == 0){ - PlayerUtils.messagePlayer(aPlayer, "Now in Long-Range Mode."); + PlayerUtils.messagePlayer(aPlayer, "Now in Long-Range Mode. [Disabled]"); } else if (this.mMode == 1){ PlayerUtils.messagePlayer(aPlayer, "Now in Local Charge Mode."); @@ -394,7 +395,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { } } } - if (this.mMode == 0 || this.mMode == 2){ + /*if (this.mMode == 0 || this.mMode == 2){ int tempRange = (int) (this.mMode == 0 ? 4*GT_Values.V[this.mTier] : 2*GT_Values.V[this.mTier]); if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) < tempRange){ if (!mWirelessChargingMap.containsKey(mTemp)){ @@ -411,7 +412,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { } } } - } + } */ } } @@ -487,7 +488,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { } else { - PlayerUtils.messagePlayer(aPlayer, "Long-range Mode: "+tempRange+"m"); + PlayerUtils.messagePlayer(aPlayer, "Long-range Mode: "+tempRange+"m [Disabled]"); } -- cgit From d7897d548e0d377df56a33b4be4a60717d97dd97 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Fri, 17 Nov 2017 01:20:46 +1000 Subject: + Added the Generator Array. --- src/Java/gregtech/api/util/Recipe_GT.java | 5 +- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 2 +- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 1 + .../xmod/gregtech/api/enums/GregtechItemList.java | 5 +- .../GregtechMetaTileEntityGeneratorArray.java | 236 +++++++++++++++++++++ .../gregtech/GregtechIndustrialGeneratorArray.java | 26 +++ .../registration/gregtech/GregtechRTG.java | 2 +- .../gregtech/GregtechWirelessChargers.java | 62 +++--- 8 files changed, 306 insertions(+), 33 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialGeneratorArray.java (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gregtech/api/util/Recipe_GT.java b/src/Java/gregtech/api/util/Recipe_GT.java index b63a259f9c..8c9ae25d95 100644 --- a/src/Java/gregtech/api/util/Recipe_GT.java +++ b/src/Java/gregtech/api/util/Recipe_GT.java @@ -239,10 +239,11 @@ public class Recipe_GT extends GT_Recipe{ public static final GT_Recipe_Map sMatterFab2Recipes = new GT_Recipe_Map(new HashSet(200), "gt.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, E, 1, E, true, true); //public static final Gregtech_Recipe_Map sMatterFabRecipes = new Gregtech_Recipe_Map(new HashSet(200), "gt.recipe.matterfab", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Massfabricator", 1, 3, 1, 1, 1, E, 1, E, true, true); public static final Gregtech_Recipe_Map_Fuel sRocketFuels = new Gregtech_Recipe_Map_Fuel(new HashSet(10), "gt.recipe.rocketenginefuel", "Rocket Engine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 3000, " EU", true, true); - public static final Gregtech_Recipe_Map_Fuel sGeoThermalFuels = new Gregtech_Recipe_Map_Fuel(new HashSet(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); + public static final GT_Recipe_Map sGeoThermalFuels = new GT_Recipe_Map(new HashSet(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); public static final GT_Recipe_Map sChemicalDehydratorRecipes = new GT_Recipe_Map(new HashSet(200), "gt.recipe.chemicaldehydrator", "Chemical Dehydrator", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 0, 0, 1, E, 1, E, true, true); public static final GT_Recipe_Map sAlloyBlastSmelterRecipes = new GT_Recipe_Map(new HashSet(200), "gt.recipe.alloyblastsmelter", "Alloy Blast Smelter", null, RES_PATH_GUI + "basicmachines/BlastSmelter", 9, 1, 1, 0, 1, E, 1, E, true, true); - + public static final GT_Recipe_Map sSteamTurbineFuels = new GT_Recipe_Map(new HashSet(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); + //LFTR recipes public static final GT_Recipe_Map sLiquidFluorineThoriumReactorRecipes = new GT_Recipe_Map(new HashSet(50), "gt.recipe.lftr", "Liquid Fluoride Thorium Reactor", null, RES_PATH_GUI + "basicmachines/LFTR", 0, 0, 0, 2, 1, "Start: ", 1, " EU", true, true); //Fission Fuel Plant Recipes diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 23b2ad8e1a..c59798ce21 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -6,7 +6,6 @@ import java.util.LinkedList; import java.util.Queue; import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.MultiblockRecipeMapHandler; import gtPlusPlus.core.common.compat.*; import gtPlusPlus.core.handler.Recipes.LateRegistrationHandler; import gtPlusPlus.core.handler.Recipes.RegistrationHandler; @@ -98,6 +97,7 @@ public class COMPAT_HANDLER { GregtechSemiFluidgenerators.run(); GregtechAdvancedMixer.run(); GregtechWirelessChargers.run(); + GregtechIndustrialGeneratorArray.run(); //New Horizons Content NewHorizonsAccelerator.run(); diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 7f0bc7a8ca..623e5651e5 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -704,6 +704,7 @@ public class RECIPES_GREGTECH { new int[]{}, 0);*/ + ThermalFuel.addSteamTurbineFuel(FluidUtils.getFluidStack("steam", 1024)); //CORE.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketRocket_fuel", 0, 1), null, 112, 0); GT_Values.RA.addFuel(ItemUtils.getSimpleStack(Items.lava_bucket), null, 32, 2); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 6a797d9ce0..7d413a9796 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -260,7 +260,10 @@ public enum GregtechItemList implements GregtechItemContainer { //Wireless Chargers Charger_LV, Charger_MV, Charger_HV, Charger_EV, Charger_IV, Charger_LuV, - Charger_ZPM, Charger_UV, Charger_MAX, + Charger_ZPM, Charger_UV, Charger_MAX, + + //Generator Array + Generator_Array_Controller, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java new file mode 100644 index 0000000000..e6c82e203b --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityGeneratorArray.java @@ -0,0 +1,236 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi; + +import gregtech.api.GregTech_API; +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_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.fluid.FluidUtils; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +public class GregtechMetaTileEntityGeneratorArray extends GT_MetaTileEntity_MultiBlockBase { + + GT_Recipe mLastRecipe; + + public GregtechMetaTileEntityGeneratorArray(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMetaTileEntityGeneratorArray(String aName) { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntityGeneratorArray(this.mName); + } + + public String[] getDescription() { + return new String[]{ + "Controller Block for the Generator Array", + "Runs supplied generators as if placed in the world", + "Size(WxHxD): 3x3x3 (Hollow), Controller (Front centered)", + "1x Input Hatch/Bus (Any casing)", + "1x Output Hatch/Bus (Any casing)", + "1x Maintenance Hatch (Any casing)", + "1x Energy Hatch (Any casing)", + "Robust Tungstensteel Machine Casings for the rest (16 at least!)", + "Place up to 16 Single Block GT Generators into the Controller Inventory"}; + } + + 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_PROCESSING_ARRAY_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY)}; + } + 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(), "ProcessingArray.png"); + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + if (mInventory[1] == null) return null; + String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt\\.blockmachines\\.basicgenerator\\.", ""); + if (tmp.startsWith("steamturbine")) { + return Gregtech_Recipe_Map.sSteamTurbineFuels; + } + else if (tmp.startsWith("diesel")) { + return GT_Recipe.GT_Recipe_Map.sDieselFuels; + } + else if (tmp.startsWith("gasturbine")) { + return GT_Recipe.GT_Recipe_Map.sTurbineFuels; + } + else if (tmp.startsWith("semifluid")) { + return GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels; + } + else if (tmp.startsWith("rtg")) { + return Gregtech_Recipe_Map.sRTGFuels; + } + + + tmp = mInventory[1].getUnlocalizedName().replaceAll("gt\\.blockmachines\\.advancedgenerator\\.", ""); + if (tmp.startsWith("rocket")) { + return GT_Recipe.GT_Recipe_Map.sDieselFuels; + } + else if (tmp.startsWith("geothermalFuel")) { + return Gregtech_Recipe_Map.sGeoThermalFuels; + } + + return null; + } + + public boolean isCorrectMachinePart(ItemStack aStack) { + if (aStack != null && aStack.getUnlocalizedName().startsWith("gt.blockmachines.")) { + return true; + } + return false; + } + + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; + } + + public String mMachine = ""; + public boolean checkRecipe(ItemStack aStack) { + if (!isCorrectMachinePart(mInventory[1])) { + return false; + } + GT_Recipe.GT_Recipe_Map map = getRecipeMap(); + if (map == null) return false; + ArrayList tInputList = getStoredInputs(); + int tTier = 0; + if (mInventory[1].getUnlocalizedName().endsWith("1")) { + tTier = 1; + }else if (mInventory[1].getUnlocalizedName().endsWith("2")) { + tTier = 2; + }else if (mInventory[1].getUnlocalizedName().endsWith("3")) { + tTier = 3; + }else if (mInventory[1].getUnlocalizedName().endsWith("4")) { + tTier = 4; + }else if (mInventory[1].getUnlocalizedName().endsWith("5")) { + tTier = 5; + }else if (mInventory[1].getUnlocalizedName().endsWith("6")) { + tTier = 6; + }else if (mInventory[1].getUnlocalizedName().endsWith("7")) { + tTier = 7; + }else if (mInventory[1].getUnlocalizedName().endsWith("8")) { + tTier = 8; + } + + int fuelConsumption = 0; + int fuelValue = 0; + int fuelRemaining = 0; + boolean boostEu = false; + + if(!mMachine.equals(mInventory[1].getUnlocalizedName()))mLastRecipe=null; + mMachine = mInventory[1].getUnlocalizedName(); + Utils.LOG_INFO("mMachine: "+mMachine); + ArrayList tFluids = getStoredFluids(); + Collection tRecipeList = this.getRecipeMap().mRecipeList; + Utils.LOG_INFO("tRecipeList: "+tRecipeList); + + if(tFluids.size() > 0 && tRecipeList != null) { //Does input hatch have a diesel fuel? + Utils.LOG_INFO("1"); + for (FluidStack hatchFluid1 : tFluids) { //Loops through hatches + Utils.LOG_INFO("2"); + for(GT_Recipe aFuel : tRecipeList) { //Loops through diesel fuel recipes + Utils.LOG_INFO("3"); + /*if (aFuel != null){ + for (FluidStack x : aFuel.mFluidInputs){ + if (x != null){ + Utils.LOG_INFO("Recipe: "+x.getLocalizedName()); + } + } + }*/ + FluidStack tLiquid; + tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], aFuel.mFluidInputs[0].amount); + Utils.LOG_INFO("5"); + fuelConsumption = aFuel.mFluidInputs[0].amount; + if(depleteInput(tLiquid)) { //Deplete that amount + Utils.LOG_INFO("6"); + boostEu = true; + Utils.LOG_INFO("7"); + + fuelValue = aFuel.mEUt*aFuel.mDuration; + fuelRemaining = hatchFluid1.amount; //Record available fuel + this.mEUt = mEfficiency < 2000 ? 0 : 2048; //Output 0 if startup is less than 20% + //this.mProgresstime = 1; + this.mMaxProgresstime = 20; + this.mEfficiencyIncrease = 9500; + Utils.LOG_INFO("9"); + return true; + } + } + // } + //} + } + } + this.mEUt = 0; + this.mEfficiency = 0; + return false; + } + + public static ItemStack[] clean(final ItemStack[] v) { + List list = new ArrayList(Arrays.asList(v)); + list.removeAll(Collections.singleton(null)); + return list.toArray(new ItemStack[list.size()]); + } + + 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)) && (!addInputToMachineList(tTileEntity, 48)) && (!addOutputToMachineList(tTileEntity, 48)) && (!addDynamoToMachineList(tTileEntity, 48))) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings4) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) { + return false; + } + tAmount++; + } + } + } + } + } + return tAmount >= 16; + } + + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialGeneratorArray.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialGeneratorArray.java new file mode 100644 index 0000000000..b0b91af528 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialGeneratorArray.java @@ -0,0 +1,26 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityGeneratorArray; + +public class GregtechIndustrialGeneratorArray { + + public static void run() { + if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { + Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Generator Array Multiblock."); + //if (CORE.configSwitches.enableMultiblock_IndustrialSifter) { // TODO + run1(); + //} + } + + } + + private static void run1() { + // Industrial Maceration Stack Multiblock + GregtechItemList.Generator_Array_Controller.set(new GregtechMetaTileEntityGeneratorArray( + 990, + "generatorarray.controller.tier.01", + "Large Generator Array").getStackForm(1L)); + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java index 4d3738f585..954f652b40 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java @@ -15,7 +15,7 @@ public class GregtechRTG { private static void run1() { GregtechItemList.RTG.set( - new GregtechMetaTileEntity_RTG(869, "rtg.01.tier.single", "Radioisotope Thermoelectric Generator", 3) + new GregtechMetaTileEntity_RTG(869, "basicgenerator.rtg.tier.01", "Radioisotope Thermoelectric Generator", 3) .getStackForm(1L)); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java index 688b522c2b..48d516e4cf 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java @@ -2,6 +2,7 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.util.GT_ModHandler; +import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.helpers.ChargingHelper; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaWirelessCharger; @@ -9,35 +10,40 @@ import net.minecraftforge.common.MinecraftForge; public class GregtechWirelessChargers { - + public static void run(){ - - long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED; - int mID = 890; - - FMLCommonHandler.instance().bus().register(new ChargingHelper()); - MinecraftForge.EVENT_BUS.register(new ChargingHelper()); - - GregtechItemList.Charger_LV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.01.tier.single", - "Wireless Charger MK I", 1, "Hopefully won't give you cancer.", 0).getStackForm(1L)); - GregtechItemList.Charger_MV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.02.tier.single", - "Wireless Charger MK II", 2, "Hopefully won't give you cancer.", 0).getStackForm(1L)); - GregtechItemList.Charger_HV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.03.tier.single", - "Wireless Charger MK III", 3, "Hopefully won't give you cancer.", 0).getStackForm(1L)); - GregtechItemList.Charger_EV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.04.tier.single", - "Wireless Charger MK IV", 4, "Hopefully won't give you cancer.", 0).getStackForm(1L)); - GregtechItemList.Charger_IV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.05.tier.single", - "Wireless Charger MK V", 5, "Hopefully won't give you cancer.", 0).getStackForm(1L)); - GregtechItemList.Charger_LuV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.06.tier.single", - "Wireless Charger MK VI", 6, "Hopefully won't give you cancer.", 0).getStackForm(1L)); - GregtechItemList.Charger_ZPM.set(new GregtechMetaWirelessCharger(mID++, "wificharger.07.tier.single", - "Wireless Charger MK VII", 7, "Hopefully won't give you cancer.", 0).getStackForm(1L)); - GregtechItemList.Charger_UV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.08.tier.single", - "Wireless Charger MK VIII", 8, "Hopefully won't give you cancer.", 0).getStackForm(1L)); - GregtechItemList.Charger_MAX.set(new GregtechMetaWirelessCharger(mID++, "wificharger.09.tier.single", - "Wireless Charger MK IX", 9, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { + Utils.LOG_INFO("Gregtech5u Content | Registering Wireless Chargers."); + + + long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED; + int mID = 890; + + FMLCommonHandler.instance().bus().register(new ChargingHelper()); + MinecraftForge.EVENT_BUS.register(new ChargingHelper()); + + GregtechItemList.Charger_LV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.01.tier.single", + "Wireless Charger MK I", 1, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_MV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.02.tier.single", + "Wireless Charger MK II", 2, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_HV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.03.tier.single", + "Wireless Charger MK III", 3, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_EV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.04.tier.single", + "Wireless Charger MK IV", 4, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_IV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.05.tier.single", + "Wireless Charger MK V", 5, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_LuV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.06.tier.single", + "Wireless Charger MK VI", 6, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_ZPM.set(new GregtechMetaWirelessCharger(mID++, "wificharger.07.tier.single", + "Wireless Charger MK VII", 7, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_UV.set(new GregtechMetaWirelessCharger(mID++, "wificharger.08.tier.single", + "Wireless Charger MK VIII", 8, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + GregtechItemList.Charger_MAX.set(new GregtechMetaWirelessCharger(mID++, "wificharger.09.tier.single", + "Wireless Charger MK IX", 9, "Hopefully won't give you cancer.", 0).getStackForm(1L)); + + } } - + } -- cgit From 3a7576cc5a52ce052c1bc40ddb7dbcb63e2a6381 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Mon, 20 Nov 2017 17:11:11 +1000 Subject: + Added recipe for Wither Cage. --- src/Java/gtPlusPlus/core/recipe/RECIPES_General.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java index 67b9107b28..e9a2ee86b4 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -139,6 +139,12 @@ public class RECIPES_General { new ItemStack(ModItems.itemAlkalusDisk, 1, OreDictionary.WILDCARD_VALUE)); l++; } + + RecipeUtils.addShapedGregtechRecipe( + "stickBlackSteel", "plateTungstenSteel", "stickBlackSteel", + "plateTungstenSteel", "blockIron", "plateTungstenSteel", + "stickBlackSteel", "plateTungstenSteel", "stickBlackSteel", + ItemUtils.getSimpleStack(ModBlocks.blockWitherGuard)); //Alkalus Coin /*AddGregtechRecipe.addAssemblylineRecipe( -- cgit From e480daed410bd80d5eda9abbd37f7bd96021e911 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Mon, 20 Nov 2017 20:19:10 +1000 Subject: $ Fixed the Upgraded Alchemical Furnace being built from heavily obfuscated code. % Adjusted Wither Guard recipe to now output 32x per craft, at the added cost of a Netherstar per craft. % Small formatting changes. --- src/Java/gtPlusPlus/core/handler/GuiHandler.java | 24 +- .../gtPlusPlus/core/recipe/RECIPES_General.java | 41 +-- src/Java/gtPlusPlus/core/util/item/ItemUtils.java | 45 +-- .../common/block/BlockFastAlchemyFurnace.java | 254 +++++++++++--- .../common/tile/TileFastAlchemyFurnace.java | 388 +++++++++++---------- 5 files changed, 461 insertions(+), 291 deletions(-) (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/handler/GuiHandler.java b/src/Java/gtPlusPlus/core/handler/GuiHandler.java index 124b01a2c0..6791289f9f 100644 --- a/src/Java/gtPlusPlus/core/handler/GuiHandler.java +++ b/src/Java/gtPlusPlus/core/handler/GuiHandler.java @@ -3,12 +3,24 @@ package gtPlusPlus.core.handler; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; import gtPlusPlus.GTplusplus; -import gtPlusPlus.core.container.*; +import gtPlusPlus.core.container.Container_BackpackBase; +import gtPlusPlus.core.container.Container_FishTrap; +import gtPlusPlus.core.container.Container_Grindle; +import gtPlusPlus.core.container.Container_ModularityTable; +import gtPlusPlus.core.container.Container_ProjectTable; +import gtPlusPlus.core.container.Container_TradeTable; +import gtPlusPlus.core.container.Container_Workbench; +import gtPlusPlus.core.container.Container_WorkbenchAdvanced; import gtPlusPlus.core.gui.beta.Gui_ID_Registry; import gtPlusPlus.core.gui.beta.MU_GuiId; import gtPlusPlus.core.gui.item.GuiBaseBackpack; import gtPlusPlus.core.gui.item.GuiBaseGrindle; -import gtPlusPlus.core.gui.machine.*; +import gtPlusPlus.core.gui.machine.GUI_FishTrap; +import gtPlusPlus.core.gui.machine.GUI_ModularityTable; +import gtPlusPlus.core.gui.machine.GUI_ProjectTable; +import gtPlusPlus.core.gui.machine.GUI_TradeTable; +import gtPlusPlus.core.gui.machine.GUI_Workbench; +import gtPlusPlus.core.gui.machine.GUI_WorkbenchAdvanced; import gtPlusPlus.core.interfaces.IGuiManager; import gtPlusPlus.core.inventories.BaseInventoryBackpack; import gtPlusPlus.core.inventories.BaseInventoryGrindle; @@ -34,8 +46,8 @@ public class GuiHandler implements IGuiHandler { public static final int GUI5 = 4; //Workbench Adv public static final int GUI6 = 5; //Fish trap public static final int GUI7 = 6; //Trade table - public static final int GUI8 = 7; // - public static final int GUI9 = 8; // + public static final int GUI8 = 7; //Alchemical Furnace + public static final int GUI9 = 8; //Grindle @@ -83,7 +95,7 @@ public class GuiHandler implements IGuiHandler { return new Container_TradeTable(player.inventory, (TileEntityTradeTable)te); } } - + if (ID == GUI9){ return new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem())); } @@ -132,7 +144,7 @@ public class GuiHandler implements IGuiHandler { return new GUI_TradeTable(player.inventory, (TileEntityTradeTable)te, ((TileEntityBase) te).getOwner()); } } - + if (ID == GUI9){ return new GuiBaseGrindle(new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem()))); } diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java index e9a2ee86b4..f5f793da77 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -1,28 +1,19 @@ package gtPlusPlus.core.recipe; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.recipe.RecipeUtils; -import gtPlusPlus.core.util.reflect.AddGregtechRecipe; -import gtPlusPlus.core.world.darkworld.Dimension_DarkWorld; import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; public class RECIPES_General { @@ -102,18 +93,18 @@ public class RECIPES_General { "stickWood", "treeSapling", "stickWood", "stickWood", "dustBone", "stickWood", ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Rainforest))){ - Utils.LOG_INFO("Added a recipe for Rainforest oak Saplings."); + Utils.LOG_INFO("Added a recipe for Rainforest oak Saplings."); } //Iron bars - ItemStack ironBars = ItemUtils.getItemStack("minecraft:iron_bars", 1); + final ItemStack ironBars = ItemUtils.getItemStack("minecraft:iron_bars", 1); //Fish Trap if (RecipeUtils.recipeBuilder( ironBars, ironBars, ironBars, ironBars, "frameGtWroughtIron", ironBars, ironBars, ironBars, ironBars, ItemUtils.getSimpleStack(ModBlocks.blockFishTrap))){ - Utils.LOG_INFO("Added a recipe for the Fish Trap."); + Utils.LOG_INFO("Added a recipe for the Fish Trap."); } //Alkalus Coin @@ -122,31 +113,31 @@ public class RECIPES_General { "gemFlawlessRuby", ItemList.Credit_Greg_Naquadah.get(1), "gemFlawlessSapphire", "gemExquisiteEmerald", "gemFlawlessEmerald", "gemExquisiteSapphire", ItemUtils.getSimpleStack(ModItems.itemAlkalusDisk))){ - Utils.LOG_INFO("Added a recipe for The Alkalus Disk."); + Utils.LOG_INFO("Added a recipe for The Alkalus Disk."); } - String fancyGems[] = new String[]{"gemExquisiteDiamond", "gemExquisiteEmerald", "gemExquisiteRuby", "gemExquisiteSapphire"}; - ItemStack gemShards[] = new ItemStack[]{ItemUtils.simpleMetaStack(ModItems.itemGemShards, 0, 1), + final String fancyGems[] = new String[]{"gemExquisiteDiamond", "gemExquisiteEmerald", "gemExquisiteRuby", "gemExquisiteSapphire"}; + final ItemStack gemShards[] = new ItemStack[]{ItemUtils.simpleMetaStack(ModItems.itemGemShards, 0, 1), ItemUtils.simpleMetaStack(ModItems.itemGemShards, 1, 1), ItemUtils.simpleMetaStack(ModItems.itemGemShards, 2, 1), ItemUtils.simpleMetaStack(ModItems.itemGemShards, 3, 1)}; - + int l=0; - for (String gem : fancyGems){ + for (final String gem : fancyGems){ GameRegistry.addShapelessRecipe( gemShards[l], ItemUtils.getItemStackOfAmountFromOreDict(gem, 1), new ItemStack(ModItems.itemAlkalusDisk, 1, OreDictionary.WILDCARD_VALUE)); l++; } - + RecipeUtils.addShapedGregtechRecipe( "stickBlackSteel", "plateTungstenSteel", "stickBlackSteel", - "plateTungstenSteel", "blockIron", "plateTungstenSteel", - "stickBlackSteel", "plateTungstenSteel", "stickBlackSteel", - ItemUtils.getSimpleStack(ModBlocks.blockWitherGuard)); + "plateTungstenSteel", ItemUtils.getSimpleStack(Items.nether_star), "plateTungstenSteel", + "stickBlackSteel", "plateTungstenSteel", "stickBlackSteel", + ItemUtils.getSimpleStack(ModBlocks.blockWitherGuard, 32)); - //Alkalus Coin + //Alkalus Coin /*AddGregtechRecipe.addAssemblylineRecipe( ItemUtils.getSimpleStack(ModItems.itemAlkalusDisk), 288000, @@ -160,16 +151,16 @@ public class RECIPES_General { GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 16L), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 16L), GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 16L), - GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.NiobiumTitanium, 2L)}, + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.NiobiumTitanium, 2L)}, new FluidStack[]{ Materials.Osmium.getMolten(144*32), Materials.Europium.getFluid(144*8)}, ItemUtils.getSimpleStack(Dimension_DarkWorld.portalItem), 30*20*60, 100000);*/ - - } } +} + diff --git a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java index 337e301414..3680dfb59d 100644 --- a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java @@ -42,6 +42,9 @@ public class ItemUtils { public static ItemStack getSimpleStack(final Block x){ return getSimpleStack(Item.getItemFromBlock(x), 1); } + public static ItemStack getSimpleStack(final Block x, final int i){ + return getSimpleStack(Item.getItemFromBlock(x), i); + } public static ItemStack getSimpleStack(final Item x, final int i){ try { final ItemStack r = new ItemStack(x, i); @@ -61,8 +64,8 @@ public class ItemUtils { } public static final int WILDCARD_VALUE = Short.MAX_VALUE; - public static ItemStack getWildcardStack(Item x){ - ItemStack y = new ItemStack(x, 1, WILDCARD_VALUE); + public static ItemStack getWildcardStack(final Item x){ + final ItemStack y = new ItemStack(x, 1, WILDCARD_VALUE); return y; } @@ -265,8 +268,8 @@ public class ItemUtils { //Adds a check to grab dusts using GT methodology if possible. ItemStack returnValue = null; if (oredictName.toLowerCase().contains("dust")){ - String MaterialName = oredictName.toLowerCase().replace("dust", ""); - Materials m = Materials.get(MaterialName); + final String MaterialName = oredictName.toLowerCase().replace("dust", ""); + final Materials m = Materials.get(MaterialName); returnValue = getGregtechDust(m, amount); if (returnValue != null){ return returnValue; @@ -284,7 +287,7 @@ public class ItemUtils { Utils.LOG_WARNING(oredictName+" was not valid."); return null; } - catch (Throwable t){ + catch (final Throwable t){ return null; } } @@ -317,7 +320,7 @@ public class ItemUtils { return output; } - public static Item generateSpecialUsePlate(String internalName, String displayName, short[] rgb, int radioactivity){ + public static Item generateSpecialUsePlate(final String internalName, final String displayName, final short[] rgb, final int radioactivity){ return new BaseItemPlate_OLD(internalName, displayName, Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]), radioactivity); } @@ -344,7 +347,7 @@ public class ItemUtils { public static MultiPickaxeBase generateMultiPick(final boolean GT_Durability, final Materials material){ final ToolMaterial customMaterial = Utils.generateToolMaterialFromGT(material); - int enchantLevel = material.mEnchantmentToolsLevel; + final int enchantLevel = material.mEnchantmentToolsLevel; final Object enchant = new Pair(material.mEnchantmentTools, enchantLevel); return generateMultiPick(GT_Durability, customMaterial, material.mDefaultLocalName, material.mDurability, material.mRGBa, enchant); } @@ -575,24 +578,24 @@ public class ItemUtils { return outputs; } - private static String getModId(Item item) { + private static String getModId(final Item item) { try { - GameRegistry.UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor(item); - String modname = (id.modId == null ? id.name : id.modId); - return id == null || id.modId.equals("") ? "minecraft" : modname; - } catch (Throwable t){ + final GameRegistry.UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor(item); + final String modname = (id.modId == null ? id.name : id.modId); + return (id == null) || id.modId.equals("") ? "minecraft" : modname; + } catch (final Throwable t){ try { - UniqueIdentifier t2 = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(item)); - String modname = (t2.modId == null ? t2.name : t2.modId); - return t2 == null || t2.modId.equals("") ? "minecraft" : modname; + final UniqueIdentifier t2 = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(item)); + final String modname = (t2.modId == null ? t2.name : t2.modId); + return (t2 == null) || t2.modId.equals("") ? "minecraft" : modname; } - catch (Throwable t3){ + catch (final Throwable t3){ return "bad modid"; } } } - public static String getModId(ItemStack key) { + public static String getModId(final ItemStack key) { return getModId(key.getItem()); } @@ -602,13 +605,13 @@ public class ItemUtils { if (!oreDictList.isEmpty()){ ItemStack returnvalue; for (int xrc=0;xrc 0) { - final FXSlimyBubble ef = new FXSlimyBubble(world, (double) (x + rand.nextFloat()), (double) (y + 1), - (double) (z + rand.nextFloat()), 0.06f + rand.nextFloat() * 0.06f); - ef.func_82338_g(0.8f); - ef.func_70538_b(0.6f - rand.nextFloat() * 0.2f, 0.0f, 0.6f + rand.nextFloat() * 0.2f); - ParticleEngine.instance.addEffect(world, (EntityFX) ef); - if (rand.nextInt(50) == 0) { - final double var21 = x + rand.nextFloat(); - final double var22 = y + this.field_149756_F; - final double var23 = z + rand.nextFloat(); - world.func_72980_b(var21, var22, var23, "liquid.lavapop", 0.1f + rand.nextFloat() * 0.1f, - 0.9f + rand.nextFloat() * 0.15f, false); + public void randomDisplayTick(final World w, final int i, final int j, final int k, final Random r) { + final TileEntity te = w.getTileEntity(i, j, k); + if ((te != null) && (te instanceof TileFastAlchemyFurnace) && ((TileFastAlchemyFurnace) te).isBurning()) { + final float f = i + 0.5f; + final float f2 = j + 0.2f + ((r.nextFloat() * 5.0f) / 16.0f); + final float f3 = k + 0.5f; + final float f4 = 0.52f; + final float f5 = (r.nextFloat() * 0.5f) - 0.25f; + w.spawnParticle("smoke", f - f4, f2, f3 + f5, 0.0, 0.0, 0.0); + w.spawnParticle("flame", f - f4, f2, f3 + f5, 0.0, 0.0, 0.0); + w.spawnParticle("smoke", f + f4, f2, f3 + f5, 0.0, 0.0, 0.0); + w.spawnParticle("flame", f + f4, f2, f3 + f5, 0.0, 0.0, 0.0); + w.spawnParticle("smoke", f + f5, f2, f3 - f4, 0.0, 0.0, 0.0); + w.spawnParticle("flame", f + f5, f2, f3 - f4, 0.0, 0.0, 0.0); + w.spawnParticle("smoke", f + f5, f2, f3 + f4, 0.0, 0.0, 0.0); + w.spawnParticle("flame", f + f5, f2, f3 + f4, 0.0, 0.0, 0.0); + } + } + + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister ir) { + this.iconPedestal[0] = ir.registerIcon("thaumcraft:pedestal_side"); + this.iconPedestal[1] = ir.registerIcon("thaumcraft:pedestal_top"); + this.iconFurnace[0] = ir.registerIcon("thaumcraft:al_furnace_side"); + this.iconFurnace[1] = ir.registerIcon("thaumcraft:al_furnace_top"); + this.iconFurnace[2] = ir.registerIcon("thaumcraft:al_furnace_front_off"); + this.iconFurnace[3] = ir.registerIcon("thaumcraft:al_furnace_front_on"); + this.iconFurnace[4] = ir.registerIcon("thaumcraft:al_furnace_top_filled"); + } + + @Override + public int getRenderType() { + return ConfigBlocks.blockStoneDeviceRI; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public IIcon getIcon(final int side, final int md) { + if (md == 0) { + if (side == 1) { + return this.iconFurnace[1]; + } + if (side > 1) { + return this.iconFurnace[2]; + } + } else if (md == 1) { + if (side <= 1) { + return this.iconPedestal[1]; + } + if (side > 1) { + return this.iconPedestal[0]; + } + } + return this.iconPedestal[1]; + } + + @Override + public IIcon getIcon(final IBlockAccess iblockaccess, final int i, final int j, final int k, final int side) { + final int metadata = iblockaccess.getBlockMetadata(i, j, k); + if (metadata == 0) { + final TileEntity te = iblockaccess.getTileEntity(i, j, k); + if (side == 1) { + if ((te != null) && (te instanceof TileFastAlchemyFurnace) && (((TileFastAlchemyFurnace) te).vis > 0)) { + return this.iconFurnace[4]; + } + return this.iconFurnace[1]; + } else if (side > 1) { + if ((te != null) && (te instanceof TileFastAlchemyFurnace) && ((TileFastAlchemyFurnace) te).isBurning()) { + return this.iconFurnace[3]; } - final int q = rand.nextInt(2); - final int w = rand.nextInt(2); - final FXSlimyBubble ef2 = new FXSlimyBubble(world, x - 0.6 + rand.nextFloat() * 0.2 + q * 2, - (double) (y + 2), z - 0.6 + rand.nextFloat() * 0.2 + w * 2, 0.06f + rand.nextFloat() * 0.06f); - ef2.func_82338_g(0.8f); - ef2.func_70538_b(0.6f - rand.nextFloat() * 0.2f, 0.0f, 0.6f + rand.nextFloat() * 0.2f); - ParticleEngine.instance.addEffect(world, (EntityFX) ef2); + return this.iconFurnace[2]; } + } else if ((metadata == 1) || (metadata == 5) || (metadata == 8) || (metadata == 12)) { + return super.getIcon(iblockaccess, i, j, k, side); } - super.func_149734_b(world, x, y, z, rand);*/ + return this.iconFurnace[0]; } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/common/tile/TileFastAlchemyFurnace.java b/src/Java/gtPlusPlus/xmod/thaumcraft/common/tile/TileFastAlchemyFurnace.java index 226c7cf393..ec39e7f4af 100644 --- a/src/Java/gtPlusPlus/xmod/thaumcraft/common/tile/TileFastAlchemyFurnace.java +++ b/src/Java/gtPlusPlus/xmod/thaumcraft/common/tile/TileFastAlchemyFurnace.java @@ -22,12 +22,12 @@ import thaumcraft.common.tiles.TileAlembic; import thaumcraft.common.tiles.TileBellows; public class TileFastAlchemyFurnace extends TileAlchemyFurnace { - private static final int[] slots_bottom = {1}; - private static final int[] slots_top = new int[0]; - private static final int[] slots_sides = {0}; + private static final int[] slots_bottom; + private static final int[] slots_top; + private static final int[] slots_sides; public AspectList aspects; public int vis; - private int maxVis; + private final int maxVis; public int smeltTime; int bellows; boolean speedBoost; @@ -40,255 +40,247 @@ public class TileFastAlchemyFurnace extends TileAlchemyFurnace { public TileFastAlchemyFurnace() { this.aspects = new AspectList(); - - this.maxVis = 100; - this.smeltTime = 25; + this.maxVis = 150; + this.smeltTime = 100; this.bellows = -1; - this.speedBoost = false; - + this.speedBoost = true; this.furnaceItemStacks = new ItemStack[2]; - this.count = 0; } - public int func_70302_i_() { + @Override + public int getSizeInventory() { return this.furnaceItemStacks.length; } - public ItemStack func_70301_a(int par1) { + @Override + public ItemStack getStackInSlot(final int par1) { return this.furnaceItemStacks[par1]; } - public ItemStack func_70298_a(int par1, int par2) { - if (this.furnaceItemStacks[par1] != null) { - if (this.furnaceItemStacks[par1].stackSize <= par2) { - ItemStack itemstack = this.furnaceItemStacks[par1]; - this.furnaceItemStacks[par1] = null; - return itemstack; - } - - ItemStack itemstack = this.furnaceItemStacks[par1].splitStack(par2); - - if (this.furnaceItemStacks[par1].stackSize == 0) { - this.furnaceItemStacks[par1] = null; - } - + @Override + public ItemStack decrStackSize(final int par1, final int par2) { + if (this.furnaceItemStacks[par1] == null) { + return null; + } + if (this.furnaceItemStacks[par1].stackSize <= par2) { + final ItemStack itemstack = this.furnaceItemStacks[par1]; + this.furnaceItemStacks[par1] = null; return itemstack; } - - return null; + final ItemStack itemstack = this.furnaceItemStacks[par1].splitStack(par2); + if (this.furnaceItemStacks[par1].stackSize == 0) { + this.furnaceItemStacks[par1] = null; + } + return itemstack; } - public ItemStack func_70304_b(int par1) { + @Override + public ItemStack getStackInSlotOnClosing(final int par1) { if (this.furnaceItemStacks[par1] != null) { - ItemStack itemstack = this.furnaceItemStacks[par1]; + final ItemStack itemstack = this.furnaceItemStacks[par1]; this.furnaceItemStacks[par1] = null; return itemstack; } - return null; } - public void func_70299_a(int par1, ItemStack par2ItemStack) { + @Override + public void setInventorySlotContents(final int par1, final ItemStack par2ItemStack) { this.furnaceItemStacks[par1] = par2ItemStack; - - if ((par2ItemStack == null) || (par2ItemStack.stackSize <= func_70297_j_())) - return; - par2ItemStack.stackSize = func_70297_j_(); + if ((par2ItemStack != null) && (par2ItemStack.stackSize > this.getInventoryStackLimit())) { + par2ItemStack.stackSize = this.getInventoryStackLimit(); + } } - public String func_145825_b() { - return ((func_145818_k_()) ? this.customName : "container.alchemyfurnace"); + @Override + public String getInventoryName() { + return this.hasCustomInventoryName() ? this.customName : "container.alchemyfurnace"; } - public boolean func_145818_k_() { - return ((this.customName != null) && (this.customName.length() > 0)); + @Override + public boolean hasCustomInventoryName() { + return (this.customName != null) && (this.customName.length() > 0); } - public void setGuiDisplayName(String par1Str) { + @Override + public void setGuiDisplayName(final String par1Str) { this.customName = par1Str; } - public void readCustomNBT(NBTTagCompound nbttagcompound) { + @Override + public void readCustomNBT(final NBTTagCompound nbttagcompound) { this.furnaceBurnTime = nbttagcompound.getShort("BurnTime"); this.vis = nbttagcompound.getShort("Vis"); } - public void writeCustomNBT(NBTTagCompound nbttagcompound) { + @Override + public void writeCustomNBT(final NBTTagCompound nbttagcompound) { nbttagcompound.setShort("BurnTime", (short) this.furnaceBurnTime); nbttagcompound.setShort("Vis", (short) this.vis); } - public void func_145839_a(NBTTagCompound nbtCompound) { - super.func_145839_a(nbtCompound); - NBTTagList nbttaglist = nbtCompound.getTagList("Items", 10); - this.furnaceItemStacks = new ItemStack[func_70302_i_()]; - + @Override + public void readFromNBT(final NBTTagCompound nbtCompound) { + super.readFromNBT(nbtCompound); + final NBTTagList nbttaglist = nbtCompound.getTagList("Items", 10); + this.furnaceItemStacks = new ItemStack[this.getSizeInventory()]; for (int i = 0; i < nbttaglist.tagCount(); ++i) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - byte b0 = nbttagcompound1.getByte("Slot"); - - if ((b0 < 0) || (b0 >= this.furnaceItemStacks.length)) - continue; - this.furnaceItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + final NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + final byte b0 = nbttagcompound1.getByte("Slot"); + if ((b0 >= 0) && (b0 < this.furnaceItemStacks.length)) { + this.furnaceItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } } - this.speedBoost = nbtCompound.getBoolean("speedBoost"); this.furnaceCookTime = nbtCompound.getShort("CookTime"); this.currentItemBurnTime = TileEntityFurnace.getItemBurnTime(this.furnaceItemStacks[1]); - if (nbtCompound.hasKey("CustomName")) { this.customName = nbtCompound.getString("CustomName"); } - this.aspects.readFromNBT(nbtCompound); this.vis = this.aspects.visSize(); } - public void func_145841_b(NBTTagCompound nbtCompound) { - super.func_145841_b(nbtCompound); + @Override + public void writeToNBT(final NBTTagCompound nbtCompound) { + super.writeToNBT(nbtCompound); nbtCompound.setBoolean("speedBoost", this.speedBoost); nbtCompound.setShort("CookTime", (short) this.furnaceCookTime); - NBTTagList nbttaglist = new NBTTagList(); - + final NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < this.furnaceItemStacks.length; ++i) { - if (this.furnaceItemStacks[i] == null) - continue; - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); - this.furnaceItemStacks[i].writeToNBT(nbttagcompound1); - nbttaglist.appendTag(nbttagcompound1); + if (this.furnaceItemStacks[i] != null) { + final NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) i); + this.furnaceItemStacks[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } } - nbtCompound.setTag("Items", nbttaglist); - - if (func_145818_k_()) { + if (this.hasCustomInventoryName()) { nbtCompound.setString("CustomName", this.customName); } - this.aspects.writeToNBT(nbtCompound); } - public int func_70297_j_() { + @Override + public int getInventoryStackLimit() { return 64; } + @Override @SideOnly(Side.CLIENT) - public int getCookProgressScaled(int par1) { - if (this.smeltTime <= 0) + public int getCookProgressScaled(final int par1) { + if (this.smeltTime <= 0) { this.smeltTime = 1; - return (this.furnaceCookTime * par1 / this.smeltTime); + } + return (this.furnaceCookTime * par1) / this.smeltTime; } + @Override @SideOnly(Side.CLIENT) - public int getContentsScaled(int par1) { - return (this.vis * par1 / this.maxVis); + public int getContentsScaled(final int par1) { + return (this.vis * par1) / this.maxVis; } + @Override @SideOnly(Side.CLIENT) - public int getBurnTimeRemainingScaled(int par1) { + public int getBurnTimeRemainingScaled(final int par1) { if (this.currentItemBurnTime == 0) { this.currentItemBurnTime = 200; } - - return (this.furnaceBurnTime * par1 / this.currentItemBurnTime); + return (this.furnaceBurnTime * par1) / this.currentItemBurnTime; } + @Override public boolean isBurning() { - return (this.furnaceBurnTime > 0); + return this.furnaceBurnTime > 0; } - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + @Override + public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) { super.onDataPacket(net, pkt); - if (this.worldObj != null) - this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord, this.yCoord, - this.zCoord); + if (this.worldObj != null) { + this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord, this.yCoord, this.zCoord); + } } + @Override public boolean canUpdate() { return true; } - public void func_145845_h() { - boolean flag = this.furnaceBurnTime > 0; - boolean flag1 = false; - this.count += 1; + @Override + public void updateEntity() { + final boolean flag = this.furnaceBurnTime > 0; + boolean flag2 = false; + ++this.count; if (this.furnaceBurnTime > 0) { - this.furnaceBurnTime -= 1; + --this.furnaceBurnTime; } - - if (!(this.worldObj.isRemote)) { - if (this.bellows < 0) - getBellows(); - - if ((this.count % ((this.speedBoost) ? 20 : 40) == 0) && (this.aspects.size() > 0)) { - AspectList exlude = new AspectList(); + if (!this.worldObj.isRemote) { + if (this.bellows < 0) { + this.getBellows(); + } + if (((this.count % (this.speedBoost ? 10 : 20)) == 0) && (this.aspects.size() > 0)) { + final AspectList exlude = new AspectList(); int deep = 0; TileEntity tile = null; while (deep < 5) { ++deep; - tile = this.worldObj.getTileEntity(this.xCoord, this.yCoord + deep, - this.zCoord); - if (!(tile instanceof TileAlembic)) + tile = this.worldObj.getTileEntity(this.xCoord, this.yCoord + deep, this.zCoord); + if (!(tile instanceof TileAlembic)) { break; - TileAlembic alembic = (TileAlembic) tile; + } + final TileAlembic alembic = (TileAlembic) tile; if ((alembic.aspect != null) && (alembic.amount < alembic.maxAmount) && (this.aspects.getAmount(alembic.aspect) > 0)) { - takeFromContainer(alembic.aspect, 1); + this.takeFromContainer(alembic.aspect, 1); alembic.addToContainer(alembic.aspect, 1); exlude.merge(alembic.aspect, 1); - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, - this.zCoord); - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord + deep, - this.zCoord); + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord + deep, this.zCoord); } tile = null; } - deep = 0; while (deep < 5) { ++deep; - tile = this.worldObj.getTileEntity(this.xCoord, this.yCoord + deep, - this.zCoord); - if (!(tile instanceof TileAlembic)) + tile = this.worldObj.getTileEntity(this.xCoord, this.yCoord + deep, this.zCoord); + if (!(tile instanceof TileAlembic)) { break; - TileAlembic alembic = (TileAlembic) tile; - if ((alembic.aspect == null) || (alembic.amount == 0)) - ; + } + final TileAlembic alembic = (TileAlembic) tile; + if ((alembic.aspect != null) && (alembic.amount != 0)) { + continue; + } Aspect as = null; if (alembic.aspectFilter == null) { - as = takeRandomAspect(exlude); - } else if (takeFromContainer(alembic.aspectFilter, 1)) { + as = this.takeRandomAspect(exlude); + } else if (this.takeFromContainer(alembic.aspectFilter, 1)) { as = alembic.aspectFilter; } - if (as != null) { alembic.addToContainer(as, 1); - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, - this.zCoord); - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord + deep, - this.zCoord); + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); + this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord + deep, this.zCoord); break; } - } - } - - if ((this.furnaceBurnTime == 0) && (canSmelt())) { - this.currentItemBurnTime = (this.furnaceBurnTime = TileEntityFurnace - .getItemBurnTime(this.furnaceItemStacks[1])); - + if ((this.furnaceBurnTime == 0) && this.canSmelt()) { + final int itemBurnTime = TileEntityFurnace.getItemBurnTime(this.furnaceItemStacks[1]); + this.furnaceBurnTime = itemBurnTime; + this.currentItemBurnTime = itemBurnTime; if (this.furnaceBurnTime > 0) { - flag1 = true; + flag2 = true; this.speedBoost = false; - if (this.furnaceItemStacks[1] != null) { if (this.furnaceItemStacks[1].isItemEqual(new ItemStack(ConfigItems.itemResource, 1, 0))) { this.speedBoost = true; } - this.furnaceItemStacks[1].stackSize -= 1; - + final ItemStack itemStack = this.furnaceItemStacks[1]; + --itemStack.stackSize; if (this.furnaceItemStacks[1].stackSize == 0) { this.furnaceItemStacks[1] = this.furnaceItemStacks[1].getItem() .getContainerItem(this.furnaceItemStacks[1]); @@ -296,126 +288,134 @@ public class TileFastAlchemyFurnace extends TileAlchemyFurnace { } } } - - if ((isBurning()) && (canSmelt())) { - this.furnaceCookTime += 1; - + if (this.isBurning() && this.canSmelt()) { + ++this.furnaceCookTime; if (this.furnaceCookTime >= this.smeltTime) { this.furnaceCookTime = 0; - smeltItem(); - flag1 = true; + this.smeltItem(); + flag2 = true; } } else { this.furnaceCookTime = 0; } - - if (flag != this.furnaceBurnTime > 0) { - flag1 = true; + if (flag != (this.furnaceBurnTime > 0)) { + flag2 = true; this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); } } - - if (!(flag1)) - return; - markDirty(); + if (flag2) { + this.markDirty(); + } } private boolean canSmelt() { if (this.furnaceItemStacks[0] == null) { return false; } - AspectList al = ThaumcraftCraftingManager.getObjectTags(this.furnaceItemStacks[0]); al = ThaumcraftCraftingManager.getBonusTags(this.furnaceItemStacks[0], al); - - if ((al == null) || (al.size() == 0)) + if ((al == null) || (al.size() == 0)) { return false; - int vs = al.visSize(); - if (vs > this.maxVis - this.vis) + } + final int vs = al.visSize(); + if (vs > (this.maxVis - this.vis)) { return false; - this.smeltTime = (int) (vs * 10 * (1.0F - (0.125F * this.bellows))); + } + this.smeltTime = (int) (vs * 10 * (1.0f - (0.125f * this.bellows))); return true; } + @Override public void getBellows() { - this.bellows = TileBellows.getBellows(this.worldObj, this.xCoord, this.yCoord, - this.zCoord, ForgeDirection.VALID_DIRECTIONS); + this.bellows = TileBellows.getBellows(this.worldObj, this.xCoord, this.yCoord, this.zCoord, + ForgeDirection.VALID_DIRECTIONS); } + @Override public void smeltItem() { - if (!(canSmelt())) { - return; - } - AspectList al = ThaumcraftCraftingManager.getObjectTags(this.furnaceItemStacks[0]); - al = ThaumcraftCraftingManager.getBonusTags(this.furnaceItemStacks[0], al); - - for (Aspect a : al.getAspects()) { - this.aspects.add(a, al.getAmount(a)); + if (this.canSmelt()) { + AspectList al = ThaumcraftCraftingManager.getObjectTags(this.furnaceItemStacks[0]); + al = ThaumcraftCraftingManager.getBonusTags(this.furnaceItemStacks[0], al); + for (final Aspect a : al.getAspects()) { + this.aspects.add(a, al.getAmount(a)); + } + this.vis = this.aspects.visSize(); + final ItemStack itemStack = this.furnaceItemStacks[0]; + --itemStack.stackSize; + if (this.furnaceItemStacks[0].stackSize <= 0) { + this.furnaceItemStacks[0] = null; + } } - - this.vis = this.aspects.visSize(); - - this.furnaceItemStacks[0].stackSize -= 1; - - if (this.furnaceItemStacks[0].stackSize > 0) - return; - this.furnaceItemStacks[0] = null; } - public static boolean isItemFuel(ItemStack par0ItemStack) { - return (TileEntityFurnace.getItemBurnTime(par0ItemStack) > 0); + public static boolean isItemFuel(final ItemStack par0ItemStack) { + return TileEntityFurnace.getItemBurnTime(par0ItemStack) > 0; } - public boolean func_70300_a(EntityPlayer par1EntityPlayer) { - return (this.worldObj.getTileEntity(this.xCoord, this.yCoord, - this.zCoord) == this); + @Override + public boolean isUseableByPlayer(final EntityPlayer par1EntityPlayer) { + return (this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) == this) + && (par1EntityPlayer.getDistanceSq(this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5) <= 64.0); } - public void func_70295_k_() { + @Override + public void openInventory() { } - public void func_70305_f() { + @Override + public void closeInventory() { } - public boolean func_94041_b(int par1, ItemStack par2ItemStack) { + @Override + public boolean isItemValidForSlot(final int par1, final ItemStack par2ItemStack) { if (par1 == 0) { AspectList al = ThaumcraftCraftingManager.getObjectTags(par2ItemStack); al = ThaumcraftCraftingManager.getBonusTags(par2ItemStack, al); - if ((al != null) && (al.size() > 0)) + if ((al != null) && (al.size() > 0)) { return true; + } } - return ((par1 == 1) ? isItemFuel(par2ItemStack) : false); + return (par1 == 1) && isItemFuel(par2ItemStack); } - public int[] func_94128_d(int par1) { - return ((par1 == 1) ? slots_top : (par1 == 0) ? slots_bottom : slots_sides); + @Override + public int[] getAccessibleSlotsFromSide(final int par1) { + return (par1 == 0) + ? TileFastAlchemyFurnace.slots_bottom + : ((par1 == 1) ? TileFastAlchemyFurnace.slots_top : TileFastAlchemyFurnace.slots_sides); } - public boolean func_102007_a(int par1, ItemStack par2ItemStack, int par3) { - return ((par3 == 1) ? false : func_94041_b(par1, par2ItemStack)); + @Override + public boolean canInsertItem(final int par1, final ItemStack par2ItemStack, final int par3) { + return (par3 != 1) && this.isItemValidForSlot(par1, par2ItemStack); } - public boolean func_102008_b(int par1, ItemStack par2ItemStack, int par3) { - return ((par3 != 0) || (par1 != 1) || (par2ItemStack.getItem() == Items.bucket)); + @Override + public boolean canExtractItem(final int par1, final ItemStack par2ItemStack, final int par3) { + return (par3 != 0) || (par1 != 1) || (par2ItemStack.getItem() == Items.bucket); } - public Aspect takeRandomAspect(AspectList exlude) { + @Override + public Aspect takeRandomAspect(final AspectList exlude) { if (this.aspects.size() > 0) { - AspectList temp = this.aspects.copy(); - if (exlude.size() > 0) - for (Aspect a : exlude.getAspects()) + final AspectList temp = this.aspects.copy(); + if (exlude.size() > 0) { + for (final Aspect a : exlude.getAspects()) { temp.remove(a); + } + } if (temp.size() > 0) { - Aspect tag = temp.getAspects()[this.worldObj.rand.nextInt(temp.getAspects().length)]; + final Aspect tag = temp.getAspects()[this.worldObj.rand.nextInt(temp.getAspects().length)]; this.aspects.remove(tag, 1); - this.vis -= 1; + --this.vis; return tag; } } return null; } - public boolean takeFromContainer(Aspect tag, int amount) { + @Override + public boolean takeFromContainer(final Aspect tag, final int amount) { if ((this.aspects != null) && (this.aspects.getAmount(tag) >= amount)) { this.aspects.remove(tag, amount); this.vis -= amount; @@ -423,4 +423,10 @@ public class TileFastAlchemyFurnace extends TileAlchemyFurnace { } return false; } + + static { + slots_bottom = new int[]{1}; + slots_top = new int[0]; + slots_sides = new int[]{0}; + } } \ No newline at end of file -- cgit From 7bd2240747945f0c4b4287ef106049b7e1505fb6 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Wed, 22 Nov 2017 13:47:37 +1000 Subject: + Added the basic framework for Ore Regen commands. + Added more missing Blast Smelter recipes. $ Fixed Alloy Blast Smelter not using fluids as expected. --- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 198 ++++++++++++++++----- .../base/GregtechMeta_MultiBlockBase.java | 150 +++++++++++----- .../command/regen/GTPP_WorldRegenerator.java | 135 ++++++++++++++ .../common/command/regen/HANDLER_GT_Commands.java | 129 ++++++++++++++ .../GregtechMetaTileEntity_AlloyBlastSmelter.java | 50 +++--- .../gregtech/loaders/RecipeGen_BlastSmelter.java | 30 +++- 6 files changed, 574 insertions(+), 118 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/command/regen/GTPP_WorldRegenerator.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/command/regen/HANDLER_GT_Commands.java (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 623e5651e5..39d09935d2 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -1,8 +1,16 @@ package gtPlusPlus.core.recipe; import gregtech.api.GregTech_API; -import gregtech.api.enums.*; -import gregtech.api.util.*; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.HotFuel; +import gregtech.api.util.ThermalFuel; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; @@ -55,7 +63,7 @@ public class RECIPES_GREGTECH { sifterRecipes(); electroMagneticSeperatorRecipes(); addFuels(); - } + } private static void blastSmelterRecipes() { @@ -65,9 +73,9 @@ public class RECIPES_GREGTECH { ItemUtils.getGregtechCircuit(13), ItemUtils.getItemStackOfAmountFromOreDict("dustGold", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 3), + ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 3), }, - FluidUtils.getFluidStack("molten.blackbronze", 5*144), + FluidUtils.getFluidStack("molten.blackbronze", 5*144), 0, MathUtils.findPercentageOfInt(200*20, 80), 120); @@ -80,9 +88,9 @@ public class RECIPES_GREGTECH { ItemUtils.getItemStackOfAmountFromOreDict("dustSteel", 15), ItemUtils.getItemStackOfAmountFromOreDict("dustGold", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 3) + ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 3) }, - FluidUtils.getFluidStack("molten.blacksteel", 25*144), + FluidUtils.getFluidStack("molten.blacksteel", 25*144), 0, MathUtils.findPercentageOfInt(60*20, 80), 120); @@ -96,9 +104,9 @@ public class RECIPES_GREGTECH { ItemUtils.getItemStackOfAmountFromOreDict("dustZinc", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustBismuth", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustSteel", 10), - ItemUtils.getItemStackOfAmountFromOreDict("dustBlackSteel", 20) + ItemUtils.getItemStackOfAmountFromOreDict("dustBlackSteel", 20) }, - FluidUtils.getFluidStack("molten.redsteel", 40*144), + FluidUtils.getFluidStack("molten.redsteel", 40*144), 0, MathUtils.findPercentageOfInt(65*20, 80), 120); @@ -111,10 +119,10 @@ public class RECIPES_GREGTECH { ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 18), ItemUtils.getItemStackOfAmountFromOreDict("dustZinc", 5), ItemUtils.getItemStackOfAmountFromOreDict("dustSteel", 30), - ItemUtils.getItemStackOfAmountFromOreDict("dustBlackSteel", 60) + ItemUtils.getItemStackOfAmountFromOreDict("dustBlackSteel", 60) }, - FluidUtils.getFluidStack("molten.bluesteel", 125*144), + FluidUtils.getFluidStack("molten.bluesteel", 125*144), 0, MathUtils.findPercentageOfInt(70*20, 80), 120); @@ -124,9 +132,9 @@ public class RECIPES_GREGTECH { new ItemStack[]{ ItemUtils.getGregtechCircuit(2), ItemUtils.getItemStackOfAmountFromOreDict("ingotTungsten", 1), - ItemUtils.getItemStackOfAmountFromOreDict("ingotSteel", 1) + ItemUtils.getItemStackOfAmountFromOreDict("ingotSteel", 1) }, - FluidUtils.getFluidStack("molten.tungstensteel", 2*144), + FluidUtils.getFluidStack("molten.tungstensteel", 2*144), 0, MathUtils.findPercentageOfInt(300*20, 80), 120); @@ -138,9 +146,9 @@ public class RECIPES_GREGTECH { ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 6), ItemUtils.getItemStackOfAmountFromOreDict("dustNickel", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustManganese", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustChrome", 1) + ItemUtils.getItemStackOfAmountFromOreDict("dustChrome", 1) }, - FluidUtils.getFluidStack("molten.stainlesssteel", 9*144), + FluidUtils.getFluidStack("molten.stainlesssteel", 9*144), 0, MathUtils.findPercentageOfInt(85*20, 80), 120); @@ -155,9 +163,9 @@ public class RECIPES_GREGTECH { ItemUtils.getItemStackOfAmountFromOreDict("dustChrome", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 3), ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 3), - ItemUtils.getItemStackOfAmountFromOreDict("dustSilicon", 12) + ItemUtils.getItemStackOfAmountFromOreDict("dustSilicon", 12) }, - FluidUtils.getFluidStack("molten.eglinsteel", 48*144), + FluidUtils.getFluidStack("molten.eglinsteel", 48*144), 0, MathUtils.findPercentageOfInt(30*20, 80), 120); @@ -169,9 +177,9 @@ public class RECIPES_GREGTECH { ItemUtils.getItemStackOfAmountFromOreDict("dustTungstenSteel", 5), ItemUtils.getItemStackOfAmountFromOreDict("dustVanadium", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustMolybdenum", 2), - ItemUtils.getItemStackOfAmountFromOreDict("dustChrome", 1) + ItemUtils.getItemStackOfAmountFromOreDict("dustChrome", 1) }, - FluidUtils.getFluidStack("molten.hssg", 9*144), + FluidUtils.getFluidStack("molten.hssg", 9*144), 0, MathUtils.findPercentageOfInt(450*20, 80), 120); @@ -184,9 +192,9 @@ public class RECIPES_GREGTECH { ItemUtils.getItemStackOfAmountFromOreDict("dustSteel", 5), ItemUtils.getItemStackOfAmountFromOreDict("dustVanadium", 2), ItemUtils.getItemStackOfAmountFromOreDict("dustMolybdenum", 4), - ItemUtils.getItemStackOfAmountFromOreDict("dustChrome", 2) + ItemUtils.getItemStackOfAmountFromOreDict("dustChrome", 2) }, - FluidUtils.getFluidStack("molten.hssg", 18*144), + FluidUtils.getFluidStack("molten.hssg", 18*144), 0, MathUtils.findPercentageOfInt(900*20, 80), 120); @@ -198,9 +206,9 @@ public class RECIPES_GREGTECH { ItemUtils.getItemStackOfAmountFromOreDict("dustHSSG", 6), ItemUtils.getItemStackOfAmountFromOreDict("dustCobalt", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustSilicon", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustManganese", 1) + ItemUtils.getItemStackOfAmountFromOreDict("dustManganese", 1) }, - FluidUtils.getFluidStack("molten.hsse", 9*144), + FluidUtils.getFluidStack("molten.hsse", 9*144), 0, MathUtils.findPercentageOfInt(540*20, 80), 120); @@ -211,20 +219,128 @@ public class RECIPES_GREGTECH { ItemUtils.getGregtechCircuit(3), ItemUtils.getItemStackOfAmountFromOreDict("dustHSSG", 6), ItemUtils.getItemStackOfAmountFromOreDict("dustOsmium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustIridium", 2) + ItemUtils.getItemStackOfAmountFromOreDict("dustIridium", 2) }, - FluidUtils.getFluidStack("molten.hsss", 9*144), + FluidUtils.getFluidStack("molten.hsss", 9*144), 0, MathUtils.findPercentageOfInt(810*20, 80), 120); + //Osmiridium + CORE.RA.addBlastSmelterRecipe( + new ItemStack[]{ + ItemUtils.getGregtechCircuit(2), + ItemUtils.getItemStackOfAmountFromOreDict("dustIridium", 3), + ItemUtils.getItemStackOfAmountFromOreDict("dustOsmium", 1) + }, + FluidUtils.getFluidStack("molten.osmiridium", 4*144), + 0, + MathUtils.findPercentageOfInt(1920*20, 80), + 500); + + //Naq Alloy + CORE.RA.addBlastSmelterRecipe( + new ItemStack[]{ + ItemUtils.getGregtechCircuit(2), + ItemUtils.getItemStackOfAmountFromOreDict("dustNaquadah", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustOsmiridium", 1) + }, + FluidUtils.getFluidStack("molten.naquadahalloy", 2*144), + 0, + MathUtils.findPercentageOfInt(30720*20, 80), + 500); + + //Nickel-Zinc-Ferrite + if (Materials.get("NickelZincFerrite") != null){ + CORE.RA.addBlastSmelterRecipe( + new ItemStack[]{ + ItemUtils.getGregtechCircuit(2), + ItemUtils.getItemStackOfAmountFromOreDict("dustFerriteMixture", 6) + }, + Materials.Oxygen.getGas(2000), + FluidUtils.getFluidStack("molten.nickelzincferrite", 2*144), + 0, + MathUtils.findPercentageOfInt(600*20, 80), + 120); + } + + //Gallium-Arsenide + if (Materials.get("GalliumArsenide") != null){ + CORE.RA.addBlastSmelterRecipe( + new ItemStack[]{ + ItemUtils.getGregtechCircuit(2), + ItemUtils.getItemStackOfAmountFromOreDict("dustGallium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustArsenic", 1) + }, + FluidUtils.getFluidStack("molten.galliumarsenide", 2*144), + 0, + MathUtils.findPercentageOfInt(600*20, 80), + 120); + } + + + + + + + + + + + + + + //TungstenCarbide + if (Materials.get("TungstenCarbide") != null){ + CORE.RA.addBlastSmelterRecipe( + new ItemStack[]{ + ItemUtils.getGregtechCircuit(12), + ItemUtils.getItemStackOfAmountFromOreDict("dustTungsten", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 1) + }, + FluidUtils.getFluidStack("molten.tungstencarbide", 2*144), + 0, + MathUtils.findPercentageOfInt((int) Math.max(Materials.TungstenCarbide.getMass() / 40L, 1L) * Materials.TungstenCarbide.mBlastFurnaceTemp*20, 80), + 480); + } + + + //Vanadium-Gallium + if (Materials.get("VanadiumGallium") != null){ + CORE.RA.addBlastSmelterRecipe( + new ItemStack[]{ + ItemUtils.getGregtechCircuit(2), + ItemUtils.getItemStackOfAmountFromOreDict("dustGallium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustVanadium", 3) + }, + FluidUtils.getFluidStack("molten.vanadiumgallium", 4*144), + 0, + MathUtils.findPercentageOfInt((int) Math.max(Materials.VanadiumGallium.getMass() / 40L, 1L) * Materials.VanadiumGallium.mBlastFurnaceTemp*20, 80), + 480); + } + + //EIO + //Dark Steel + if (ItemUtils.getItemStackOfAmountFromOreDict("dustElectricalSteel", 1) != ItemUtils.getSimpleStack(ModItems.AAA_Broken)){ + CORE.RA.addBlastSmelterRecipe( + new ItemStack[]{ + ItemUtils.getGregtechCircuit(2), + ItemUtils.getItemStackOfAmountFromOreDict("dustElectricalSteel", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustObsidian", 1) + }, + FluidUtils.getFluidStack("molten.darksteel", 2*144), + 0, + MathUtils.findPercentageOfInt(500*20, 80), + 120); + } + } private static void fluidcannerRecipes() { //Sulfuric Acid GT_Values.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(Items.glass_bottle), ItemUtils.getSimpleStack(ModItems.itemSulfuricPotion), FluidUtils.getFluidStack("sulfuricacid", 250), null); - GT_Values.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(ModItems.itemSulfuricPotion), ItemUtils.getSimpleStack(Items.glass_bottle), null, FluidUtils.getFluidStack("sulfuricacid", 250)); - + GT_Values.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(ModItems.itemSulfuricPotion), ItemUtils.getSimpleStack(Items.glass_bottle), null, FluidUtils.getFluidStack("sulfuricacid", 250)); + //Hydrofluoric Acid GT_Values.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(Items.glass_bottle), ItemUtils.getSimpleStack(ModItems.itemHydrofluoricPotion), FluidUtils.getFluidStack("hydrofluoricacid", 250), null); GT_Values.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(ModItems.itemHydrofluoricPotion), ItemUtils.getSimpleStack(Items.glass_bottle), null, FluidUtils.getFluidStack("hydrofluoricacid", 250)); @@ -239,7 +355,7 @@ public class RECIPES_GREGTECH { 20, GT_ModHandler.getSteam(1000), GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 24L), - FluidUtils.getFluidStack("fluid.coalgas", 1440), + FluidUtils.getFluidStack("fluid.coalgas", 1440), 60, 30); @@ -249,7 +365,7 @@ public class RECIPES_GREGTECH { 22, GT_ModHandler.getSteam(1000), ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 10), - FluidUtils.getFluidStack("fluid.coalgas", 2880), + FluidUtils.getFluidStack("fluid.coalgas", 2880), 30, 120); @@ -610,12 +726,12 @@ public class RECIPES_GREGTECH { addAR(ItemUtils.getItemStackOfAmountFromOreDict("plateIncoloy020", 16), ItemUtils.getItemStackOfAmountFromOreDict("frameGtIncoloyMA956", 4), null, GregtechItemList.Casing_Power_SubStation.get(4), 80, 128); } - private static boolean addAR(ItemStack inputA, ItemStack inputB, ItemStack outputA, int seconds, int voltage){ + private static boolean addAR(final ItemStack inputA, final ItemStack inputB, final ItemStack outputA, final int seconds, final int voltage){ //return GT_Values.RA.addAssemblerRecipe(inputA, inputB, outputA, seconds*20, voltage); return addAR(inputA, inputB, null, outputA, seconds*20, voltage); } - private static boolean addAR(ItemStack inputA, ItemStack inputB, FluidStack inputFluidA, ItemStack outputA, int seconds, int voltage){ + private static boolean addAR(final ItemStack inputA, final ItemStack inputB, final FluidStack inputFluidA, final ItemStack outputA, final int seconds, final int voltage){ //return GT_Values.RA.addAssemblerRecipe(inputA, inputB, outputA, seconds*20, voltage); return GT_Values.RA.addAssemblerRecipe(inputA, inputB, inputFluidA, outputA, seconds*20, voltage); } @@ -953,12 +1069,12 @@ public class RECIPES_GREGTECH { FluidUtils.getFluidStack("molten.bismuth", 1), new ItemStack[]{GregtechItemList.Pellet_RTG_PO210.get(1)}, null, - new int[]{100}, - 20*300, - 2040, - 500*20); + new int[]{100}, + 20*300, + 2040, + 500*20); } - + private static void sifterRecipes() { //Zirconium GT_Values.RA.addSifterRecipe( @@ -970,10 +1086,10 @@ public class RECIPES_GREGTECH { ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1) - }, + }, new int[]{10000, 5000, 1500, 1000, 500, 500}, 20*30, - 60); + 60); //Zirconium GT_Values.RA.addSifterRecipe( @@ -985,12 +1101,12 @@ public class RECIPES_GREGTECH { ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1) - }, + }, new int[]{10000, 5000, 1500, 1000, 500, 500}, 20*30, 60); } - + private static void electroMagneticSeperatorRecipes(){ GT_Values.RA.addElectromagneticSeparatorRecipe( ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedBauxite", 1), @@ -1001,7 +1117,7 @@ public class RECIPES_GREGTECH { 20*20, 24); } - + private static void advancedMixerRecipes(){ //HgBa2Ca2Cu3O8 CORE.RA.addMixerRecipe( 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 e9831d96e0..bf7dc58db3 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 @@ -6,8 +6,12 @@ import java.util.Iterator; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.*; -import gregtech.api.util.*; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.util.GT_Recipe; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine; @@ -19,8 +23,8 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; public abstract class GregtechMeta_MultiBlockBase - extends - GT_MetaTileEntity_MultiBlockBase { +extends +GT_MetaTileEntity_MultiBlockBase { public static boolean disableMaintenance; public ArrayList mChargeHatches = new ArrayList(); @@ -77,16 +81,17 @@ public abstract class GregtechMeta_MultiBlockBase } @Override - public boolean isCorrectMachinePart(ItemStack paramItemStack) { + public boolean isCorrectMachinePart(final ItemStack paramItemStack) { return true; } @Override - public int getDamageToComponent(ItemStack paramItemStack) { + public int getDamageToComponent(final ItemStack paramItemStack) { return 0; } - public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + @Override + public void startSoundLoop(final byte aIndex, final double aX, final double aY, final double aZ) { } public void startProcess() { @@ -102,20 +107,23 @@ public abstract class GregtechMeta_MultiBlockBase int tValidOutputHatches = 0; for (final GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) { - if (!isValidMetaTileEntity(tHatch)) + if (!isValidMetaTileEntity(tHatch)) { continue; + } int tEmptySlots = 0; boolean foundRoom = false; final IInventory tHatchInv = tHatch.getBaseMetaTileEntity(); - for (int i = 0; i < tHatchInv.getSizeInventory() + for (int i = 0; (i < tHatchInv.getSizeInventory()) && !foundRoom; ++i) { - if (tHatchInv.getStackInSlot(i) != null) + if (tHatchInv.getStackInSlot(i) != null) { continue; + } tEmptySlots++; - if (tEmptySlots < outputItemCount) + if (tEmptySlots < outputItemCount) { continue; + } tValidOutputHatches++; foundRoom = true; @@ -125,25 +133,25 @@ public abstract class GregtechMeta_MultiBlockBase return tValidOutputHatches; } - public GT_Recipe reduceRecipeTimeByPercentage(GT_Recipe tRecipe, - float percentage) { + public GT_Recipe reduceRecipeTimeByPercentage(final GT_Recipe tRecipe, + final float percentage) { int cloneTime = 0; GT_Recipe baseRecipe; GT_Recipe cloneRecipe = null; baseRecipe = tRecipe.copy(); - if (cloneRecipe != baseRecipe || cloneRecipe == null) { + if ((cloneRecipe != baseRecipe) || (cloneRecipe == null)) { cloneRecipe = baseRecipe.copy(); Utils.LOG_WARNING("Setting Recipe"); } - if (cloneTime != baseRecipe.mDuration || cloneTime == 0) { + if ((cloneTime != baseRecipe.mDuration) || (cloneTime == 0)) { cloneTime = baseRecipe.mDuration; Utils.LOG_WARNING("Setting Time"); } if (cloneRecipe.mDuration > 0) { - int originalTime = cloneRecipe.mDuration; - int tempTime = MathUtils.findPercentageOfInt(cloneRecipe.mDuration, + final int originalTime = cloneRecipe.mDuration; + final int tempTime = MathUtils.findPercentageOfInt(cloneRecipe.mDuration, (100 - percentage)); cloneRecipe.mDuration = tempTime; if (cloneRecipe.mDuration < originalTime) { @@ -162,8 +170,8 @@ public abstract class GregtechMeta_MultiBlockBase } @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, - long aTick) { + public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, + final long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); //this.mChargeHatches.clear(); //this.mDischargeHatches.clear(); @@ -172,58 +180,71 @@ public abstract class GregtechMeta_MultiBlockBase @Override public void explodeMultiblock() { MetaTileEntity tTileEntity; - for (Iterator localIterator = this.mChargeHatches + for (final Iterator localIterator = this.mChargeHatches .iterator(); localIterator.hasNext(); tTileEntity - .getBaseMetaTileEntity() - .doExplosion(gregtech.api.enums.GT_Values.V[8])) - tTileEntity = (MetaTileEntity) localIterator.next(); + .getBaseMetaTileEntity() + .doExplosion(gregtech.api.enums.GT_Values.V[8])) { + tTileEntity = localIterator.next(); + } tTileEntity = null; - for (Iterator localIterator = this.mDischargeHatches + for (final Iterator localIterator = this.mDischargeHatches .iterator(); localIterator.hasNext(); tTileEntity - .getBaseMetaTileEntity() - .doExplosion(gregtech.api.enums.GT_Values.V[8])) - tTileEntity = (MetaTileEntity) localIterator.next(); + .getBaseMetaTileEntity() + .doExplosion(gregtech.api.enums.GT_Values.V[8])) { + tTileEntity = localIterator.next(); + } super.explodeMultiblock(); } + @Override public void updateSlots() { - for (GT_MetaTileEntity_Hatch_InputBattery tHatch : this.mChargeHatches) - if (isValidMetaTileEntity(tHatch)) + for (final GT_MetaTileEntity_Hatch_InputBattery tHatch : this.mChargeHatches) { + if (isValidMetaTileEntity(tHatch)) { tHatch.updateSlots(); - for (GT_MetaTileEntity_Hatch_OutputBattery tHatch : this.mDischargeHatches) - if (isValidMetaTileEntity(tHatch)) + } + } + for (final GT_MetaTileEntity_Hatch_OutputBattery tHatch : this.mDischargeHatches) { + if (isValidMetaTileEntity(tHatch)) { tHatch.updateSlots(); + } + } super.updateSlots(); } - public boolean addToMachineList(IGregTechTileEntity aTileEntity, - int aBaseCasingIndex) { - if (aTileEntity == null) + @Override + public boolean addToMachineList(final IGregTechTileEntity aTileEntity, + final int aBaseCasingIndex) { + if (aTileEntity == null) { return false; - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) + } + final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { return false; - - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBattery) + } + + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBattery) { return this.mChargeHatches.add( (GT_MetaTileEntity_Hatch_InputBattery) aMetaTileEntity); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBattery) + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBattery) { return this.mDischargeHatches.add( (GT_MetaTileEntity_Hatch_OutputBattery) aMetaTileEntity); + } return super.addToMachineList(aTileEntity, aBaseCasingIndex); } - public boolean addChargeableToMachineList(IGregTechTileEntity aTileEntity, - int aBaseCasingIndex) { + public boolean addChargeableToMachineList(final IGregTechTileEntity aTileEntity, + final int aBaseCasingIndex) { if (aTileEntity == null) { return false; } - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) + final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBattery) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity) - .updateTexture(aBaseCasingIndex); + .updateTexture(aBaseCasingIndex); return this.mChargeHatches.add( (GT_MetaTileEntity_Hatch_InputBattery) aMetaTileEntity); } @@ -231,20 +252,53 @@ public abstract class GregtechMeta_MultiBlockBase } public boolean addDischargeableInputToMachineList( - IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { if (aTileEntity == null) { return false; } - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) + final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { return false; + } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBattery) { ((GT_MetaTileEntity_Hatch) aMetaTileEntity) - .updateTexture(aBaseCasingIndex); + .updateTexture(aBaseCasingIndex); return this.mDischargeHatches.add( (GT_MetaTileEntity_Hatch_OutputBattery) aMetaTileEntity); } return false; } + + public boolean addFluidInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + } + return false; + } + + public boolean addFluidOutputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + } + return false; + } + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/command/regen/GTPP_WorldRegenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/command/regen/GTPP_WorldRegenerator.java new file mode 100644 index 0000000000..ebe26c8645 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/command/regen/GTPP_WorldRegenerator.java @@ -0,0 +1,135 @@ +package gtPlusPlus.xmod.gregtech.common.command.regen; + +import java.util.HashSet; +import java.util.Random; + +import cpw.mods.fml.common.IWorldGenerator; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_Log; +import gregtech.api.world.GT_Worldgen; +import gregtech.common.GT_Worldgen_GT_Ore_Layer; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; + +public class GTPP_WorldRegenerator implements IWorldGenerator { + private static int mEndAsteroidProbability = 300; + private static int mGCAsteroidProbability = 50; + private static int mSize = 100; + private static int endMinSize = 50; + private static int endMaxSize = 200; + private static int gcMinSize = 100; + private static int gcMaxSize = 400; + private static boolean endAsteroids = true; + private static boolean gcAsteroids = true; + + + public GTPP_WorldRegenerator() { + GameRegistry.registerWorldGenerator(this, 1073741823); + } + + @Override + public synchronized void generate(final Random aRandom, final int aX, final int aZ, final World aWorld, final IChunkProvider aChunkGenerator, final IChunkProvider aChunkProvider) { + int tempDimensionId = aWorld.provider.dimensionId; + if ((tempDimensionId != -1) && (tempDimensionId != 1) && !aChunkGenerator.getClass().getName().contains("galacticraft")) { + tempDimensionId = 0; + } + new WorldGenContainer(aX * 16, aZ * 16, tempDimensionId, aWorld, aChunkGenerator, aChunkProvider, aWorld.getBiomeGenForCoords((aX * 16) + 8, (aZ * 16) + 8).biomeName).run(); + } + + public static class WorldGenContainer implements Runnable { + public int mX; + public int mZ; + public final int mDimensionType; + public final World mWorld; + public final IChunkProvider mChunkGenerator; + public final IChunkProvider mChunkProvider; + public final String mBiome; + public static HashSet mGenerated = new HashSet<>(2000); + + public WorldGenContainer(final int aX, final int aZ, final int aDimensionType, final World aWorld, final IChunkProvider aChunkGenerator, final IChunkProvider aChunkProvider, final String aBiome) { + this.mX = aX; + this.mZ = aZ; + this.mDimensionType = aDimensionType; + this.mWorld = aWorld; + this.mChunkGenerator = aChunkGenerator; + this.mChunkProvider = aChunkProvider; + this.mBiome = aBiome; + } + + //returns a coordinate of a center chunk of 3x3 square; the argument belongs to this square + public int getVeinCenterCoordinate(int c) { + c += c < 0 ? 1 : 3; + return c - (c % 3) - 2; + } + + public boolean surroundingChunksLoaded(final int xCenter, final int zCenter) { + return this.mWorld.checkChunksExist(xCenter - 16, 0, zCenter - 16, xCenter + 16, 0, zCenter + 16); + } + + public Random getRandom(final int xChunk, final int zChunk) { + final long worldSeed = this.mWorld.getSeed(); + final Random fmlRandom = new Random(worldSeed); + final long xSeed = fmlRandom.nextLong() >> (2 + 1L); + final long zSeed = fmlRandom.nextLong() >> (2 + 1L); + final long chunkSeed = ((xSeed * xChunk) + (zSeed * zChunk)) ^ worldSeed; + fmlRandom.setSeed(chunkSeed); + return new XSTR(fmlRandom.nextInt()); + } + + @Override + public void run() { + int xCenter = this.getVeinCenterCoordinate(this.mX >> 4); + int zCenter = this.getVeinCenterCoordinate(this.mZ >> 4); + final Random random = this.getRandom(xCenter, zCenter); + xCenter <<= 4; + zCenter <<= 4; + final ChunkCoordIntPair centerChunk = new ChunkCoordIntPair(xCenter, zCenter); + if (!mGenerated.contains(centerChunk) && this.surroundingChunksLoaded(xCenter, zCenter)) { + mGenerated.add(centerChunk); + if ((GT_Worldgen_GT_Ore_Layer.sWeight > 0) && (GT_Worldgen_GT_Ore_Layer.sList.size() > 0)) { + boolean temp = true; + int tRandomWeight; + for (int i = 0; (i < 256) && (temp); i++) { + tRandomWeight = random.nextInt(GT_Worldgen_GT_Ore_Layer.sWeight); + for (final GT_Worldgen tWorldGen : GT_Worldgen_GT_Ore_Layer.sList) { + tRandomWeight -= ((GT_Worldgen_GT_Ore_Layer) tWorldGen).mWeight; + if (tRandomWeight <= 0) { + try { + if (tWorldGen.executeWorldgen(this.mWorld, random, this.mBiome, this.mDimensionType, xCenter, zCenter, this.mChunkGenerator, this.mChunkProvider)) { + temp = false; + } + break; + } catch (final Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + } + } + } + int i = 0; + for (int tX = xCenter - 16; i < 3; tX += 16) { + int j = 0; + for (int tZ = zCenter - 16; j < 3; tZ += 16) { + try { + for (final GT_Worldgen tWorldGen : GregTech_API.sWorldgenList) { + tWorldGen.executeWorldgen(this.mWorld, random, this.mBiome, this.mDimensionType, tX, tZ, this.mChunkGenerator, this.mChunkProvider); + } + } catch (final Throwable e) { + e.printStackTrace(GT_Log.err); + } + j++; + } + i++; + } + } + final Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ); + if (tChunk != null) { + tChunk.isModified = true; + } + } + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/command/regen/HANDLER_GT_Commands.java b/src/Java/gtPlusPlus/xmod/gregtech/common/command/regen/HANDLER_GT_Commands.java new file mode 100644 index 0000000000..6e3d4fda93 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/command/regen/HANDLER_GT_Commands.java @@ -0,0 +1,129 @@ +package gtPlusPlus.xmod.gregtech.common.command.regen; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import bloodasp.galacticgreg.GT_Worldgenerator_Space; +import cpw.mods.fml.common.Loader; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Materials; +import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; +import gregtech.common.GT_Worldgen_Stone; +import gregtech.common.GT_Worldgenerator; + +public class HANDLER_GT_Commands { + + public static void preInit(){ + + } + + public static void init(){ + + } + + public static void postInit(){ + final boolean tPFAA = (GregTech_API.sWorldgenFile.get(ConfigCategories.general, "AutoDetectPFAA", true)) && (Loader.isModLoaded("PFAAGeologica")); + new GT_Worldgenerator(); + if (Loader.isModLoaded("GalacticraftCore") && Loader.isModLoaded("GalacticraftMars")) { + new GT_Worldgenerator_Space(); + } + + new GT_Worldgen_Stone("overworld.stone.blackgranite.tiny", true, GregTech_API.sBlockGranites, 0, 0, 1, 50, 48, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.blackgranite.small", true, GregTech_API.sBlockGranites, 0, 0, 1, 100, 96, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.blackgranite.medium", true, GregTech_API.sBlockGranites, 0, 0, 1, 200, 144, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.blackgranite.large", true, GregTech_API.sBlockGranites, 0, 0, 1, 300, 192, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.blackgranite.huge", true, GregTech_API.sBlockGranites, 0, 0, 1, 400, 240, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.redgranite.tiny", true, GregTech_API.sBlockGranites, 8, 0, 1, 50, 48, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.redgranite.small", true, GregTech_API.sBlockGranites, 8, 0, 1, 100, 96, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.redgranite.medium", true, GregTech_API.sBlockGranites, 8, 0, 1, 200, 144, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.redgranite.large", true, GregTech_API.sBlockGranites, 8, 0, 1, 300, 192, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.redgranite.huge", true, GregTech_API.sBlockGranites, 8, 0, 1, 400, 240, 0, 120, null, false); + + new GT_Worldgen_Stone("nether.stone.blackgranite.tiny", false, GregTech_API.sBlockGranites, 0, -1, 1, 50, 48, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.blackgranite.small", false, GregTech_API.sBlockGranites, 0, -1, 1, 100, 96, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.blackgranite.medium", false, GregTech_API.sBlockGranites, 0, -1, 1, 200, 144, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.blackgranite.large", false, GregTech_API.sBlockGranites, 0, -1, 1, 300, 192, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.blackgranite.huge", false, GregTech_API.sBlockGranites, 0, -1, 1, 400, 240, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.redgranite.tiny", false, GregTech_API.sBlockGranites, 8, -1, 1, 50, 48, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.redgranite.small", false, GregTech_API.sBlockGranites, 8, -1, 1, 100, 96, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.redgranite.medium", false, GregTech_API.sBlockGranites, 8, -1, 1, 200, 144, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.redgranite.large", false, GregTech_API.sBlockGranites, 8, -1, 1, 300, 192, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.redgranite.huge", false, GregTech_API.sBlockGranites, 8, -1, 1, 400, 240, 0, 120, null, false); + + new GT_Worldgen_Stone("overworld.stone.marble.tiny", true, GregTech_API.sBlockStones, 0, 0, 1, 50, 48, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.marble.small", true, GregTech_API.sBlockStones, 0, 0, 1, 100, 96, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.marble.medium", true, GregTech_API.sBlockStones, 0, 0, 1, 200, 144, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.marble.large", true, GregTech_API.sBlockStones, 0, 0, 1, 300, 192, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.marble.huge", true, GregTech_API.sBlockStones, 0, 0, 1, 400, 240, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.basalt.tiny", true, GregTech_API.sBlockStones, 8, 0, 1, 50, 48, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.basalt.small", true, GregTech_API.sBlockStones, 8, 0, 1, 100, 96, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.basalt.medium", true, GregTech_API.sBlockStones, 8, 0, 1, 200, 144, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.basalt.large", true, GregTech_API.sBlockStones, 8, 0, 1, 300, 192, 0, 120, null, false); + new GT_Worldgen_Stone("overworld.stone.basalt.huge", true, GregTech_API.sBlockStones, 8, 0, 1, 400, 240, 0, 120, null, false); + + new GT_Worldgen_Stone("nether.stone.marble.tiny", false, GregTech_API.sBlockStones, 0, -1, 1, 50, 48, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.marble.small", false, GregTech_API.sBlockStones, 0, -1, 1, 100, 96, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.marble.medium", false, GregTech_API.sBlockStones, 0, -1, 1, 200, 144, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.marble.large", false, GregTech_API.sBlockStones, 0, -1, 1, 300, 192, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.marble.huge", false, GregTech_API.sBlockStones, 0, -1, 1, 400, 240, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.basalt.tiny", false, GregTech_API.sBlockStones, 8, -1, 1, 50, 48, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.basalt.small", false, GregTech_API.sBlockStones, 8, -1, 1, 100, 96, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.basalt.medium", false, GregTech_API.sBlockStones, 8, -1, 1, 200, 144, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.basalt.large", false, GregTech_API.sBlockStones, 8, -1, 1, 300, 192, 0, 120, null, false); + new GT_Worldgen_Stone("nether.stone.basalt.huge", false, GregTech_API.sBlockStones, 8, -1, 1, 400, 240, 0, 120, null, false); + + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.copper", true, 60, 120, 32, !tPFAA, true, true, true, true, false, Materials.Copper); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.tin", true, 60, 120, 32, !tPFAA, true, true, true, true, true, Materials.Tin); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.bismuth", true, 80, 120, 8, !tPFAA, true, false, true, true, false, Materials.Bismuth); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.coal", true, 60, 100, 24, !tPFAA, false, false, false, false, false, Materials.Coal); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.iron", true, 40, 80, 16, !tPFAA, true, true, true, true, false, Materials.Iron); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.lead", true, 40, 80, 16, !tPFAA, true, true, true, true, true, Materials.Lead); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.zinc", true, 30, 60, 12, !tPFAA, true, true, true, true, false, Materials.Zinc); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.gold", true, 20, 40, 8, !tPFAA, true, true, true, true, true, Materials.Gold); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.silver", true, 20, 40, 8, !tPFAA, true, true, true, true, true, Materials.Silver); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.nickel", true, 20, 40, 8, !tPFAA, true, true, true, true, true, Materials.Nickel); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.lapis", true, 20, 40, 4, !tPFAA, false, false, true, false, true, Materials.Lapis); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.diamond", true, 5, 10, 2, !tPFAA, true, false, true, true, true, Materials.Diamond); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.emerald", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.Emerald); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.ruby", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.Ruby); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.sapphire", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.Sapphire); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.greensapphire", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.GreenSapphire); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.olivine", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.Olivine); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.topaz", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.Topaz); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.tanzanite", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.Tanzanite); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.amethyst", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.Amethyst); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.opal", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.Opal); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.jasper", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.Jasper); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.bluetopaz", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.BlueTopaz); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.amber", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.Amber); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.foolsruby", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.FoolsRuby); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.garnetred", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.GarnetRed); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.garnetyellow", true, 5, 250, 1, !tPFAA, true, false, false, true, true, Materials.GarnetYellow); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.redstone", true, 5, 20, 8, !tPFAA, true, false, true, true, true, Materials.Redstone); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.platinum", true, 20, 40, 8, false, false, true, false, true, true, Materials.Platinum); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.iridium", true, 20, 40, 8, false, false, true, false, true, true, Materials.Iridium); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.netherquartz", true, 30, 120, 64, false, true, false, false, false, false, Materials.NetherQuartz); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.saltpeter", true, 10, 60, 8, false, true, false, false, false, false, Materials.Saltpeter); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.sulfur_n", true, 10, 60, 32, false, true, false, false, false, false, Materials.Sulfur); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.sulfur_o", true, 5, 15, 8, !tPFAA, false, false, false, false, false, Materials.Sulfur); + + int i = 0; + for (final int j = GregTech_API.sWorldgenFile.get("worldgen", "AmountOfCustomSmallOreSlots", 16); i < j; i++) { + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.custom." + (i < 10 ? "0" : "") + i, false, 0, 0, 0, false, false, false, false, false, false, Materials._NULL); + } + if (GregTech_API.mImmersiveEngineering && GT_Mod.gregtechproxy.mImmersiveEngineeringRecipes) { + Class rC; + try { + rC = Class.forName("blusunrize.immersiveengineering.api.tool.ExcavatorHandler"); + final Method method = rC.getMethod("recalculateChances", new Class[]{boolean.class}); + method.invoke(null, true); + } + catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + } + } + } + + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java index 647b4c8a2a..bdb514ba84 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java @@ -10,7 +10,6 @@ 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_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -18,13 +17,14 @@ import gregtech.api.util.Recipe_GT; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; +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_AlloyBlastSmelter -extends GT_MetaTileEntity_MultiBlockBase { +extends GregtechMeta_MultiBlockBase { private int mHeatingCapacity = 0; public GregtechMetaTileEntity_AlloyBlastSmelter(final int aID, final String aName, final String aNameRegional) { @@ -55,6 +55,7 @@ extends GT_MetaTileEntity_MultiBlockBase { "1x Energy Hatch (one of bottom)", "1x Maintenance Hatch (one of bottom)", "1x Muffler Hatch (top middle)", + "1x Fluid Input Hatch (optional, top layer)", "Blast Smelter Casings for the rest", CORE.GT_Tooltip}; } @@ -81,17 +82,19 @@ extends GT_MetaTileEntity_MultiBlockBase { public boolean isCorrectMachinePart(final ItemStack aStack) { return true; } - - public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { - super.startSoundLoop(aIndex, aX, aY, aZ); - if (aIndex == 1) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(208)), 10, 1.0F, aX, aY, aZ); - } - } - public void startProcess() { - sendLoopStart((byte) 1); - } + @Override + public void startSoundLoop(final byte aIndex, final double aX, final double aY, final double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 1) { + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(208)), 10, 1.0F, aX, aY, aZ); + } + } + + @Override + public void startProcess() { + this.sendLoopStart((byte) 1); + } @Override public boolean isFacingValid(final byte aFacing) { @@ -192,11 +195,13 @@ extends GT_MetaTileEntity_MultiBlockBase { if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != 14) { return false; } - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != ModBlocks.blockCasingsMisc) { - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 15) { - return false; + if (!this.addFluidInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j), 11)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != ModBlocks.blockCasingsMisc) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 15) { + return false; + } } } } @@ -218,11 +223,11 @@ extends GT_MetaTileEntity_MultiBlockBase { } this.mHeatingCapacity += 100 * (GT_Utility.getTier(this.getMaxInputVoltage()) - 2); - if ( this.mMaintenanceHatches.size() != 1 || - this.mMufflerHatches.size() != 1 || - this.mInputBusses.size() < 1 || - this.mOutputHatches.size() < 1 || - this.mEnergyHatches.size() != 1 ) { + if ( (this.mMaintenanceHatches.size() != 1) || + (this.mMufflerHatches.size() != 1) || + (this.mInputBusses.size() < 1) || + (this.mOutputHatches.size() < 1) || + (this.mEnergyHatches.size() != 1) ) { return false; } @@ -244,6 +249,7 @@ extends GT_MetaTileEntity_MultiBlockBase { return 0; } + @Override public int getAmountOfOutputs() { return 2; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java index d66649850a..6d1da0881e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java @@ -4,13 +4,19 @@ import java.util.ArrayList; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; +import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.material.*; +import gtPlusPlus.core.material.ALLOY; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.material.MaterialStack; import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.material.nuclear.NUCLIDE; +import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.item.ItemUtils; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; public class RecipeGen_BlastSmelter implements Runnable{ @@ -87,10 +93,10 @@ public class RecipeGen_BlastSmelter implements Runnable{ } if (duration <= 0){ - int second = 20; + final int second = 20; duration = 14*second*mMaterialListSize; } - + Utils.LOG_WARNING("[BAS] Size: "+mMaterialListSize); @@ -125,7 +131,7 @@ public class RecipeGen_BlastSmelter implements Runnable{ } if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, duration/9, 120)){ Utils.LOG_WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); - } + } } } else { @@ -189,11 +195,21 @@ public class RecipeGen_BlastSmelter implements Runnable{ //Builds me an ItemStack[] of the materials. - Without a circuit - this gets a good count for the 144L fluid multiplier components = new ItemStack[9]; inputStackCount=0; + FluidStack componentsFluid = null; for (int irc=0;irc 0) && (xr <= 100)){ + final int mathmatics = (xr <= 10 ? 1000 : ((xr/10)*1000)); + componentsFluid = FluidUtils.getFluidStack(M.getComposites().get(irc).getStackMaterial().getFluid(mathmatics), mathmatics); + } + } + else { + components[irc] = M.getComposites().get(irc).getDustStack(r); + } } } @@ -230,7 +246,7 @@ public class RecipeGen_BlastSmelter implements Runnable{ //Adds Recipe if (M.requiresBlastFurnace()) { - if (CORE.RA.addBlastSmelterRecipe(components, M.getFluid(fluidAmount), 100, duration, 500)){ + if (CORE.RA.addBlastSmelterRecipe(components, componentsFluid, M.getFluid(fluidAmount), 100, duration, 500)){ Utils.LOG_WARNING("[BAS] Success."); } else { @@ -238,7 +254,7 @@ public class RecipeGen_BlastSmelter implements Runnable{ } } else { - if (CORE.RA.addBlastSmelterRecipe(components, M.getFluid(fluidAmount), 100, duration, 240)){ + if (CORE.RA.addBlastSmelterRecipe(components, componentsFluid, M.getFluid(fluidAmount), 100, duration, 240)){ Utils.LOG_WARNING("[BAS] Success."); } else { -- cgit From dd3c71beeee4105829678a15f0b333bc0feb92c5 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Wed, 22 Nov 2017 14:07:05 +1000 Subject: $ Small fixes to previously added ABS recipes. --- src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 39d09935d2..4f83afa197 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -233,10 +233,11 @@ public class RECIPES_GREGTECH { ItemUtils.getItemStackOfAmountFromOreDict("dustIridium", 3), ItemUtils.getItemStackOfAmountFromOreDict("dustOsmium", 1) }, + Materials.Helium.getGas(1000), FluidUtils.getFluidStack("molten.osmiridium", 4*144), 0, - MathUtils.findPercentageOfInt(1920*20, 80), - 500); + MathUtils.findPercentageOfInt(500*20, 80), + 1920); //Naq Alloy CORE.RA.addBlastSmelterRecipe( @@ -245,10 +246,11 @@ public class RECIPES_GREGTECH { ItemUtils.getItemStackOfAmountFromOreDict("dustNaquadah", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustOsmiridium", 1) }, + Materials.Argon.getGas(1000), FluidUtils.getFluidStack("molten.naquadahalloy", 2*144), 0, - MathUtils.findPercentageOfInt(30720*20, 80), - 500); + MathUtils.findPercentageOfInt(500*20, 80), + 30720); //Nickel-Zinc-Ferrite if (Materials.get("NickelZincFerrite") != null){ @@ -300,7 +302,7 @@ public class RECIPES_GREGTECH { }, FluidUtils.getFluidStack("molten.tungstencarbide", 2*144), 0, - MathUtils.findPercentageOfInt((int) Math.max(Materials.TungstenCarbide.getMass() / 40L, 1L) * Materials.TungstenCarbide.mBlastFurnaceTemp*20, 80), + MathUtils.findPercentageOfInt((int) Math.max(Materials.TungstenCarbide.getMass() / 40L, 1L) * Materials.TungstenCarbide.mBlastFurnaceTemp, 80), 480); } @@ -309,13 +311,13 @@ public class RECIPES_GREGTECH { if (Materials.get("VanadiumGallium") != null){ CORE.RA.addBlastSmelterRecipe( new ItemStack[]{ - ItemUtils.getGregtechCircuit(2), + ItemUtils.getGregtechCircuit(12), ItemUtils.getItemStackOfAmountFromOreDict("dustGallium", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustVanadium", 3) }, FluidUtils.getFluidStack("molten.vanadiumgallium", 4*144), 0, - MathUtils.findPercentageOfInt((int) Math.max(Materials.VanadiumGallium.getMass() / 40L, 1L) * Materials.VanadiumGallium.mBlastFurnaceTemp*20, 80), + MathUtils.findPercentageOfInt((int) Math.max(Materials.VanadiumGallium.getMass() / 40L, 1L) * Materials.VanadiumGallium.mBlastFurnaceTemp, 80), 480); } -- cgit From b86f9e013b478725a3772b98e67490a3f2a044f6 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Thu, 23 Nov 2017 17:06:21 +1000 Subject: + Added Ink Sacs to Fish trap loot. + Added recycling recipes for all material components. + Added EnderIO alloys to the Alloy Blast Smelter. - Reduced rate of Sand from Fish Trap by 5%. - Removed some logging. $ Fixed Tooltip of Large Sifter stating it only required 9 Sieves, now says 18 as intended. $ Fixed Recipe Recycling not working as intended. --- .../core/material/MaterialGenerator.java | 24 ++- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 54 ++++-- .../tileentities/general/TileEntityFishTrap.java | 127 +++++++------ .../GregtechMetaTileEntity_IndustrialSifter.java | 96 +++++----- .../gregtech/loaders/RecipeGen_DustGeneration.java | 10 +- .../xmod/gregtech/loaders/RecipeGen_Recycling.java | 197 +++++++++++++++++++++ 6 files changed, 369 insertions(+), 139 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index 0b6848846b..6e529b3e92 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -19,8 +19,15 @@ import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.item.ItemUtils; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; -import gtPlusPlus.xmod.gregtech.loaders.*; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_AlloySmelter; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Assembler; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_BlastSmelter; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_DustGeneration; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Extruder; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Fluids; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plates; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_ShapedCrafting; import net.minecraft.block.Block; import net.minecraft.item.Item; @@ -49,7 +56,7 @@ public class MaterialGenerator { } int sRadiation = 0; - if (ItemUtils.isRadioactive(materialName) || matInfo.vRadiationLevel != 0){ + if (ItemUtils.isRadioactive(materialName) || (matInfo.vRadiationLevel != 0)){ sRadiation = matInfo.vRadiationLevel; } @@ -121,7 +128,7 @@ public class MaterialGenerator { temp = new BaseItemNugget(matInfo); temp = new BaseItemPlate(matInfo); temp = new BaseItemPlateDouble(matInfo); - } + } else if (matInfo.getState() == MaterialState.PURE_LIQUID){ FluidUtils.generateFluidNoPrefix(unlocalizedName, materialName, matInfo.getMeltingPointK(), C); return true; @@ -138,8 +145,9 @@ public class MaterialGenerator { RecipeGen_Fluids.generateRecipes(matInfo); RecipeGen_Plates.generateRecipes(matInfo); RecipeGen_ShapedCrafting.generateRecipes(matInfo); + RecipeGen_Recycling.generateRecipes(matInfo); return true; - } catch (Throwable t) + } catch (final Throwable t) { Utils.LOG_INFO(""+matInfo.getLocalizedName()+" failed to generate."); return false; @@ -158,7 +166,7 @@ public class MaterialGenerator { } int sRadiation = 0; - if (ItemUtils.isRadioactive(materialName) || matInfo.vRadiationLevel != 0){ + if (ItemUtils.isRadioactive(materialName) || (matInfo.vRadiationLevel != 0)){ sRadiation = matInfo.vRadiationLevel; } @@ -172,6 +180,7 @@ public class MaterialGenerator { //Add A jillion Recipes - old code RecipeGen_DustGeneration.addMixerRecipe_Standalone(matInfo); RecipeGen_Fluids.generateRecipes(matInfo); + //RecipeGen_Recycling.generateRecipes(matInfo); } public static void generateNuclearMaterial(final Material matInfo){ @@ -209,7 +218,8 @@ public class MaterialGenerator { RecipeGen_Fluids.generateRecipes(matInfo); RecipeGen_Assembler.generateRecipes(matInfo); RecipeGen_DustGeneration.generateRecipes(matInfo, true); - } catch (Throwable t){ + RecipeGen_Recycling.generateRecipes(matInfo); + } catch (final Throwable t){ Utils.LOG_INFO(""+matInfo.getLocalizedName()+" failed to generate."); } } diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 4f83afa197..365218e28e 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -280,18 +280,6 @@ public class RECIPES_GREGTECH { 120); } - - - - - - - - - - - - //TungstenCarbide if (Materials.get("TungstenCarbide") != null){ CORE.RA.addBlastSmelterRecipe( @@ -332,9 +320,49 @@ public class RECIPES_GREGTECH { }, FluidUtils.getFluidStack("molten.darksteel", 2*144), 0, - MathUtils.findPercentageOfInt(500*20, 80), + MathUtils.findPercentageOfInt(200*20, 80), 120); } + //Pulsating Iron + if (ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 1) != ItemUtils.getSimpleStack(ModItems.AAA_Broken)){ + CORE.RA.addBlastSmelterRecipe( + new ItemStack[]{ + ItemUtils.getGregtechCircuit(2), + ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 1), + ItemUtils.getSimpleStack(Items.ender_pearl) + }, + FluidUtils.getFluidStack("molten.pulsatingiron", 2*144), + 0, + MathUtils.findPercentageOfInt(8*20, 80), + 120); + } + //Energetic Alloy + if (ItemUtils.getItemStackOfAmountFromOreDict("dustEnergeticAlloy", 1) != ItemUtils.getSimpleStack(ModItems.AAA_Broken)){ + CORE.RA.addBlastSmelterRecipe( + new ItemStack[]{ + ItemUtils.getGregtechCircuit(12), + ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 1), + ItemUtils.getSimpleStack(Items.glowstone_dust) + }, + FluidUtils.getFluidStack("molten.redstone", 144), + FluidUtils.getFluidStack("molten.energeticalloy", 144), + 0, + MathUtils.findPercentageOfInt(9*20, 80), + 120); + } + //Vibrant Alloy + if (ItemUtils.getItemStackOfAmountFromOreDict("dustVibrantAlloy", 1) != ItemUtils.getSimpleStack(ModItems.AAA_Broken)){ + CORE.RA.addBlastSmelterRecipe( + new ItemStack[]{ + ItemUtils.getGregtechCircuit(12), + ItemUtils.getItemStackOfAmountFromOreDict("dustEnergeticAlloy", 1), + ItemUtils.getSimpleStack(Items.ender_pearl) + }, + FluidUtils.getFluidStack("molten.vibrantalloy", 144), + 0, + MathUtils.findPercentageOfInt(16*20, 80), + 480); + } } diff --git a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java index bd2f8b727c..d73de219e4 100644 --- a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java +++ b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java @@ -9,7 +9,6 @@ import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.xmod.gregtech.api.objects.XSTR; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -101,24 +100,24 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory { int checkingSlot = 0; final ItemStack loot = this.generateLootForFishTrap().copy(); try { - //Utils.LOG_INFO("Trying to add "+loot.getDisplayName()+" | "+loot.getItemDamage()); + //Utils.LOG_WARNING("Trying to add "+loot.getDisplayName()+" | "+loot.getItemDamage()); for (final ItemStack contents : this.getInventory().getInventory()) { if (GT_Utility.areStacksEqual(loot, contents)){ if (contents.stackSize < contents.getMaxStackSize()) { - //Utils.LOG_INFO("3-Trying to add one more "+loot.getDisplayName()+"meta: "+loot.getItemDamage()+" to an existing stack of "+contents.getDisplayName()+" with a size of "+contents.stackSize); + //Utils.LOG_WARNING("3-Trying to add one more "+loot.getDisplayName()+"meta: "+loot.getItemDamage()+" to an existing stack of "+contents.getDisplayName()+" with a size of "+contents.stackSize); contents.stackSize++; this.markDirty(); - return true; + return true; } } checkingSlot++; } checkingSlot = 0; for (final ItemStack contents : this.getInventory().getInventory()) { - if (contents == null) { - //Utils.LOG_INFO("Adding Item To Empty Slot. "+(checkingSlot+1)); + if (contents == null) { + //Utils.LOG_WARNING("Adding Item To Empty Slot. "+(checkingSlot+1)); this.getInventory().setInventorySlotContents(checkingSlot, loot); this.markDirty(); return true; @@ -126,7 +125,7 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory { checkingSlot++; } } - catch (NullPointerException n) { + catch (final NullPointerException n) { } } this.markDirty(); @@ -142,9 +141,12 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory { else if (lootWeight <= 10) { loot = ItemUtils.getSimpleStack(Items.bone); } - else if (lootWeight <= 20) { + else if (lootWeight <= 15) { loot = ItemUtils.getSimpleStack(Blocks.sand); } + else if (lootWeight <= 20) { + loot = ItemUtils.simpleMetaStack(Items.dye, 0, 1); + } // Junk Loot else if (lootWeight <= 23) { if (LoadedMods.PamsHarvestcraft) { @@ -156,12 +158,12 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory { } // Pam Fish else if (lootWeight <= 99) { - Random xstr = new Random(); + final Random xstr = new Random(); loot = FishingHooks.getRandomFishable(xstr, 100); } else if (lootWeight == 100){ - int rareLoot = MathUtils.randInt(1, 10); + final int rareLoot = MathUtils.randInt(1, 10); if (rareLoot <= 4) { loot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nuggetIron", 1); if (loot == null){ @@ -173,7 +175,7 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory { if (loot == null){ loot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotGold", 1); } - } + } else if (rareLoot <= 9){ loot = ItemUtils.getSimpleStack(Items.emerald); } @@ -192,47 +194,47 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory { @Override public void updateEntity() { try{ - if (!this.worldObj.isRemote) { - this.tickCount++; - // Utils.LOG_WARNING("Ticking "+this.tickCount); - // Check if the Tile is within water once per second. - if ((this.tickCount % 20) == 0) { - this.isInWater = this.isSurroundedByWater(); - } - else { - - } + if (!this.worldObj.isRemote) { + this.tickCount++; + // Utils.LOG_WARNING("Ticking "+this.tickCount); + // Check if the Tile is within water once per second. + if ((this.tickCount % 20) == 0) { + this.isInWater = this.isSurroundedByWater(); + } + else { - if (this.isInWater) { - this.calculateTickrate(); - } + } - // Try add some loot once every 30 seconds. - if ((this.tickCount % this.baseTickRate) == 0) { if (this.isInWater) { - // Add loot - // Utils.LOG_WARNING("Adding Loot to the fishtrap at - // x["+this.locationX+"] y["+this.locationY+"] - // z["+this.locationZ+"] (Ticking for loot every - // "+this.baseTickRate+" ticks)"); - this.tryAddLoot(); - this.markDirty(); + this.calculateTickrate(); } - else { - Utils.LOG_INFO("This Trap does not have enough water around it."); - Utils.LOG_WARNING("Not adding Loot to the fishtrap at x[" + this.locationX + "] y[" + this.locationY - + "] z[" + this.locationZ + "] (Ticking for loot every " + this.baseTickRate + " ticks)"); - this.markDirty(); + + // Try add some loot once every 30 seconds. + if ((this.tickCount % this.baseTickRate) == 0) { + if (this.isInWater) { + // Add loot + // Utils.LOG_WARNING("Adding Loot to the fishtrap at + // x["+this.locationX+"] y["+this.locationY+"] + // z["+this.locationZ+"] (Ticking for loot every + // "+this.baseTickRate+" ticks)"); + this.tryAddLoot(); + this.markDirty(); + } + else { + Utils.LOG_WARNING("This Trap does not have enough water around it."); + Utils.LOG_WARNING("Not adding Loot to the fishtrap at x[" + this.locationX + "] y[" + this.locationY + + "] z[" + this.locationZ + "] (Ticking for loot every " + this.baseTickRate + " ticks)"); + this.markDirty(); + } + this.tickCount = 0; + } + if (this.tickCount > (this.baseTickRate + 500)) { + this.tickCount = 0; } - this.tickCount = 0; - } - if (this.tickCount > (this.baseTickRate + 500)) { - this.tickCount = 0; - } + } } - } - catch (Throwable t){} + catch (final Throwable t){} } public void calculateTickrate() { @@ -293,13 +295,6 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory { "Crayfish", "Eel", "Frog", "Grouper", "Herring", "Jellyfish", "Mudfish", "Octopus", "Perch", "Scallop", "Shrimp", "Snail", "Snapper", "Tilapia", "Trout", "Tuna", "Turtle", "Walleye" }; - private static final ItemStack[] minecraftFish = { - ItemUtils.simpleMetaStack(Items.fish, 0, 1).copy(), - ItemUtils.simpleMetaStack(Items.fish, 1, 1).copy(), - ItemUtils.simpleMetaStack(Items.fish, 2, 1).copy(), - ItemUtils.simpleMetaStack(Items.fish, 3, 1).copy() - }; - public static void pamsHarvestCraftCompat() { for (int i = 0; i < harvestcraftFish.length; i++) { @@ -312,22 +307,22 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory { } @Override - public ItemStack getStackInSlot(int slot) { + public ItemStack getStackInSlot(final int slot) { return this.getInventory().getStackInSlot(slot); } @Override - public ItemStack decrStackSize(int slot, int count) { + public ItemStack decrStackSize(final int slot, final int count) { return this.getInventory().decrStackSize(slot, count); } @Override - public ItemStack getStackInSlotOnClosing(int slot) { + public ItemStack getStackInSlotOnClosing(final int slot) { return this.getInventory().getStackInSlotOnClosing(slot); } @Override - public void setInventorySlotContents(int slot, ItemStack stack) { + public void setInventorySlotContents(final int slot, final ItemStack stack) { this.getInventory().setInventorySlotContents(slot, stack); } @@ -337,7 +332,7 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory { } @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) { + public boolean isUseableByPlayer(final EntityPlayer entityplayer) { return this.getInventory().isUseableByPlayer(entityplayer); } @@ -346,7 +341,7 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory { this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1); this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType()); - this.getInventory().openInventory(); + this.getInventory().openInventory(); } @Override @@ -354,17 +349,17 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory { this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1); this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType()); - this.getInventory().closeInventory(); + this.getInventory().closeInventory(); } @Override - public boolean isItemValidForSlot(int slot, ItemStack itemstack) { + public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) { return this.getInventory().isItemValidForSlot(slot, itemstack); } @Override - public int[] getAccessibleSlotsFromSide(int p_94128_1_) { - int[] accessibleSides = new int[this.getSizeInventory()]; + public int[] getAccessibleSlotsFromSide(final int p_94128_1_) { + final int[] accessibleSides = new int[this.getSizeInventory()]; for (int r=0; r 0) && (tValidOutputSlots >= 1)) { - if ((cloneRecipe != null) && (cloneRecipe.isRecipeInputEqual(true, null, tInputs))) { - Utils.LOG_WARNING("Valid Recipe found - size "+cloneRecipe.mOutputs.length); + if ((this.cloneRecipe != null) && (this.cloneRecipe.isRecipeInputEqual(true, null, tInputs))) { + Utils.LOG_WARNING("Valid Recipe found - size "+this.cloneRecipe.mOutputs.length); this.mEfficiency = (10000 - ((this.getIdealStatus() - this.getRepairStatus()) * 1000)); this.mEfficiencyIncrease = 10000; - this.mEUt = (-cloneRecipe.mEUt); - this.mMaxProgresstime = Math.max(1, (cloneRecipe.mDuration/5)); - final ItemStack[] outputs = new ItemStack[cloneRecipe.mOutputs.length]; - for (int i = 0; i < cloneRecipe.mOutputs.length; i++){ - if (this.getBaseMetaTileEntity().getRandomNumber(7500) < cloneRecipe.getOutputChance(i)){ + this.mEUt = (-this.cloneRecipe.mEUt); + this.mMaxProgresstime = Math.max(1, (this.cloneRecipe.mDuration/5)); + final ItemStack[] outputs = new ItemStack[this.cloneRecipe.mOutputs.length]; + for (int i = 0; i < this.cloneRecipe.mOutputs.length; i++){ + if (this.getBaseMetaTileEntity().getRandomNumber(7500) < this.cloneRecipe.getOutputChance(i)){ Utils.LOG_WARNING("Adding a bonus output"); - outputs[i] = cloneRecipe.getOutput(i); + outputs[i] = this.cloneRecipe.getOutput(i); } else { Utils.LOG_WARNING("Adding null output"); @@ -255,7 +255,7 @@ extends GregtechMeta_MultiBlockBase { final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; int tAmount = 0; - controller = false; + this.controller = false; for (int i = -2; i < 3; i++) { for (int j = -2; j < 3; j++) { for (int h = 0; h < 3; h++) { @@ -275,7 +275,7 @@ extends GregtechMeta_MultiBlockBase { // Sifter Floor/Roof inner 3x3 if (((i != -2) && (i != 2)) && ((j != -2) && (j != 2))) { - if (h != 0){ + if (h != 0){ if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(21))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) { Utils.LOG_MACHINE_INFO("Sifter Casing(s) Missing from one of the "+sHeight+" layers inner 3x3."); @@ -302,12 +302,12 @@ extends GregtechMeta_MultiBlockBase { tAmount++; } } - } + } else { //Dealt with inner 5x5, now deal with the exterior. //Deal with all 4 sides (Sifter walls) boolean checkController = false; - if (((xDir + i) != 0) || ((zDir + j) != 0) && h == 0) {//no controller + if (((xDir + i) != 0) || (((zDir + j) != 0) && (h == 0))) {//no controller checkController = true; } else { @@ -317,7 +317,7 @@ extends GregtechMeta_MultiBlockBase { if (!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(21))) { if (!checkController){ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasings2Misc) { - if (tTileEntity instanceof GregtechMetaTileEntity_IndustrialSifter || aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == GregTech_API.sBlockMachines){ + if ((tTileEntity instanceof GregtechMetaTileEntity_IndustrialSifter) || (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == GregTech_API.sBlockMachines)){ if (h != 0){ Utils.LOG_MACHINE_INFO("Found a secondary controller at the wrong Y level."); return false; @@ -328,24 +328,24 @@ extends GregtechMeta_MultiBlockBase { Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getLocalizedName()); return false; } - } - - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 5) { - if (tTileEntity instanceof GregtechMetaTileEntity_IndustrialSifter || aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == GregTech_API.sBlockMachines){ - } - else { - Utils.LOG_MACHINE_INFO("Sifter Casings Missing from somewhere in the "+sHeight+" layer edge."); - Utils.LOG_MACHINE_INFO("Incorrect Meta value for block, expected 5."); - Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)+"."); - return false; + + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 5) { + if ((tTileEntity instanceof GregtechMetaTileEntity_IndustrialSifter) || (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == GregTech_API.sBlockMachines)){ + + } + else { + Utils.LOG_MACHINE_INFO("Sifter Casings Missing from somewhere in the "+sHeight+" layer edge."); + Utils.LOG_MACHINE_INFO("Incorrect Meta value for block, expected 5."); + Utils.LOG_MACHINE_INFO("Instead, found "+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j)+"."); + return false; + } } } - } - tAmount++; + tAmount++; } else { - tAmount++; + tAmount++; } } } @@ -383,7 +383,7 @@ extends GregtechMeta_MultiBlockBase { } public boolean ignoreController(final Block tTileEntity) { - if (!controller && (tTileEntity == GregTech_API.sBlockMachines)) { + if (!this.controller && (tTileEntity == GregTech_API.sBlockMachines)) { return true; } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java index a8a4cf963f..46bf36c445 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java @@ -177,7 +177,7 @@ public class RecipeGen_DustGeneration implements Runnable{ //Add Shapeless recipe for low tier alloys. if (tVoltageMultiplier <= 30){ if (RecipeUtils.addShapedGregtechRecipe(inputStacks, outputStacks)){ - Utils.LOG_INFO("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Success"); + Utils.LOG_INFO("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Success"); } else { Utils.LOG_INFO("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Failed"); @@ -194,7 +194,7 @@ public class RecipeGen_DustGeneration implements Runnable{ } - public static boolean addMixerRecipe_Standalone(Material material){ + public static boolean addMixerRecipe_Standalone(final Material material){ final ItemStack[] inputStacks = material.getMaterialComposites(); final ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing); //Is this a composite? @@ -264,14 +264,14 @@ public class RecipeGen_DustGeneration implements Runnable{ } else { Utils.LOG_INFO("inputStackSize == NUll - "+material.getLocalizedName()); - } + } } else { Utils.LOG_INFO("InputStacks is out range 1-4 - "+material.getLocalizedName()); - } + } } else { - Utils.LOG_INFO("InputStacks == NUll - "+material.getLocalizedName()); + Utils.LOG_INFO("InputStacks == NUll - "+material.getLocalizedName()); } return false; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java new file mode 100644 index 0000000000..cf48516354 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java @@ -0,0 +1,197 @@ +package gtPlusPlus.xmod.gregtech.loaders; + +import static gregtech.api.enums.GT_Values.M; + +import java.util.ArrayList; +import java.util.Map; + +import org.apache.commons.lang3.reflect.FieldUtils; + +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.item.ItemStack; + +public class RecipeGen_Recycling implements Runnable{ + + final Material toGenerate; + static Map mNameMap; + + public RecipeGen_Recycling(final Material M){ + this.toGenerate = M; + mNameMap = this.getNameMap(); + } + + @Override + public void run() { + generateRecipes(this.toGenerate); + } + + public static void generateRecipes(final Material material){ + + Utils.LOG_INFO("Generating Recycling recipes for "+material.getLocalizedName()); + + final OrePrefixes[] mValidPrefixesAsString = { + OrePrefixes.ingot, + OrePrefixes.ingotHot, + OrePrefixes.nugget, + OrePrefixes.plate, + OrePrefixes.plateDense, + OrePrefixes.plateDouble, + OrePrefixes.plateTriple, + OrePrefixes.plateQuadruple, + OrePrefixes.plateQuintuple, + OrePrefixes.stick, + OrePrefixes.stickLong, + OrePrefixes.bolt, + OrePrefixes.screw, + OrePrefixes.ring, + OrePrefixes.rotor, + OrePrefixes.gearGt, + OrePrefixes.gearGtSmall + }; + + Utils.LOG_INFO("Found "+mValidPrefixesAsString.length+" valid OreDict prefixes."); + if (mValidPrefixesAsString.length >= 1){ + for (final OrePrefixes validPrefix : mValidPrefixesAsString){ + + try { + final ItemStack tempStack = ItemUtils.getItemStackOfAmountFromOreDict(validPrefix+material.getLocalizedName(), 1); + + if ((tempStack != null) && (tempStack != ItemUtils.getSimpleStack(ModItems.AAA_Broken))){ + //mValidItems[mSlotIndex++] = tempStack; + final ItemStack mDust = getDust(material, validPrefix); + if ((mDust != null) && GT_ModHandler.addPulverisationRecipe(tempStack, mDust)){ + Utils.LOG_INFO("Recycle Recipe: "+material.getLocalizedName()+" - Success - Recycle "+tempStack.getDisplayName()+" and obtain "+mDust.getDisplayName()); + } + else { + Utils.LOG_INFO("Recycle Recipe: "+material.getLocalizedName()+" - Failed"); + if (mDust == null){ + Utils.LOG_INFO("Invalid Dust output."); + } + } + } + } catch (final Throwable t){ + t.printStackTrace(); + Utils.LOG_INFO("Returning Null. Throwable Info: "+t.getMessage()); + Utils.LOG_INFO("Throwable Info: "+t.toString()); + Utils.LOG_INFO("Throwable Info: "+t.getCause().toString()); + + } + + } + } + } + + + + public static ItemStack getDust(final Material aMaterial, final OrePrefixes aPrefix) { + return aMaterial == null ? null : getDust(aMaterial, aPrefix.mMaterialAmount); + } + + public static ItemStack getDust(final Material aMaterial, final long aMaterialAmount) { + if (aMaterialAmount <= 0) { + return null; + } + ItemStack rStack = null; + if ((((aMaterialAmount % M) == 0) || (aMaterialAmount >= (M * 16)))) { + rStack = get(OrePrefixes.dust, aMaterial, aMaterialAmount / M); + } + if ((rStack == null) && ((((aMaterialAmount * 4) % M) == 0) || (aMaterialAmount >= (M * 8)))) { + rStack = get(OrePrefixes.dustSmall, aMaterial, (aMaterialAmount * 4) / M); + } + if ((rStack == null) && (((aMaterialAmount * 9) >= M))) { + rStack = get(OrePrefixes.dustTiny, aMaterial, (aMaterialAmount * 9) / M); + } + if (rStack == null){ + Utils.LOG_INFO("Returning Null. Method: "+ReflectionUtils.getMethodName(0)); + Utils.LOG_INFO("Called from method: "+ReflectionUtils.getMethodName(1)); + Utils.LOG_INFO("Called from method: "+ReflectionUtils.getMethodName(2)); + } + + return rStack; + } + + public static ItemStack get(final Object aName, final long aAmount) { + return get(aName, null, aAmount, true, true); + } + + public static ItemStack get(final Object aName, final ItemStack aReplacement, final long aAmount) { + return get(aName, aReplacement, aAmount, true, true); + } + + public static ItemStack get(final OrePrefixes aPrefix, final Object aMaterial, final long aAmount) { + return get(aPrefix, aMaterial, null, aAmount); + } + + public static ItemStack get(final OrePrefixes aPrefix, final Object aMaterial, final ItemStack aReplacement, + final long aAmount) { + if (OrePrefixes.mPreventableComponents.contains(aPrefix) && aPrefix.mDisabledItems.contains(aMaterial)) { + return aReplacement; + } + return get(aPrefix.get(aMaterial), aReplacement, aAmount, false, true); + } + + public static ItemStack get(final Object aName, final ItemStack aReplacement, final long aAmount, + final boolean aMentionPossibleTypos, final boolean aNoInvalidAmounts) { + if (aNoInvalidAmounts && (aAmount < 1L)) { + Utils.LOG_INFO("Returning Null. Method: "+ReflectionUtils.getMethodName(0)); + Utils.LOG_INFO("Called from method: "+ReflectionUtils.getMethodName(1)); + Utils.LOG_INFO("Called from method: "+ReflectionUtils.getMethodName(2)); + return null; + } + if (!mNameMap.containsKey(aName.toString()) && aMentionPossibleTypos) { + Utils.LOG_INFO("Unknown Key for Unification, Typo? " + aName); + } + return GT_Utility.copyAmount(aAmount, new Object[]{mNameMap.get(aName.toString()), + getFirstOre(aName, aAmount), aReplacement}); + } + + + public static ItemStack getFirstOre(final Object aName, final long aAmount) { + if (GT_Utility.isStringInvalid(aName)) { + Utils.LOG_INFO("Returning Null. Method: "+ReflectionUtils.getMethodName(0)); + Utils.LOG_INFO("Called from method: "+ReflectionUtils.getMethodName(1)); + Utils.LOG_INFO("Called from method: "+ReflectionUtils.getMethodName(2)); + return null; + } + final ItemStack tStack = (ItemStack) mNameMap.get(aName.toString()); + if (GT_Utility.isStackValid(tStack)) { + return GT_Utility.copyAmount(aAmount, new Object[]{tStack}); + } + return GT_Utility.copyAmount(aAmount, getOres(aName).toArray()); + } + + public static ArrayList getOres(final Object aOreName) { + final String aName = (aOreName == null) ? "" : aOreName.toString(); + final ArrayList rList = new ArrayList(); + if (GT_Utility.isStringValid(aName)) { + rList.addAll(getOres(aName)); + } + return rList; + } + + public Map getNameMap(){ + Map tempMap; + try { + tempMap = (Map) FieldUtils.readStaticField(GT_OreDictUnificator.class, "sName2StackMap", true); + if (tempMap != null){ + return tempMap; + } + } + catch (final IllegalAccessException e) { + e.printStackTrace(); + } + Utils.LOG_INFO("Invalid map stored in GT_OreDictUnificator.class, unable to find sName2StackMap field."); + return null; + } + + + +} -- cgit From 9e4dcc750d9aa3c37d278aec7404a9ded134f0b6 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Sun, 26 Nov 2017 20:55:02 +1000 Subject: + Added Xp Converter crafting recipe. + Added compressed obsidian. + Added inverted obsidian. + Added crafting & uncrafting recipes for the compressed & inverted obsidian. % Formatting. --- src/Java/gtPlusPlus/core/block/ModBlocks.java | 3 + .../block/general/BlockCompressedObsidian.java | 90 +++++++++++++++ .../core/block/general/BlockTankXpConverter.java | 122 +++++++++++---------- .../core/item/base/itemblock/ItemBlockMeta.java | 44 ++++++++ .../gtPlusPlus/core/recipe/RECIPES_General.java | 43 +++++++- src/Java/gtPlusPlus/core/util/item/ItemUtils.java | 9 +- src/resources/assets/miscutils/lang/en_US.lang | 92 +++++----------- .../assets/miscutils/textures/blocks/SwirlGray.png | Bin 0 -> 270 bytes .../textures/blocks/compressed/obsidian1.png | Bin 0 -> 656 bytes .../textures/blocks/compressed/obsidian2.png | Bin 0 -> 757 bytes .../textures/blocks/compressed/obsidian3.png | Bin 0 -> 856 bytes .../textures/blocks/compressed/obsidian4.png | Bin 0 -> 1022 bytes .../textures/blocks/compressed/obsidian5.png | Bin 0 -> 1245 bytes .../textures/blocks/compressed/obsidian_invert.png | Bin 0 -> 770 bytes 14 files changed, 280 insertions(+), 123 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java create mode 100644 src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java create mode 100644 src/resources/assets/miscutils/textures/blocks/SwirlGray.png create mode 100644 src/resources/assets/miscutils/textures/blocks/compressed/obsidian1.png create mode 100644 src/resources/assets/miscutils/textures/blocks/compressed/obsidian2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/compressed/obsidian3.png create mode 100644 src/resources/assets/miscutils/textures/blocks/compressed/obsidian4.png create mode 100644 src/resources/assets/miscutils/textures/blocks/compressed/obsidian5.png create mode 100644 src/resources/assets/miscutils/textures/blocks/compressed/obsidian_invert.png (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java index 992cd7e991..770494c9f0 100644 --- a/src/Java/gtPlusPlus/core/block/ModBlocks.java +++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java @@ -3,6 +3,7 @@ package gtPlusPlus.core.block; import cpw.mods.fml.common.registry.GameRegistry; import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; import gtPlusPlus.core.block.base.BlockBaseOre; +import gtPlusPlus.core.block.general.BlockCompressedObsidian; import gtPlusPlus.core.block.general.BlockTankXpConverter; import gtPlusPlus.core.block.general.FirePit; import gtPlusPlus.core.block.general.FluidTankInfinite; @@ -60,6 +61,7 @@ public final class ModBlocks { public static Block blockWitherGuard; public static Block blockXpConverter; + public static Block blockCompressedObsidian; public static void init() { Utils.LOG_INFO("Initializing Blocks."); @@ -91,6 +93,7 @@ public final class ModBlocks { blockModularTable = new Machine_ModularityTable(); blockWitherGuard = new BlockWitherProof(); blockXpConverter = new BlockTankXpConverter(); + blockCompressedObsidian = new BlockCompressedObsidian(); } diff --git a/src/Java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java b/src/Java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java new file mode 100644 index 0000000000..48ee7709ec --- /dev/null +++ b/src/Java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java @@ -0,0 +1,90 @@ +package gtPlusPlus.core.block.general; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.item.base.itemblock.ItemBlockMeta; +import gtPlusPlus.core.lib.CORE; +import net.minecraft.block.BlockObsidian; +import net.minecraft.block.material.MapColor; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockCompressedObsidian extends BlockObsidian { + + @SideOnly(Side.CLIENT) + private final IIcon textureArray[] = new IIcon[6]; + + public BlockCompressedObsidian() { + this.setBlockName("blockCompressedObsidian"); + this.setCreativeTab(AddToCreativeTab.tabMachines); + GameRegistry.registerBlock(this, ItemBlockMeta.class, "blockCompressedObsidian"); + } + + @Override + public MapColor getMapColor(final int meta) { + if (meta != 5) { + return MapColor.obsidianColor; + } + else { + return MapColor.sandColor; + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister iicon) { + this.textureArray[0] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian1"); + this.textureArray[1] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian2"); + this.textureArray[2] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian3"); + this.textureArray[3] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian4"); + this.textureArray[4] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian5"); + this.textureArray[5] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian_invert"); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final int side, final int meta) { + return this.textureArray[meta]; + } + + @Override + public int damageDropped(final int damage) { + return damage; + } + + @Override + public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) { + for (int i = 0; i < 6; i++) { + list.add(new ItemStack(item, 1, i)); + } + } + + @Override + public Item getItemDropped(final int meta, final Random rand, final int fortune) { + return Item.getItemFromBlock(this); + } + + @Override + public ArrayList getDrops(final World world, final int x, final int y, final int z, final int metadata, + final int fortune) { + int m = metadata; + if (m == 5) { + m = 1; + } + return super.getDrops(world, x, y, z, m, fortune); + } + +} diff --git a/src/Java/gtPlusPlus/core/block/general/BlockTankXpConverter.java b/src/Java/gtPlusPlus/core/block/general/BlockTankXpConverter.java index c2afdfd21f..7e1ab75b84 100644 --- a/src/Java/gtPlusPlus/core/block/general/BlockTankXpConverter.java +++ b/src/Java/gtPlusPlus/core/block/general/BlockTankXpConverter.java @@ -50,7 +50,7 @@ public class BlockTankXpConverter extends BlockContainer { GameRegistry.registerBlock(this, ItemBlockEntityBase.class, "blockTankXpConverter"); LanguageRegistry.addName(this, "Xp Converter"); this.generateRainbowMap(); - if (!this.getTickRandomly()){ + if (!this.getTickRandomly()) { this.setTickRandomly(true); } } @@ -86,44 +86,48 @@ public class BlockTankXpConverter extends BlockContainer { } else { boolean mDidScrewDriver = false; - //Check For Screwdriver + // Check For Screwdriver try { final ItemStack mHandStack = PlayerUtils.getItemStackInPlayersHand(world, player.getDisplayName()); final Item mHandItem = mHandStack.getItem(); - if (((mHandItem instanceof GT_MetaGenerated_Tool_01) && ((mHandItem.getDamage(mHandStack) == 22) || (mHandItem.getDamage(mHandStack) == 150)))){ + if (((mHandItem instanceof GT_MetaGenerated_Tool_01) + && ((mHandItem.getDamage(mHandStack) == 22) || (mHandItem.getDamage(mHandStack) == 150)))) { final TileEntityXpConverter tile = (TileEntityXpConverter) world.getTileEntity(x, y, z); - if (tile != null){ + if (tile != null) { mDidScrewDriver = true; tile.onScrewdriverRightClick((byte) side, player, x, y, z); } } } - catch (final Throwable t){ + catch (final Throwable t) { mDidScrewDriver = false; } - if (!mDidScrewDriver){ - + if (!mDidScrewDriver) { try { final TileEntityXpConverter tile = (TileEntityXpConverter) world.getTileEntity(x, y, z); - if (tile != null){ + if (tile != null) { tile.onRightClick((byte) side, player, x, y, z); } } - catch (final Throwable t){} + catch (final Throwable t) { + } final TileEntityXpConverter tank = (TileEntityXpConverter) world.getTileEntity(x, y, z); - if (tank != null){ - if (tank.tankEssence.getFluid() != null){ - PlayerUtils.messagePlayer(player, "This tank contains "+tank.tankEssence.getFluidAmount()+"L of "+tank.tankEssence.getFluid().getLocalizedName()); + if (tank != null) { + if (tank.tankEssence.getFluid() != null) { + PlayerUtils.messagePlayer(player, "This tank contains " + tank.tankEssence.getFluidAmount() + + "L of " + tank.tankEssence.getFluid().getLocalizedName()); } - if (tank.tankLiquidXp.getFluid() != null){ - PlayerUtils.messagePlayer(player, "This tank contains "+tank.tankLiquidXp.getFluidAmount()+"L of "+tank.tankLiquidXp.getFluid().getLocalizedName()); + if (tank.tankLiquidXp.getFluid() != null) { + PlayerUtils.messagePlayer(player, "This tank contains " + tank.tankLiquidXp.getFluidAmount() + + "L of " + tank.tankLiquidXp.getFluid().getLocalizedName()); } - if ((tank.tankEssence.getFluid() != null) && (tank.tankLiquidXp.getFluid() != null)){ - PlayerUtils.messagePlayer(player, "This is worth "+EnchantingUtils.getLevelForLiquid(tank.tankLiquidXp.getFluidAmount())+" levels."); + if ((tank.tankEssence.getFluid() != null) && (tank.tankLiquidXp.getFluid() != null)) { + PlayerUtils.messagePlayer(player, "This is worth " + + EnchantingUtils.getLevelForLiquid(tank.tankLiquidXp.getFluidAmount()) + " levels."); } } } @@ -152,42 +156,43 @@ public class BlockTankXpConverter extends BlockContainer { } @Override - public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) { + public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, + final int z) { return false; } - private final boolean generateRainbowMap(){ + private final boolean generateRainbowMap() { int id = 0; - this.mRainbowMap.put(id++, new Triplet( 0, 255, 0)); - this.mRainbowMap.put(id++, new Triplet( 51, 255, 0)); - this.mRainbowMap.put(id++, new Triplet(102, 255, 0)); - this.mRainbowMap.put(id++, new Triplet(153, 255, 0)); - this.mRainbowMap.put(id++, new Triplet(204, 255, 0)); - this.mRainbowMap.put(id++, new Triplet(255, 255, 0)); - this.mRainbowMap.put(id++, new Triplet(255, 204, 0)); - this.mRainbowMap.put(id++, new Triplet(255, 153, 0)); - this.mRainbowMap.put(id++, new Triplet(255, 102, 0)); - this.mRainbowMap.put(id++, new Triplet(255, 51, 0)); - this.mRainbowMap.put(id++, new Triplet(255, 0, 0)); - this.mRainbowMap.put(id++, new Triplet(255, 0, 51)); - this.mRainbowMap.put(id++, new Triplet(255, 0, 102)); - this.mRainbowMap.put(id++, new Triplet(255, 0, 153)); - this.mRainbowMap.put(id++, new Triplet(255, 0, 204)); - this.mRainbowMap.put(id++, new Triplet(255, 0, 255)); - this.mRainbowMap.put(id++, new Triplet(204, 0, 255)); - this.mRainbowMap.put(id++, new Triplet(153, 0, 255)); - this.mRainbowMap.put(id++, new Triplet(102, 0, 255)); - this.mRainbowMap.put(id++, new Triplet( 51, 0, 255)); - this.mRainbowMap.put(id++, new Triplet( 0, 0, 255)); - this.mRainbowMap.put(id++, new Triplet( 0, 51, 255)); - this.mRainbowMap.put(id++, new Triplet( 0, 102, 255)); - this.mRainbowMap.put(id++, new Triplet( 0, 153, 255)); - this.mRainbowMap.put(id++, new Triplet( 0, 204, 255)); - this.mRainbowMap.put(id++, new Triplet( 0, 255, 255)); - this.mRainbowMap.put(id++, new Triplet( 0, 255, 204)); - this.mRainbowMap.put(id++, new Triplet( 0, 255, 153)); - this.mRainbowMap.put(id++, new Triplet( 0, 255, 102)); - this.mRainbowMap.put(id++, new Triplet( 0, 255, 51)); + this.mRainbowMap.put(id++, new Triplet(0, 255, 0)); + this.mRainbowMap.put(id++, new Triplet(51, 255, 0)); + this.mRainbowMap.put(id++, new Triplet(102, 255, 0)); + this.mRainbowMap.put(id++, new Triplet(153, 255, 0)); + this.mRainbowMap.put(id++, new Triplet(204, 255, 0)); + this.mRainbowMap.put(id++, new Triplet(255, 255, 0)); + this.mRainbowMap.put(id++, new Triplet(255, 204, 0)); + this.mRainbowMap.put(id++, new Triplet(255, 153, 0)); + this.mRainbowMap.put(id++, new Triplet(255, 102, 0)); + this.mRainbowMap.put(id++, new Triplet(255, 51, 0)); + this.mRainbowMap.put(id++, new Triplet(255, 0, 0)); + this.mRainbowMap.put(id++, new Triplet(255, 0, 51)); + this.mRainbowMap.put(id++, new Triplet(255, 0, 102)); + this.mRainbowMap.put(id++, new Triplet(255, 0, 153)); + this.mRainbowMap.put(id++, new Triplet(255, 0, 204)); + this.mRainbowMap.put(id++, new Triplet(255, 0, 255)); + this.mRainbowMap.put(id++, new Triplet(204, 0, 255)); + this.mRainbowMap.put(id++, new Triplet(153, 0, 255)); + this.mRainbowMap.put(id++, new Triplet(102, 0, 255)); + this.mRainbowMap.put(id++, new Triplet(51, 0, 255)); + this.mRainbowMap.put(id++, new Triplet(0, 0, 255)); + this.mRainbowMap.put(id++, new Triplet(0, 51, 255)); + this.mRainbowMap.put(id++, new Triplet(0, 102, 255)); + this.mRainbowMap.put(id++, new Triplet(0, 153, 255)); + this.mRainbowMap.put(id++, new Triplet(0, 204, 255)); + this.mRainbowMap.put(id++, new Triplet(0, 255, 255)); + this.mRainbowMap.put(id++, new Triplet(0, 255, 204)); + this.mRainbowMap.put(id++, new Triplet(0, 255, 153)); + this.mRainbowMap.put(id++, new Triplet(0, 255, 102)); + this.mRainbowMap.put(id++, new Triplet(0, 255, 51)); this.mRainbowTickMax = this.mRainbowMap.size(); return true; } @@ -198,21 +203,24 @@ public class BlockTankXpConverter extends BlockContainer { } @Override - public int colorMultiplier(final IBlockAccess p_149720_1_, final int p_149720_2_, final int p_149720_3_, final int p_149720_4_) { + public int colorMultiplier(final IBlockAccess p_149720_1_, final int p_149720_2_, final int p_149720_3_, + final int p_149720_4_) { - if ((this.mRainbowTick < 0) || (this.mRainbowTick > this.mRainbowTickMax)){ + if ((this.mRainbowTick < 0) || (this.mRainbowTick > this.mRainbowTickMax)) { this.mRainbowTick = 0; } - //Utils.LOG_INFO("x: "+this.mRainbowTick); - if (this.mRainbowTick <= this.mRainbowTickMax){ + // Utils.LOG_INFO("x: "+this.mRainbowTick); + if (this.mRainbowTick <= this.mRainbowTickMax) { Triplet mT = this.mRainbowMap.get(this.mRainbowTick); try { return Utils.rgbtoHexValue(mT.getValue_1(), mT.getValue_1(), mT.getValue_1()); - } catch (final Throwable t){ + } + catch (final Throwable t) { try { - mT = this.mRainbowMap.get(this.mRainbowTick-1); + mT = this.mRainbowMap.get(this.mRainbowTick - 1); return Utils.rgbtoHexValue(mT.getValue_1(), mT.getValue_1(), mT.getValue_1()); - } catch (final Throwable t1){ + } + catch (final Throwable t1) { return Utils.rgbtoHexValue(0, 0, 0); } } @@ -223,12 +231,12 @@ public class BlockTankXpConverter extends BlockContainer { @Override public void updateTick(final World world, final int x, final int y, final int z, final Random rand) { - //this.mRainbowTick++; + // this.mRainbowTick++; super.updateTick(world, x, y, z, rand); } @Override - public void randomDisplayTick(final World world, final int x, final int y, final int z, final Random rand) { + public void randomDisplayTick(final World world, final int x, final int y, final int z, final Random rand) { this.mRainbowTick++; super.randomDisplayTick(world, x, y, z, rand); } diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java new file mode 100644 index 0000000000..9cf3f796df --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java @@ -0,0 +1,44 @@ +package gtPlusPlus.core.item.base.itemblock; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlockWithMetadata; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class ItemBlockMeta extends ItemBlockWithMetadata +{ + private final Block mBlock; + + public ItemBlockMeta(final Block p_i45326_1_) + { + super(p_i45326_1_, p_i45326_1_); + this.mBlock = p_i45326_1_; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** + * Gets an icon index based on an item's damage value + */ + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(final int p_77617_1_) + { + return this.mBlock.getIcon(2, p_77617_1_); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + @Override + public int getMetadata(final int p_77647_1_) + { + return p_77647_1_; + } + + @Override + public String getUnlocalizedName(final ItemStack stack) { + return this.getUnlocalizedName() + "." + stack.getItemDamage(); + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java index f5f793da77..973a653302 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -1,5 +1,7 @@ package gtPlusPlus.core.recipe; +import static gtPlusPlus.core.util.item.ItemUtils.getSimpleStack; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_ModHandler; @@ -35,6 +37,7 @@ public class RECIPES_General { if (LoadedMods.Gregtech){ RECIPE_BasicCasingIC2 = ItemUtils.getItemStack("IC2:blockMachine", 1); run(); + addCompressedObsidian(); } } @@ -133,10 +136,16 @@ public class RECIPES_General { RecipeUtils.addShapedGregtechRecipe( "stickBlackSteel", "plateTungstenSteel", "stickBlackSteel", - "plateTungstenSteel", ItemUtils.getSimpleStack(Items.nether_star), "plateTungstenSteel", + "plateTungstenSteel", getSimpleStack(Items.nether_star), "plateTungstenSteel", "stickBlackSteel", "plateTungstenSteel", "stickBlackSteel", ItemUtils.getSimpleStack(ModBlocks.blockWitherGuard, 32)); + RecipeUtils.addShapedGregtechRecipe( + getSimpleStack(Items.experience_bottle), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 2, 1), getSimpleStack(Items.experience_bottle), + ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1), getSimpleStack(Items.nether_star), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1), + getSimpleStack(Items.experience_bottle), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 2, 1), getSimpleStack(Items.experience_bottle), + ItemUtils.getSimpleStack(ModBlocks.blockXpConverter, 1)); + //Alkalus Coin /*AddGregtechRecipe.addAssemblylineRecipe( ItemUtils.getSimpleStack(ModItems.itemAlkalusDisk), @@ -161,6 +170,38 @@ public class RECIPES_General { } + private static boolean addCompressedObsidian(){ + //Invert Obsidian + RecipeUtils.addShapedGregtechRecipe( + getSimpleStack(Items.redstone), getSimpleStack(Items.glowstone_dust), getSimpleStack(Items.redstone), + getSimpleStack(Items.glowstone_dust), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 1, 1), getSimpleStack(Items.glowstone_dust), + getSimpleStack(Items.redstone), getSimpleStack(Items.glowstone_dust), getSimpleStack(Items.redstone), + ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1)); + + final ItemStack[] mItems = new ItemStack[6]; + mItems[0] = ItemUtils.getSimpleStack(Blocks.obsidian); + for (int r=0;r<5;r++){ + mItems[r+1] = ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, r, 1); + } + + //Compressed Obsidian 1-5 + for (int r=0;r<5;r++){ + + final ItemStack input = mItems[r]; + final ItemStack output = mItems[r+1]; + + RecipeUtils.addShapedGregtechRecipe( + input, input, input, + input, input, input, + input, input, input, + output); + + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{output}, ItemUtils.getSimpleStack(input, 9)); + + } + return true; + } + } diff --git a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java index 3680dfb59d..fb20c87bac 100644 --- a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java @@ -163,7 +163,7 @@ public class ItemUtils { } @SuppressWarnings("unused") - public static ItemStack simpleMetaStack(final Item item, final int meta, final int itemstackSize){ + public static ItemStack simpleMetaStack(final Item item, final int meta, final int size){ try { if (item == null){ return null; @@ -176,7 +176,7 @@ public class ItemUtils { em = em1; } if (em != null){ - final ItemStack metaStack = new ItemStack(em,itemstackSize,meta); + final ItemStack metaStack = new ItemStack(em,size,meta); return metaStack; } } @@ -187,6 +187,10 @@ public class ItemUtils { } } + public static ItemStack simpleMetaStack(final Block block, final int meta, final int size) { + return simpleMetaStack(Item.getItemFromBlock(block), meta, size); + } + public static ItemStack getCorrectStacktype(final String fqrn, final int stackSize){ final String oreDict = "ore:"; ItemStack temp; @@ -634,4 +638,5 @@ public class ItemUtils { return getItemStackOfAmountFromOreDictNoBroken(oredictName, amount); } + } diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index c2d177de48..d81815e0d3 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -1,3 +1,4 @@ +//Creative Tabs itemGroup.MiscUtilBlockTab=[GT++] Blocks itemGroup.MiscUtilMiscTab=[GT++] Items itemGroup.MiscUtilCombatTab=[GT++] Combat @@ -5,77 +6,33 @@ itemGroup.MiscUtilToolsTab=[GT++] Tools itemGroup.MiscUtilMachineTab=[GT++] Machines itemGroup.MiscUtilOtherTab=[GT++] Items II -item.itemPLACEHOLDER_Circuit.name=Quark Manipulator (UV) - -item.itemPlateEnrichedSoularium.name=Enriched Soularium Plate - -item.itemHeliumBlob.name=Mysterious Hydrogen Substance +//Debug +item.AAA_Broken.name=[Non-existent Item] Report This Recipe On Github, Please. +item.itemBedLocator_Base.name=Bed Locator [NBT Test] +item.itemBaseItemWithCharge.name=Base Chargeable Item +item.miscutils_itemDebugShapeSpawner.name=[Debug] Shapes +//Alternative Materials item.itemPlateBatteryAlloy.name=Plate of Battery Alloy item.itemIngotBatteryAlloy.name=Ingot of Battery Alloy - item.itemStickyRubber.name=Gumlet of Sticky Rubber +//Unused Fuel rods item.itemFuelRod_Empty.name=Empty Fuel Rod item.itemFuelRod_Thorium.name=Thorium Fuel Rod item.itemFuelRod_Uranium.name=Uranium Fuel Rod item.itemFuelRod_Plutonium.name=Plutonium Fuel Rod - -item.itemBedLocator_Base.name=Bed Locator [NBT Test] -item.itemBaseItemWithCharge.name=Base Chargeable Item - -item.miscutils_itemDebugShapeSpawner.name=[Debug] Shapes - -tile.fluidJackDaniels.name=Jack Daniels -tile.blockGriefSaver.name=Anti-Griefer [WIP] -tile.helium_collector.name=Helium Collector -tile.blockNuclearFueledHeliumGenerator.name=Nuclear Fueled Helium Generator [NFHG] -tile.blockMachineCharger.name=Charging Machine -container.Charger=Charging Machine -container.NHG=Nuclear Fueled Helium Generator -container.helium_collector.name=Helium Collector -tile.blockStaballoy.name=Block of Staballoy -tile.blockBloodSteel.name=Block of Blood Steel - - +//Tile Entities tile.blockToolBuilder.name=GregTech Tool Constructor + +//Tools item.itemBufferCore.name=Buffer Core item.itemStaballoyPickaxe.name=Tunnel Digger item.itemStaballoyAxe.name=Tree Feller item.itemSandstoneHammer.name=Cobblestone Breaker - -item.bucket.fluid.grc.jackDanielsWhiskey0.name=Jack Daniels (0) -item.bucket.fluid.grc.jackDanielsWhiskey1.name=Jack Daniels (1) -item.bucket.fluid.grc.jackDanielsWhiskey2.name=Jack Daniels (2) -item.bucket.fluid.grc.jackDanielsWhiskey3.name=Jack Daniels (3) -item.bucket.fluid.grc.jackDanielsWhiskey4.name=Jack Daniels (4) -fluid.grc.jackDanielsWhiskey=Jack Daniels -fluid.grc.jackDanielsWhiskey0=Jack Daniels (0) -fluid.grc.jackDanielsWhiskey1=Jack Daniels (1) -fluid.grc.jackDanielsWhiskey2=Jack Daniels (2) -fluid.grc.jackDanielsWhiskey3=Jack Daniels (3) -fluid.grc.jackDanielsWhiskey4=Jack Daniels (4) -fluid.fluidJackDaniels=Jack Daniels -fluid.grc.jackDanielsWhiskey0.Modifier=Jack Daniels (0) -fluid.grc.jackDanielsWhiskey1.Modifier=Jack Daniels (1) -fluid.grc.jackDanielsWhiskey2.Modifier=Jack Daniels (2) -fluid.grc.jackDanielsWhiskey3.Modifier=Jack Daniels (3) -fluid.grc.jackDanielsWhiskey4.Modifier=Jack Daniels (4) -tile.fluidBlockJackDaniels.name=Jack Daniels -tile.fluid.grc.jackDanielsWhiskey0.name=Jack Daniels (0) -tile.fluid.grc.jackDanielsWhiskey1.name=Jack Daniels (1) -tile.fluid.grc.jackDanielsWhiskey2.name=Jack Daniels (2) -tile.fluid.grc.jackDanielsWhiskey3.name=Jack Daniels (3) -tile.fluid.grc.jackDanielsWhiskey4.name=Jack Daniels (4) -fluid.psc_JD.ferment.2=Fermenting Jack Daniels -fluid.psc_JD.dmature=D Matured Jack Daniels -fluid.psc_JD.mature=Jack Daniels -fluid.psc_JD.distill=Jack Daniels Wash -fluid.psc_JD.name=Jack Daniels -fluid.psc_JD=Jack Daniels - +//Thermal Foundation Stuff item.MiscUtils.bucket.bucketPyrotheum.name=Blazing Pyrotheum Bucket item.MiscUtils.bucket.bucketCryotheum.name=Gelid Cryotheum Bucket item.MiscUtils.bucket.bucketEnder.name=Resonant Ender Bucket @@ -85,11 +42,9 @@ item.MiscUtils.material.rodBlizz.name=Blizz Rod item.MiscUtils.material.dustBlizz.name=Blizz Powder tile.MiscUtils.fluid.pyrotheum.name=Blazing Pyrotheum tile.MiscUtils.fluid.cryotheum.name=Gelid Cryotheum - -tile.miscutils.fluid.cryotheum.name=Gelid Cryotheum -tile.miscutils.fluid.pyrotheum.name=Blazing Pyrotheum tile.miscutils.fluid.ender.name=Resonant Ender +//Forestry Stuff item.frameAccelerated.name=Accelerated Frame item.frameVoid.name=Void Frame item.frameMutagenic.name=Mutagenic Frame @@ -100,22 +55,33 @@ item.frameSoul.name=Soul Frame item.frameHealing.name=Healing Frame item.frameNova.name=Nova Frame +//IC2 stuff item.itemEnergeticRotorBlade.name=Energetic Alloy Rotor Blade item.itemTungstenSteelRotorBlade.name=TungstenSteel Rotor Blade item.itemVibrantRotorBlade.name=Vibrant Alloy Rotor Blade item.itemIridiumRotorBlade.name=Iridium Rotor Blade - item.itemEnergeticShaft.name=Energetic Alloy Shaft item.itemTungstenSteelShaft.name=TungstenSteel Shaft item.itemVibrantShaft.name=Vibrant Alloy Shaft item.itemIridiumShaft.name=Iridium Shaft - item.itemMagnaliumRotorBlade.name=Magnalium Rotor Blade item.itemUltimetRotorBlade.name=Ultimet Blade item.itemMagnaliumShaft.name=Magnalium Shaft item.itemUltimetShaft.name=Ultimet Shaft -item.itemHotIngotRaisinBread.name= Hot Loaf of Raisin Bread -item.AAA_Broken.name=[Non-existent Item] Report This Recipe On Github, Please. + +//Misc Items +item.itemPLACEHOLDER_Circuit.name=Quark Manipulator (UV) +item.itemPlateEnrichedSoularium.name=Enriched Soularium Plate +item.itemHeliumBlob.name=Mysterious Hydrogen Substance item.itemAlkalusDisk.name=Alkalus Disk -item.itemIngotRaisinBread.name=§5ImQ009's §fRaisin Bread \ No newline at end of file +item.itemHotIngotRaisinBread.name= Hot Loaf of Raisin Bread +item.itemIngotRaisinBread.name=§5ImQ009's §fRaisin Bread + +//Misc Blocks +tile.blockCompressedObsidian.0.name=Compressed Obsidian (9) +tile.blockCompressedObsidian.1.name=Compressed Obsidian (81) +tile.blockCompressedObsidian.2.name=Compressed Obsidian (729) +tile.blockCompressedObsidian.3.name=Compressed Obsidian (6561) +tile.blockCompressedObsidian.4.name=Compressed Obsidian (59049) +tile.blockCompressedObsidian.5.name=Inverted Obsidian \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/blocks/SwirlGray.png b/src/resources/assets/miscutils/textures/blocks/SwirlGray.png new file mode 100644 index 0000000000..337d5fd1bc Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/SwirlGray.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/compressed/obsidian1.png b/src/resources/assets/miscutils/textures/blocks/compressed/obsidian1.png new file mode 100644 index 0000000000..0970b27745 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/compressed/obsidian1.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/compressed/obsidian2.png b/src/resources/assets/miscutils/textures/blocks/compressed/obsidian2.png new file mode 100644 index 0000000000..6cf79c75c4 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/compressed/obsidian2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/compressed/obsidian3.png b/src/resources/assets/miscutils/textures/blocks/compressed/obsidian3.png new file mode 100644 index 0000000000..1241b24fad Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/compressed/obsidian3.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/compressed/obsidian4.png b/src/resources/assets/miscutils/textures/blocks/compressed/obsidian4.png new file mode 100644 index 0000000000..3d07d55d0c Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/compressed/obsidian4.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/compressed/obsidian5.png b/src/resources/assets/miscutils/textures/blocks/compressed/obsidian5.png new file mode 100644 index 0000000000..5f83804605 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/compressed/obsidian5.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/compressed/obsidian_invert.png b/src/resources/assets/miscutils/textures/blocks/compressed/obsidian_invert.png new file mode 100644 index 0000000000..8c55fdddd3 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/compressed/obsidian_invert.png differ -- cgit From 9d57f7f2f399689f5d39e0a130f363e5f5aa6877 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Mon, 27 Nov 2017 00:34:03 +1000 Subject: + Added plant fibre to craft ropes with. + Added recipes for Plant Fibre, Rope and Nets. --- src/Java/gtPlusPlus/core/item/ModItems.java | 2 ++ .../gtPlusPlus/core/recipe/RECIPES_General.java | 26 +++++++++++++++++++++ src/resources/assets/miscutils/lang/en_US.lang | 11 +++++---- .../assets/miscutils/textures/items/itemFiber.png | Bin 0 -> 455 bytes 4 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 src/resources/assets/miscutils/textures/items/itemFiber.png (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 103639074f..5afd82b7d4 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -269,6 +269,7 @@ public final class ModItems { public static Item itemGrindleTablet; public static Item itemRope; + public static Item itemFiber; public static final void init(){ @@ -303,6 +304,7 @@ public final class ModItems { itemBasicFireMaker = new ItemBasicFirestarter(); //Register Rope + itemFiber = new CoreItem("itemFiber", "Plant Fiber", tabMisc); itemRope = new CoreItem("itemRope", "Rope", tabMisc); //Make some backpacks diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java index 973a653302..180294c597 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -8,6 +8,7 @@ import gregtech.api.util.GT_ModHandler; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.recipe.RecipeUtils; @@ -168,6 +169,31 @@ public class RECIPES_General { 30*20*60, 100000);*/ + RecipeUtils.addShapelessGregtechRecipe( + new ItemStack[]{ + ItemUtils.getItemStackOfAmountFromOreDictNoBroken(CI.craftingToolKnife, 1), ItemUtils.getSimpleStack(Blocks.reeds)}, + ItemUtils.getSimpleStack(ModItems.itemFiber, 16) + ); + + RecipeUtils.addShapelessGregtechRecipe( + new ItemStack[]{ + ItemUtils.getItemStackOfAmountFromOreDictNoBroken(CI.craftingToolKnife, 1), ItemUtils.getSimpleStack(Blocks.sapling)}, + ItemUtils.getSimpleStack(ModItems.itemFiber, 32) + ); + + RecipeUtils.recipeBuilder( + null, ItemUtils.getSimpleStack(ModItems.itemFiber, 1), null, + ItemUtils.getSimpleStack(ModItems.itemFiber, 1), CI.craftingToolKnife, ItemUtils.getSimpleStack(ModItems.itemFiber, 1), + null, ItemUtils.getSimpleStack(ModItems.itemFiber, 1), null, + ItemUtils.getSimpleStack(ModItems.itemRope, 3)); + + RecipeUtils.recipeBuilder( + ItemUtils.getSimpleStack(ModItems.itemRope, 1), ItemUtils.getSimpleStack(ModItems.itemRope, 1), ItemUtils.getSimpleStack(ModItems.itemRope, 1), + ItemUtils.getSimpleStack(ModItems.itemRope, 1), ItemUtils.getSimpleStack(ModItems.itemRope, 1), ItemUtils.getSimpleStack(ModItems.itemRope, 1), + null, null, null, + ItemUtils.getSimpleStack(ModBlocks.blockNet, 2)); + + } private static boolean addCompressedObsidian(){ diff --git a/src/resources/assets/miscutils/lang/en_US.lang b/src/resources/assets/miscutils/lang/en_US.lang index c10f904056..962cce198b 100644 --- a/src/resources/assets/miscutils/lang/en_US.lang +++ b/src/resources/assets/miscutils/lang/en_US.lang @@ -83,8 +83,9 @@ item.itemIngotRaisinBread.name=§5ImQ009's §fRaisin Bread //Misc Blocks tile.blockCompressedObsidian.0.name=Compressed Obsidian (9) -tile.blockCompressedObsidian.1.name=Compressed Obsidian (81) -tile.blockCompressedObsidian.2.name=Compressed Obsidian (729) -tile.blockCompressedObsidian.3.name=Compressed Obsidian (6561) -tile.blockCompressedObsidian.4.name=Compressed Obsidian (59049) -tile.blockCompressedObsidian.5.name=Inverted Obsidian \ No newline at end of file +tile.blockCompressedObsidian.1.name=Double Compressed Obsidian (81) +tile.blockCompressedObsidian.2.name=Triple Compressed Obsidian (729) +tile.blockCompressedObsidian.3.name=Quadruple Compressed Obsidian (6561) +tile.blockCompressedObsidian.4.name=Quintuple Compressed Obsidian (59049) +tile.blockCompressedObsidian.5.name=Inverted Obsidian +tile.blockNet.name=Net \ No newline at end of file diff --git a/src/resources/assets/miscutils/textures/items/itemFiber.png b/src/resources/assets/miscutils/textures/items/itemFiber.png new file mode 100644 index 0000000000..c2eb959c6c Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/itemFiber.png differ -- cgit From 77ae1498e2276df9046ce4e28fe2138877c63bea Mon Sep 17 00:00:00 2001 From: Alkalus Date: Mon, 27 Nov 2017 01:02:35 +1000 Subject: $ Fixed Sugarcane to Plant Fiber recipe. --- src/Java/gtPlusPlus/core/recipe/RECIPES_General.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/core/recipe') diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java index 180294c597..4304fdaff5 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -171,7 +171,7 @@ public class RECIPES_General { RecipeUtils.addShapelessGregtechRecipe( new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDictNoBroken(CI.craftingToolKnife, 1), ItemUtils.getSimpleStack(Blocks.reeds)}, + ItemUtils.getItemStackOfAmountFromOreDictNoBroken(CI.craftingToolKnife, 1), ItemUtils.getSimpleStack(Items.reeds)}, ItemUtils.getSimpleStack(ModItems.itemFiber, 16) ); -- cgit