aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2019-08-11 11:44:08 +0200
committerbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2019-08-11 11:44:08 +0200
commit50c4013a228c30fedec312c062a04a7511077f7e (patch)
tree30668a9ca5878f8b2de4f0e6876c5b238ea210e7 /src
parent87b9bfd0a0989ec3186cb3f8c01bbb461182da17 (diff)
downloadGT5-Unofficial-50c4013a228c30fedec312c062a04a7511077f7e.tar.gz
GT5-Unofficial-50c4013a228c30fedec312c062a04a7511077f7e.tar.bz2
GT5-Unofficial-50c4013a228c30fedec312c062a04a7511077f7e.zip
Circuit Assembly Line added
+ added "classic mode" Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: 6d0acc949506b6fcd424f971c39f0b8e3a75093b
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java3
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java11
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java5
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java231
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java11
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java51
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java18
8 files changed, 302 insertions, 30 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
index 8001cb0c41..fab50ec3b4 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
@@ -39,6 +39,7 @@ import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.Circ
import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader;
import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
+import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader;
import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
import cpw.mods.fml.common.FMLCommonHandler;
@@ -168,6 +169,8 @@ public final class MainMod {
WerkstoffLoader.removeIC2Recipes();
this.addElectricImplosionCompressorRecipes();
new CircuitImprintLoader().run();
+ if (ConfigHandler.classicMode)
+ new DownTierLoader().run();
}
private void addElectricImplosionCompressorRecipes() {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java
index d0e57cae15..10fe70816f 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java
@@ -53,6 +53,7 @@ public class ConfigHandler {
public static boolean DEHPDirectSteam;
public static boolean teslastaff;
+ public static boolean classicMode;
public static boolean experimentalThreadedLoader;
public static boolean GTNH;
public static boolean ezmode;
@@ -65,17 +66,20 @@ public class ConfigHandler {
public ConfigHandler(Configuration C) {
ConfigHandler.c = C;
+ ConfigHandler.classicMode= ConfigHandler.c.get("System", "Enable Classic Mode", false, "Enables the classic Mode (all recipes in normal machines are doable in MV").getBoolean(false);
ConfigHandler.creativeScannerID = ConfigHandler.c.get("System", "Creative Debug Scanner", 0, "ID for the Creative Debug Scanner Block").getInt(0);
ConfigHandler.tooltips = ConfigHandler.c.get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips").getBoolean(true);
ConfigHandler.IDOffset = ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600);
- ConfigHandler.energyPerCell = ConfigHandler.c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000);
ConfigHandler.ezmode = ConfigHandler.c.get("System", "Mode switch", false, "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false);
ConfigHandler.teslastaff = ConfigHandler.c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false);
ConfigHandler.newStuff = !ConfigHandler.c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false);
ConfigHandler.BioLab = !ConfigHandler.c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false);
+
+ ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150);
+
+ ConfigHandler.energyPerCell = ConfigHandler.c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000);
ConfigHandler.DEHPDirectSteam = ConfigHandler.c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false);
ConfigHandler.megaMachinesMax = ConfigHandler.c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256);
- ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150);
ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c.get("Multiblocks","BioVat Maximum Bonus on Recipes", 1000,"This are the maximum parallel Operations the BioVat can do, when the output is half full.").getInt(1000);
if (ConfigHandler.IDOffset == 0) {
ConfigHandler.IDOffset = 12600;
@@ -89,7 +93,6 @@ public class ConfigHandler {
}
ConfigHandler.enabledPatches = new boolean[BWCoreTransformer.shouldTransform.length];
ConfigHandler.enabledPatches = Arrays.copyOf(BWCoreTransformer.shouldTransform,BWCoreTransformer.shouldTransform.length);
-
ConfigHandler.ross128BID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64);
ConfigHandler.ross128BAID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)").getInt(-63);
ConfigHandler.ross128btier = ConfigHandler.c.get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b").getInt(3);
@@ -105,8 +108,8 @@ public class ConfigHandler {
private static void setUpComments() {
ConfigHandler.c.addCustomCategoryComment("ASM fixes", "Disable ASM fixes here.");
- ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multliblock Options can be set here.");
ConfigHandler.c.addCustomCategoryComment("Singleblocks", "Singleblock Options can be set here.");
+ ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multliblock Options can be set here.");
ConfigHandler.c.addCustomCategoryComment("System", "Different System Settings can be set here.");
ConfigHandler.c.addCustomCategoryComment("CrossMod Interactions", "CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!");
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java
index faf503d33f..704dc73c60 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java
@@ -32,6 +32,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBl
import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_ExperimentalFloodGate;
import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump;
import com.github.bartimaeusnek.bartworks.common.tileentities.debug.CreativeScanner;
+import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_CircuitAssemblyLine;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR;
@@ -135,12 +136,13 @@ public class ItemRegistry {
public static ItemStack dehp;
public static ItemStack thtr;
public static ItemStack eic;
+ public static ItemStack cal;
public static void run() {
if (newStuff) {
if (ConfigHandler.creativeScannerID != 0)
- new CreativeScanner(ConfigHandler.creativeScannerID,"ZPM Creative Debug Scanner","ZPM Creative Debug Scanner",7);
+ new CreativeScanner(ConfigHandler.creativeScannerID,"Creative Debug Scanner","Creative Debug Scanner",20);
ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, "ElectricImplosionCompressor", "Electric Implosion Compressor").getStackForm(1L);
ItemRegistry.thtr = new GT_TileEntity_THTR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, "THTR", "Thorium High Temperature Reactor").getStackForm(1L);
GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials();
@@ -177,6 +179,7 @@ public class ItemRegistry {
ItemRegistry.dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L);
ItemRegistry.megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L);
ItemRegistry.megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVacuumFreezer", StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L);
+ ItemRegistry.cal = new GT_TileEntity_CircuitAssemblyLine(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, "CircuitAssemblyLine", "Circuit Assembly Line").getStackForm(1L);
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java
index 14e8954f69..805ab0a55f 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java
@@ -22,21 +22,38 @@
package com.github.bartimaeusnek.bartworks.common.tileentities.multis;
+import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items;
+import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader;
+import com.github.bartimaeusnek.bartworks.util.BWRecipes;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
+import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
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_ItemStack;
+import gregtech.api.metatileentity.implementations.*;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.common.util.ForgeDirection;
import java.util.Collection;
+import java.util.HashSet;
public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBlockBase {
- private NBTTagCompound type;
+ public String getTypeForDisplay() {
+ if (this.type.equals(new NBTTagCompound()))
+ return "";
+ return GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type)));
+ }
+
+ private NBTTagCompound type = new NBTTagCompound();
private GT_Recipe bufferedRecipe;
public GT_TileEntity_CircuitAssemblyLine(int aID, String aName, String aNameRegional) {
@@ -47,67 +64,214 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl
super(aName);
}
+ private boolean imprintMachine(ItemStack itemStack){
+ if (!this.type.equals(new NBTTagCompound()))
+ return true;
+ if (!GT_Utility.isStackValid(itemStack))
+ return false;
+ if (itemStack.getItem() instanceof BW_Meta_Items.BW_GT_MetaGenCircuits && itemStack.getItemDamage() == 0 && itemStack.getTagCompound() != null && this.type.equals(new NBTTagCompound())){
+ this.type = itemStack.getTagCompound();
+ this.mInventory[1] = null;
+ this.getBaseMetaTileEntity().issueBlockUpdate();
+ return true;
+ }
+ return false;
+ }
+
@Override
public boolean isCorrectMachinePart(ItemStack itemStack) {
+ return true;
+ }
- return false;
+ @Override
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 20) {
+ GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(212), 10, 1.0F, aX, aY, aZ);
+ }
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
this.type = aNBT.getCompoundTag("Type");
+ super.loadNBTData(aNBT);
}
@Override
public void saveNBTData(NBTTagCompound aNBT) {
+ if (!this.type.equals(new NBTTagCompound()))
+ aNBT.setTag("Type", this.type);
super.saveNBTData(aNBT);
- aNBT.setTag("Type", this.type);
+
}
@Override
public boolean checkRecipe(ItemStack itemStack) {
- if (this.type == null)
- return false;
+ if (this.type.equals(new NBTTagCompound()))
+ if (!this.imprintMachine(itemStack))
+ return false;
- if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(false,true,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this)))
+ if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this))) {
+ BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this);
+ if (this.mEUt < 0)
+ this.mEUt = -this.mEUt;
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = this.bufferedRecipe.mOutputs;
+ this.mOutputFluids = this.bufferedRecipe.mFluidOutputs;
return true;
+ }
ItemStack stack = ItemStack.loadItemStackFromNBT(this.type);
if (stack == null)
return false;
- Collection<GT_Recipe> recipes = null;
+ Collection<GT_Recipe> recipes = new HashSet<>();
- for (GT_ItemStack GTitemstack : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeItemMap.keySet()){
- if (GTitemstack.mItem.equals(stack.getItem()) && GTitemstack.mMetaData == (short) stack.getItemDamage()){
- recipes = GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeItemMap.get(GTitemstack);
+ for (GT_Recipe recipe : BWRecipes.instance.getMappingsFor((byte)3).mRecipeList){
+ if (GT_Utility.areStacksEqual(recipe.mOutputs[0],stack,true)){
+ recipes.add(recipe);
break;
}
}
- if (recipes == null || recipes.isEmpty())
+ if (recipes.isEmpty())
return false;
for (GT_Recipe recipe : recipes){
- if (recipe.isRecipeInputEqual(false,true,BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this)))
+ if (recipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this),BW_Util.getItemsFromInputBusses(this)))
this.bufferedRecipe = recipe;
+ else
+ continue;
+
+ BW_Util.calculateOverclockedNessMulti(this.bufferedRecipe.mEUt,this.bufferedRecipe.mDuration,1,this.getMaxInputVoltage(),this);
+ if (this.mEUt < 0)
+ this.mEUt = -this.mEUt;
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = this.bufferedRecipe.mOutputs;
+ this.mOutputFluids = this.bufferedRecipe.mFluidOutputs;
+ return true;
}
+ return false;
+ }
+ @Override
+ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+ int r;
+ int i;
+ IGregTechTileEntity tTileEntity;
+ if (xDir != 0) {
+ for(r = 0; r <= 7; ++r) {
+ i = r * xDir;
+ tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 0, i);
+ if (!this.addEnergyInputToMachineList(tTileEntity, 16))
+ if ((aBaseMetaTileEntity.getBlockOffset(0, 0, i) != GregTech_API.sBlockCasings3 || aBaseMetaTileEntity.getMetaIDOffset(0, 0, i) != 10) && r == 1)
+ return false;
+ if (!aBaseMetaTileEntity.getBlockOffset(0, -1, i).getUnlocalizedName().equals("blockAlloyGlass"))
+ return false;
- return true;
+ tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(0, -2, i);
+ if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16))
+ if (aBaseMetaTileEntity.getBlockOffset(0, -2, i) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(0, -2, i) != 0)
+ return false;
+
+ if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(xDir, -1, i) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(xDir, -1, i) != 5))
+ return false;
+
+ if (!aBaseMetaTileEntity.getBlockOffset(xDir * 2, -1, i).getUnlocalizedName().equals("blockAlloyGlass"))
+ return false;
+
+ tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir * 2, -2, i);
+ if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16))
+ if (aBaseMetaTileEntity.getBlockOffset(xDir * 2, -2, i) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(xDir * 2, -2, i) != 0)
+ return false;
+
+ tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, -2, i);
+ if (!this.addInputToMachineList(tTileEntity, 16) && this.addOutputToMachineList(tTileEntity, 16))
+ return r > 0 && this.mEnergyHatches.size() > 0;
+
+ }
+ } else {
+
+ for(r = 0; r <= 7; ++r) {
+ i = r * -zDir;
+
+ //top with grate and energy hatch
+ tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, 0, zDir);
+ if (!this.addEnergyInputToMachineList(tTileEntity, 16))
+ if ((aBaseMetaTileEntity.getBlockOffset(i, 0, 0) != GregTech_API.sBlockCasings3 || aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0) != 10) && r == 1)
+ return false;
+
+ if (!aBaseMetaTileEntity.getBlockOffset(i, -1, 0).getUnlocalizedName().equals("blockAlloyGlass"))
+ return false;
+
+ tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, 0);
+ if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16))
+ if (aBaseMetaTileEntity.getBlockOffset(i, -2, 0) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(i, -2, 0) != 0)
+ return false;
+
+ if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(i, -1, zDir) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(i, -1, zDir) != 5))
+ return false;
+
+ if (!aBaseMetaTileEntity.getBlockOffset(i, -1, zDir * 2).getUnlocalizedName().equals("blockAlloyGlass"))
+ return false;
+
+
+ tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir * 2);
+ if (!this.addMaintenanceToMachineList(tTileEntity, 16) && !this.addInputToMachineList(tTileEntity, 16))
+ if (aBaseMetaTileEntity.getBlockOffset(i, -2, zDir * 2) != GregTech_API.sBlockCasings2 || aBaseMetaTileEntity.getMetaIDOffset(i, -2, zDir * 2) != 0)
+ return false;
+
+ tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir);
+ if (!this.addInputToMachineList(tTileEntity, 16) && this.addOutputToMachineList(tTileEntity, 16))
+ return r > 0 && this.mEnergyHatches.size() == 1;
+ }
+ }
+
+ return false;
}
@Override
- public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
- return false;
+ public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ 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);
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus && ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier == 0) {
+ ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ ((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity).mRecipeMap = this.getRecipeMap();
+ return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity);
+ } else {
+ return false;
+ }
+ }
+ }
+
+ @Override
+ public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
+ } else {
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus && ((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity).mTier == 0) {
+ ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex);
+ return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus)aMetaTileEntity);
+ } else {
+ return false;
+ }
+ }
}
@Override
public int getMaxEfficiency(ItemStack itemStack) {
- return 0;
+ return 10000;
}
@Override
@@ -132,11 +296,34 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_MultiBl
@Override
public String[] getDescription() {
- return new String[0];
+ return new String[]{
+ "Circuit Assembly Line", "Size(WxHxD): (2-7)x3x3, variable length",
+ "Bottom: Steel Machine Casing(or 1x Maintenance or Input Hatch),",
+ "ULV Input Bus (Last ULV Output Bus), Steel Machine Casing",
+ "Middle: Reinforced Glass, Assembling Line Casing, Reinforced Glass",
+ "Top: Grate Machine Casing (or Controller or 1x Energy Hatch)",
+ "Up to 7 repeating slices, last is Output Bus",
+ "Imprint this machine with a Circuit Imprint,",
+ "by putting the imprint in the controller.",
+ "Every Circuit Assembly Line can only be imprinted ONCE.",
+ StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"
+ };
+ }
+
+ @Override
+ public String[] getInfoData() {
+ String[] ret = new String[super.getInfoData().length+1];
+ ret[super.getInfoData().length] = "Imprinted with: "+ GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type)));
+ return ret;
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
}
@Override
- public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) {
- return new ITexture[0];
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return aSide == aFacing ? new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE)} : new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[16]};
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java
index 0cee76a61d..c8e755e3e4 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java
@@ -131,6 +131,17 @@ public class BW_Meta_Items {
return ret;
}
+ @Override
+ public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ if (aCreativeTab == this.getCreativeTab())
+ for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()){
+ ItemStack stack = new ItemStack(BW_Meta_Items.NEWCIRCUITS,1,0);
+ stack.setTagCompound(tag);
+ aList.add(stack);
+ }
+ super.getSubItems(var1, aCreativeTab, aList);
+ }
+
@SideOnly(Side.CLIENT)
public final void registerIcons(IIconRegister aIconRegister) {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java
index bc0c15b162..aa1470073e 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java
@@ -44,7 +44,7 @@ import java.util.Iterator;
public class CircuitImprintLoader implements Runnable {
- static final ArrayListMultimap<NBTTagCompound,GT_Recipe> recipeTagMap = ArrayListMultimap.create();
+ public static final ArrayListMultimap<NBTTagCompound,GT_Recipe> recipeTagMap = ArrayListMultimap.create();
static final HashBiMap<CircuitData,NBTTagCompound> bwCircuitTagMap = HashBiMap.create(20);
static final HashSet<NBTTagCompound> refs = new HashSet<>();
public static short reverseIDs = Short.MAX_VALUE-1;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java
new file mode 100644
index 0000000000..1ed1cb0b83
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2019 bartimaeusnek
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package com.github.bartimaeusnek.bartworks.system.material.processingLoaders;
+
+import com.github.bartimaeusnek.bartworks.util.BW_Util;
+import gregtech.api.util.GT_Recipe;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class DownTierLoader implements Runnable {
+ @Override
+ public void run() {
+ for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) {
+ if (map == GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes || map == GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes || map == GT_Recipe.GT_Recipe_Map.sMassFabFakeRecipes || map == GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes || map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sRockBreakerFakeRecipes)
+ return;
+ Set<GT_Recipe> newRecipes = new HashSet<>();
+ Set<GT_Recipe> toRem = new HashSet<>();
+ for (GT_Recipe recipe : map.mRecipeList) {
+ if (recipe == null)
+ continue;
+ if (recipe.mEUt > 128) {
+ toRem.add(recipe);
+ newRecipes.add(BW_Util.copyAndSetTierToNewRecipe(recipe, (byte) 2));
+ }
+ }
+ map.mRecipeList.removeAll(toRem);
+ map.mRecipeList.addAll(newRecipes);
+ }
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
index 046c9363e4..c3dd4962be 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
@@ -63,6 +63,20 @@ public class BW_Util {
return array[index];
}
+ public static GT_Recipe copyAndSetTierToNewRecipe(GT_Recipe recipe, byte tier){
+ byte oldTier = GT_Utility.getTier(recipe.mEUt);
+ int newTime = recipe.mDuration;
+ int newVoltage = recipe.mEUt;
+ if (tier < oldTier) {
+ newTime <<= (oldTier - tier);
+ newVoltage >>= 2 * (oldTier - tier);
+ } else {
+ newTime >>= (tier - oldTier);
+ newVoltage <<= 2 * (tier - oldTier);
+ }
+ return new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, recipe.mFluidInputs, recipe.mFluidOutputs, newTime, newVoltage, recipe.mSpecialValue);
+ }
+
public static String subscriptNumbers(String b){
char[] chars = b.toCharArray();
char[] nu = new char[chars.length];
@@ -312,14 +326,14 @@ public class BW_Util {
for (GT_MetaTileEntity_Hatch_Input fip : aBaseMetaTileEntity.mInputHatches){
tmp.add(fip.getFluid());
}
- return (FluidStack[]) tmp.toArray();
+ return tmp.toArray(new FluidStack[0]);
}
public static ItemStack[] getItemsFromInputBusses(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity){
ArrayList<ItemStack> tmp = new ArrayList<>();
for (GT_MetaTileEntity_Hatch_InputBus fip : aBaseMetaTileEntity.mInputBusses){
tmp.addAll(Arrays.asList(fip.mInventory));
}
- return (ItemStack[]) tmp.toArray();
+ return tmp.toArray(new ItemStack[0]);
}