From 986a3287c5c40e89549c0560ca7f748c481dca99 Mon Sep 17 00:00:00 2001 From: minecraft7771 Date: Sat, 6 Aug 2022 21:00:29 +0200 Subject: Removed charging loss --- .../thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index 7d5b16ca8c..fbfbc624b1 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -71,9 +71,6 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa private long doChargeItemStack(IElectricItem item, ItemStack stack) { try { double euDiff = item.getMaxCharge(stack) - ElectricItem.manager.getCharge(stack); - if (euDiff > 0) { - setEUVar(getEUVar() - (getEUVar() >> 5)); - } long remove = (long) Math.ceil( ElectricItem.manager.charge(stack, Math.min(euDiff, getEUVar()) @@ -94,7 +91,6 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa private long doChargeItemStackRF(IEnergyContainerItem item, ItemStack stack) { try { long RF = Math.min(item.getMaxEnergyStored(stack) - item.getEnergyStored(stack), getEUVar() * mEUtoRF / 100L); - //if(RF>0)this.setEUVar(this.getEUVar()-this.getEUVar()>>10); RF = item.receiveEnergy(stack, RF > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) RF, false); RF = RF * 100L / mEUtoRF; setEUVar(getEUVar() - RF); -- cgit From f4dfe55dfacbbc3fb4ae45dd4c5f453a5a2f2086 Mon Sep 17 00:00:00 2001 From: minecraft7771 Date: Sat, 6 Aug 2022 22:31:11 +0200 Subject: The infuser now charges items in the input bus and puts fully charged ones in the output bus --- .../multi/GT_MetaTileEntity_EM_infuser.java | 82 ++++++++++++++++------ 1 file changed, 59 insertions(+), 23 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index fbfbc624b1..e6776f72df 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -13,6 +13,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; @@ -68,6 +69,21 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa eDismantleBoom = true; } + private boolean isItemStackFullyCharged(ItemStack stack) { + if (stack == null) { + return false; + } + Item item = stack.getItem(); + if (stack.stackSize == 1) { + if (item instanceof IElectricItem) { + return ElectricItem.manager.getCharge(stack) >= ((IElectricItem)item).getMaxCharge(stack); + } else if (TecTech.hasCOFH && item instanceof IEnergyContainerItem) { + return ((IEnergyContainerItem)item).getEnergyStored(stack) >= ((IEnergyContainerItem)item).getMaxEnergyStored(stack); + } + } + return false; + } + private long doChargeItemStack(IElectricItem item, ItemStack stack) { try { double euDiff = item.getMaxCharge(stack) - ElectricItem.manager.getCharge(stack); @@ -118,16 +134,23 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa @Override public boolean checkRecipe_EM(ItemStack itemStack) { - if (itemStack != null && itemStack.stackSize == 1) { - Item ofThis = itemStack.getItem(); - if (ofThis instanceof IElectricItem) { - mEfficiencyIncrease = 10000; - mMaxProgresstime = 20; - return true; - } else if (TecTech.hasCOFH && ofThis instanceof IEnergyContainerItem) { - mEfficiencyIncrease = 10000; - mMaxProgresstime = 20; - return true; + for (GT_MetaTileEntity_Hatch_InputBus inputBus : mInputBusses) { + if (inputBus.mInventory != null) { + for (ItemStack itemStackInBus : inputBus.mInventory) { + if (itemStackInBus != null) { + if (itemStackInBus.stackSize == 1) { + if (isItemStackFullyCharged(itemStackInBus)) { + if (addOutput(itemStackInBus)) { + this.depleteInput(itemStackInBus); + } + } else { + mEfficiencyIncrease = 10000; + mMaxProgresstime = 20; + return true; + } + } + } + } } } return false; @@ -135,22 +158,35 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa @Override public void outputAfterRecipe_EM() { - ItemStack itemStack = mInventory[1]; - if (itemStack != null && itemStack.stackSize == 1) { - Item ofThis = itemStack.getItem(); - if (ofThis instanceof IElectricItem) { - if (doChargeItemStack((IElectricItem) ofThis, itemStack) == 0) { - getBaseMetaTileEntity().disableWorking(); + boolean itemProcessed = false; + for (GT_MetaTileEntity_Hatch_InputBus inputBus : mInputBusses) { + if (inputBus.mInventory != null) { + for (ItemStack itemStackInBus : inputBus.mInventory) { + if (itemStackInBus != null) { + Item item = itemStackInBus.getItem(); + if (itemStackInBus.stackSize == 1) { + if (isItemStackFullyCharged(itemStackInBus)) { + itemProcessed = true; + if (addOutput(itemStackInBus)) { + this.depleteInput(itemStackInBus); + } + } else { + if (item instanceof IElectricItem) { + doChargeItemStack((IElectricItem) item, itemStackInBus); + return; + } else if (TecTech.hasCOFH && item instanceof IEnergyContainerItem) { + doChargeItemStackRF((IEnergyContainerItem) item, itemStackInBus); + return; + } + } + } + } } - return; - } else if (TecTech.hasCOFH && ofThis instanceof IEnergyContainerItem) { - if (doChargeItemStackRF((IEnergyContainerItem) ofThis, itemStack) == 0) { - getBaseMetaTileEntity().disableWorking(); - } - return; } } - getBaseMetaTileEntity().disableWorking(); + if (!itemProcessed) { + afterRecipeCheckFailed(); + } } @Override -- cgit From 338b75d9b09ed383f26d73f73cc2be80b8076fa3 Mon Sep 17 00:00:00 2001 From: minecraft7771 Date: Sun, 7 Aug 2022 10:01:06 +0200 Subject: Added functionality to repair items using uu matter --- .../multi/GT_MetaTileEntity_EM_infuser.java | 35 ++++++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index e6776f72df..306d3bd9d2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -11,6 +11,7 @@ import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Materials; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; @@ -22,6 +23,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fluids.FluidStack; import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; @@ -71,7 +73,7 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa private boolean isItemStackFullyCharged(ItemStack stack) { if (stack == null) { - return false; + return true; } Item item = stack.getItem(); if (stack.stackSize == 1) { @@ -81,7 +83,15 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa return ((IEnergyContainerItem)item).getEnergyStored(stack) >= ((IEnergyContainerItem)item).getMaxEnergyStored(stack); } } - return false; + return true; + } + + private boolean isItemStackFullyRepaired(ItemStack stack) { + if (stack == null) { + return true; + } + Item item = stack.getItem(); + return !item.isRepairable() || item.getMaxDamage(stack) <= 0 || item.getDamage(stack) <= 0; } private long doChargeItemStack(IElectricItem item, ItemStack stack) { @@ -138,8 +148,9 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa if (inputBus.mInventory != null) { for (ItemStack itemStackInBus : inputBus.mInventory) { if (itemStackInBus != null) { - if (itemStackInBus.stackSize == 1) { - if (isItemStackFullyCharged(itemStackInBus)) { + Item item = itemStackInBus.getItem(); + if (itemStackInBus.stackSize == 1 && item != null) { + if (isItemStackFullyCharged(itemStackInBus) && isItemStackFullyRepaired(itemStackInBus)) { if (addOutput(itemStackInBus)) { this.depleteInput(itemStackInBus); } @@ -164,13 +175,25 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa for (ItemStack itemStackInBus : inputBus.mInventory) { if (itemStackInBus != null) { Item item = itemStackInBus.getItem(); - if (itemStackInBus.stackSize == 1) { - if (isItemStackFullyCharged(itemStackInBus)) { + if (itemStackInBus.stackSize == 1 && item != null) { + if (isItemStackFullyCharged(itemStackInBus) && isItemStackFullyRepaired(itemStackInBus)) { itemProcessed = true; if (addOutput(itemStackInBus)) { this.depleteInput(itemStackInBus); } } else { + if (item.isRepairable()) { + FluidStack uum = getStoredFluids().stream().filter(fluid -> Materials.UUMatter.getFluid(1).isFluidEqual(fluid)).findAny().orElse(null); + if (uum != null) { + int maxRepairedDamage = Math.max(item.getDamage(itemStackInBus), 1000); + int actualRepairedDamage = Math.min(item.getDamage(itemStackInBus) - maxRepairedDamage, 0); + if (getEUVar() >= actualRepairedDamage) { + item.setDamage(itemStackInBus, actualRepairedDamage); + depleteInput(new FluidStack(Materials.UUMatter.mFluid, Math.max(actualRepairedDamage / 100, 1))); + setEUVar(Math.min(getEUVar() - actualRepairedDamage, 0)); + } + } + } if (item instanceof IElectricItem) { doChargeItemStack((IElectricItem) item, itemStackInBus); return; -- cgit From be966a5ea951df09ff6d95da67b19eae69be17d5 Mon Sep 17 00:00:00 2001 From: minecraft7771 Date: Sun, 7 Aug 2022 10:09:55 +0200 Subject: Changed tooltip to fit the new behavior --- .../thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java | 6 +++--- src/main/resources/assets/tectech/lang/en_US.lang | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index 306d3bd9d2..bf699851df 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -215,10 +215,10 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa @Override public GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(translateToLocal("gt.blockmachines.multimachine.em.infuser.name")) // Machine Type: Network Switch With QoS + tt.addMachineType(translateToLocal("gt.blockmachines.multimachine.em.infuser.name")) // Machine Type: Energy Infuser .addInfo(translateToLocal("gt.blockmachines.multimachine.em.infuser.desc.0")) // Controller block of the Energy Infuser - .addInfo(translateToLocal("gt.blockmachines.multimachine.em.infuser.desc.1")) // Can be used to charge items in the controller GUI - .addInfo(translateToLocal("gt.blockmachines.multimachine.em.infuser.desc.2")) // Has a loss of 3.125% + .addInfo(translateToLocal("gt.blockmachines.multimachine.em.infuser.desc.1")) // Can be used to charge items (lossless) + .addInfo(translateToLocal("gt.blockmachines.multimachine.em.infuser.desc.2")) // Can be fed with UU-Matter to repair items .addSeparator() .beginStructureBlock(3, 5, 3, false) .addController(translateToLocal("tt.keyword.Structure.FrontCenter3rd")) // Controller: Front 3rd layer center diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang index 15c174691f..6393b2eeed 100644 --- a/src/main/resources/assets/tectech/lang/en_US.lang +++ b/src/main/resources/assets/tectech/lang/en_US.lang @@ -690,8 +690,8 @@ gt.blockmachines.multimachine.em.collider.Structure.AdditionalCollider=Needs ano gt.blockmachines.multimachine.em.infuser.name=Energy Infuser gt.blockmachines.multimachine.em.infuser.hint=1 - Classic Hatches or High Power Casing gt.blockmachines.multimachine.em.infuser.desc.0=Controller block of the Energy Infuser -gt.blockmachines.multimachine.em.infuser.desc.1=Can be used to charge items in the controller GUI -gt.blockmachines.multimachine.em.infuser.desc.2=Has a loss of 3.125% +gt.blockmachines.multimachine.em.infuser.desc.1=Can be used to charge items (lossless) +gt.blockmachines.multimachine.em.infuser.desc.2=Can be fed with UU-Matter to repair items gt.blockmachines.multimachine.em.infuser.Structure.HighPowerCasing=Layer 1 and 5 gt.blockmachines.multimachine.em.infuser.Structure.MolecularCoil=Layer 2 and 4 gt.blockmachines.multimachine.em.infuser.Structure.MolecularCasing=Layer 3 (hollow) -- cgit From 88656e0e321993dc4291e04e9e64ee3080303aea Mon Sep 17 00:00:00 2001 From: minecraft7771 Date: Sun, 7 Aug 2022 11:11:25 +0200 Subject: Tiered recipes of the infuser down to ZPM --- .../dreamcraft/DreamCraftRecipeLoader.java | 31 ++++++++++------------ 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index de305099bf..351506a459 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -152,35 +152,33 @@ public class DreamCraftRecipeLoader { }, Materials.Osmium.getMolten(1296), CustomItemList.eM_Containment.get(1), 800, 500000); //Hollow Casing - TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.eM_Containment.get(1), - 12000, 32, 500000, 6, new ItemStack[]{ + GT_Values.RA.addAssemblylineRecipe(CustomItemList.eM_Containment.get(1), 7500, new ItemStack[]{ CustomItemList.eM_Containment.get(1), - GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Neutronium, 2), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Europium, 2), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, Materials.Plutonium, 4), GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Lead, 8), - GT_OreDictUnificator.get(OrePrefixes.plate, getOrDefault("BlackPlutonium", Materials.Americium), 16), - GT_OreDictUnificator.get(OrePrefixes.screw, getOrDefault("Quantium", Materials.Neutronium), 16), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Uranium, 16), + GT_OreDictUnificator.get(OrePrefixes.screw, getOrDefault("Quantium", Materials.Europium), 16), }, new FluidStack[]{ getOrDefault("Trinium", Materials.Osmium).getMolten(1296), Materials.Osmium.getMolten(1296), new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), Materials.Argon.getGas(1000), - }, CustomItemList.eM_Hollow.get(2), 200, 2000000); + }, CustomItemList.eM_Hollow.get(2), 200, 200000); //EM Coil - TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.eM_Hollow.get(1), - 48000, 128, 1000000, 16, new ItemStack[]{ + GT_Values.RA.addAssemblylineRecipe(CustomItemList.eM_Hollow.get(1), 7500, new ItemStack[]{ CustomItemList.eM_Hollow.get(1), - ItemList.Casing_Fusion_Coil.get(4), - ItemList.Casing_Coil_NaquadahAlloy.get(4), - GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Neutronium, 64), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Neutronium, 64), + ItemList.Casing_Fusion_Coil.get(2), + ItemList.Casing_Coil_NaquadahAlloy.get(2), + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.Europium, 64), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Europium, 64), }, new FluidStack[]{ Materials.Glass.getMolten(2304), Materials.Silicone.getMolten(1872), new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), getOrDefault("Trinium", Materials.Osmium).getMolten(1296), - }, CustomItemList.eM_Coil.get(4), 800, 2000000); + }, CustomItemList.eM_Coil.get(4), 800, 200000); // Infinite Oil Rig TT_recipeAdder.addResearchableAssemblylineRecipe(ItemList.OilDrill3.get(1), @@ -771,17 +769,16 @@ public class DreamCraftRecipeLoader { }, CustomItemList.Machine_Multi_Scanner.get(1), 24000, 500000); //Multi Infuser - TT_recipeAdder.addResearchableAssemblylineRecipe(CustomItemList.Machine_Multi_Transformer.get(1), - 192000, 512, 2000000, 32, new ItemStack[]{ + GT_Values.RA.addAssemblylineRecipe(CustomItemList.Machine_Multi_Transformer.get(1), 7500, new ItemStack[]{ CustomItemList.Machine_Multi_Transformer.get(1), CustomItemList.eM_Coil.get(8), CustomItemList.eM_Power.get(8), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.NeodymiumMagnetic, 16), }, new FluidStack[]{ Materials.Electrum.getMolten(2592), - Materials.Neutronium.getMolten(1872), + Materials.Europium.getMolten(1872), new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), - }, CustomItemList.Machine_Multi_Infuser.get(1), 8000, 2000000); + }, CustomItemList.Machine_Multi_Infuser.get(1), 8000, 200000); item_parts_UHV_assline_recipes(); -- cgit From 4b3c361586849ea83f6b4069069e2d956c7a37b3 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Mon, 8 Aug 2022 14:44:59 +0100 Subject: biomain and nano computation buff --- .../thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java index 0ef4a38a3d..e890a5e60b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Rack.java @@ -321,12 +321,12 @@ public class GT_MetaTileEntity_Hatch_Rack extends GT_MetaTileEntity_Hatch { new RackComponent(ItemList.NandChip.get(1), 2, 6, 0, 750, true);//Primitive Circuit new RackComponent(ItemList.Circuit_Biowarecomputer.get(1), 40, 26, -.35F, 5900, true); new RackComponent(ItemList.Circuit_Biowaresupercomputer.get(1), 42, 30, -.4F, 6200, true); - new RackComponent(ItemList.Circuit_Biomainframe.get(1), 40, 28, -.4F, 6000, true);//UHV Circuit + new RackComponent(ItemList.Circuit_Biomainframe.get(1), 44, 28, -.4F, 6000, true);//UEV Circuit new RackComponent(ItemList.Circuit_Bioprocessor.get(1), 34, 20, -.35F, 5800, true); new RackComponent("dreamcraft:item.HighEnergyCircuitParts", 3, 2, -.1f, 9001, true); new RackComponent("dreamcraft:item.HighEnergyFlowCircuit", 24, 16, -.25f, 10000, true); - new RackComponent("dreamcraft:item.NanoCircuit", 48, 35, -.45f, 8000, true); + new RackComponent("dreamcraft:item.NanoCircuit", 50, 35, -.45f, 8000, true); new RackComponent("dreamcraft:item.PikoCircuit", 64, 40, -.5f, 8500, true); new RackComponent("dreamcraft:item.QuantumCircuit", 128, 48, -.6f, 9000, true); } -- cgit From 41f917a95588f56813ac381ad0ba28542b159525 Mon Sep 17 00:00:00 2001 From: minecraft7771 Date: Tue, 9 Aug 2022 15:14:10 +0200 Subject: Moved magic numbers out of code and adjusted repair costs --- .../multi/GT_MetaTileEntity_EM_infuser.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index bf699851df..51262076cd 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -38,6 +38,11 @@ import static net.minecraft.util.StatCollector.translateToLocal; * Created by danie_000 on 17.12.2016. */ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + + private static final int maxRepairedDamagePerOperation = 1000; + private static final long usedEuPerDurability = 1000; + private static final int usedUumPerDurability = 1; + //region structure private static final String[] description = new String[]{ EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", @@ -185,12 +190,11 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa if (item.isRepairable()) { FluidStack uum = getStoredFluids().stream().filter(fluid -> Materials.UUMatter.getFluid(1).isFluidEqual(fluid)).findAny().orElse(null); if (uum != null) { - int maxRepairedDamage = Math.max(item.getDamage(itemStackInBus), 1000); - int actualRepairedDamage = Math.min(item.getDamage(itemStackInBus) - maxRepairedDamage, 0); - if (getEUVar() >= actualRepairedDamage) { - item.setDamage(itemStackInBus, actualRepairedDamage); - depleteInput(new FluidStack(Materials.UUMatter.mFluid, Math.max(actualRepairedDamage / 100, 1))); - setEUVar(Math.min(getEUVar() - actualRepairedDamage, 0)); + int repairedDamage = Math.min(item.getDamage(itemStackInBus), maxRepairedDamagePerOperation); + long euCost = repairedDamage * usedEuPerDurability; + if (getEUVar() >= euCost && depleteInput(new FluidStack(Materials.UUMatter.mFluid,repairedDamage * usedUumPerDurability))) { + item.setDamage(itemStackInBus, Math.max(item.getDamage(itemStackInBus) - repairedDamage, 0)); + setEUVar(Math.min(getEUVar() - euCost, 0)); } } } -- cgit From a4ca89f2d9c0f119694410e81775436811264f1e Mon Sep 17 00:00:00 2001 From: POPlol333 Date: Tue, 9 Aug 2022 22:38:52 +0200 Subject: changing UIV/UMV energy hatch and dynamo to use their own SC, also nerfed stargate lol --- dependencies.gradle | 2 +- .../compatibility/dreamcraft/DreamCraftRecipeLoader.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main/java/com') diff --git a/dependencies.gradle b/dependencies.gradle index 265d368702..2ec71212ef 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -3,7 +3,7 @@ dependencies { shadowImplementation('com.github.GTNewHorizons:AVRcore:master-SNAPSHOT') - compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.40.84:dev') + compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.40.88:dev') compile('com.github.GTNewHorizons:Yamcl:0.5.82:dev') compile('com.github.GTNewHorizons:NotEnoughItems:2.2.15-GTNH:dev') compile('com.github.GTNewHorizons:CodeChickenLib:1.1.5.3:dev') diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index eb5c3fbe8c..b5637dbef7 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -874,7 +874,7 @@ public class DreamCraftRecipeLoader { TT_recipeAdder.addResearchableAssemblylineRecipe(getItemContainer("Hatch_Energy_UEV").get(1L), 96_000, 64, 200_000, 8, new Object[]{ getItemContainer("Hull_UIV").get(1L), - GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.SuperconductorUEV, 8L), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUIV, 2L), ItemList.Circuit_Chip_QPIC.get(4L), getItemContainer("NanoCircuit").get(2), ItemList.UHV_Coil.get(8L), @@ -894,7 +894,7 @@ public class DreamCraftRecipeLoader { TT_recipeAdder.addResearchableAssemblylineRecipe(getItemContainer("Hatch_Dynamo_UEV").get(1L), 192_000, 128, 400_000, 16, new Object[]{ getItemContainer("Hull_UIV").get(1L), - GT_OreDictUnificator.get(OrePrefixes.spring, Materials.SuperconductorUEVBase, 32L), + GT_OreDictUnificator.get(OrePrefixes.spring, Materials.SuperconductorUIVBase, 8L), ItemList.Circuit_Chip_QPIC.get(4L), getItemContainer("NanoCircuit").get(2), ItemList.UHV_Coil.get(8L), @@ -915,7 +915,7 @@ public class DreamCraftRecipeLoader { TT_recipeAdder.addResearchableAssemblylineRecipe(getItemContainer("Hatch_Energy_UIV").get(1L), 192000, 128, 400000, 16, new Object[]{ getItemContainer("Hull_UMV").get(1L), - GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUEV, 16L), + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUMV, 2L), ItemList.Circuit_Chip_QPIC.get(4L), getItemContainer("PikoCircuit").get(2), ItemList.UHV_Coil.get(16L), @@ -938,7 +938,7 @@ public class DreamCraftRecipeLoader { TT_recipeAdder.addResearchableAssemblylineRecipe(getItemContainer("Hatch_Dynamo_UIV").get(1L), 384000, 256, 800000, 32, new Object[]{ getItemContainer("Hull_UMV").get(1L), - GT_OreDictUnificator.get(OrePrefixes.spring, Materials.SuperconductorUEVBase, 64L), + GT_OreDictUnificator.get(OrePrefixes.spring, Materials.SuperconductorUMVBase, 8L), ItemList.Circuit_Chip_QPIC.get(4L), getItemContainer("PikoCircuit").get(2), ItemList.UHV_Coil.get(16L), @@ -1104,7 +1104,7 @@ public class DreamCraftRecipeLoader { new FluidStack[]{ Materials.Neutronium.getMolten(32_768_000L), Materials.SpaceTime.getMolten(4*36864L), - Materials.SuperconductorUEVBase.getMolten(4*36864L), + Materials.SuperconductorUMVBase.getMolten(4*36864L), Materials.ExcitedDTEC.getFluid(4*36864L) }, getItemContainer("StargateShieldingFoil").get(1L), 72_000, 500_000_000); @@ -1135,7 +1135,7 @@ public class DreamCraftRecipeLoader { new FluidStack[]{ Materials.Neutronium.getMolten(32_768_000L), Materials.SpaceTime.getMolten(4*36864L), - Materials.SuperconductorUEVBase.getMolten(4*36864L), + Materials.SuperconductorUMVBase.getMolten(4*36864L), Materials.ExcitedDTEC.getFluid(4*36864L) }, getItemContainer("StargateChevron").get(1L), 72_000, 500_000_000); @@ -1158,7 +1158,7 @@ public class DreamCraftRecipeLoader { GT_ModHandler.getModItem("bartworks", "gt.bwMetaGeneratedstickLong", 64L, 10106), GT_ModHandler.getModItem("miscutils", "itemRodLongAstralTitanium", 64L), - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.SuperconductorUEVBase, 64L), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.SuperconductorUMVBase, 64L), GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Sunnarium, 64L), GT_ModHandler.getModItem("miscutils", "itemRodLongAbyssalAlloy", 64L), GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.TranscendentMetal, 64L), @@ -1167,7 +1167,7 @@ public class DreamCraftRecipeLoader { new FluidStack[]{ Materials.Neutronium.getMolten(32_768_000L), Materials.SpaceTime.getMolten(4*36864L), - Materials.SuperconductorUEVBase.getMolten(4*36864L), + Materials.SuperconductorUMVBase.getMolten(4*36864L), Materials.ExcitedDTEC.getFluid(4*36864L) }, getItemContainer("StargateFramePart").get(1L), 72_000, 500_000_000); -- cgit From 719a37c0b46badf91de1d92d2a1b245bedd11584 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Wed, 10 Aug 2022 22:01:00 +0100 Subject: add DEFC recipe to TT --- .../dreamcraft/DreamCraftRecipeLoader.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index eb5c3fbe8c..57e5048b61 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -1392,6 +1392,27 @@ public class DreamCraftRecipeLoader { ELEMENT.STANDALONE.ASTRAL_TITANIUM.getFluidStack(576), }, GregtechItemList.Casing_Fusion_External.get(1), 300, 2000000); + // Draconic Evolution Fusion Controller controller + if (Loader.isModLoaded("AWWayofTime")&&Loader.isModLoaded("EMT")){ + TT_recipeAdder.addResearchableAssemblylineRecipe(GT_ModHandler.getModItem("EMT", "EMT_GTBLOCK_CASEING", 1, 8), + 16_777_216, 1024, 2_000_000, 8, new Object[]{ + GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 10783), + GT_ModHandler.getModItem("EMT", "EMT_GTBLOCK_CASEING", 1, 8), + GT_OreDictUnificator.get(OrePrefixes.plateDense, MaterialsBotania.GaiaSpirit, 1L), + ItemList.Casing_Coil_AwakenedDraconium.get(8L), + ItemList.Electric_Motor_UHV.get(8L), + ItemList.Robot_Arm_UHV.get(4L), + new Object[]{OrePrefixes.circuit.get(Materials.Infinite), 4}, + ItemList.Gravistar.get(4, new Object(){}), + GT_ModHandler.getModItem("Thaumcraft", "ItemEldritchObject", 1, 3), + GT_ModHandler.getModItem("AWWayofTime", "bloodMagicBaseItems", 8, 29), + GT_ModHandler.getModItem("AWWayofTime", "bloodMagicBaseItems", 8, 28), + }, new FluidStack[]{ + new FluidStack(solderIndalloy, 2880), + Materials.Void.getMolten(2880L), + Materials.DraconiumAwakened.getMolten(1440), + }, DECC, 1500, 8_000_000); + } //region singleblocks -- cgit From 3f7b83774e4fd7fe2e5e8e6a9379768c2ab02f2b Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Wed, 10 Aug 2022 22:08:31 +0100 Subject: get the controller --- .../tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index 57e5048b61..2bd5511707 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -1411,7 +1411,7 @@ public class DreamCraftRecipeLoader { new FluidStack(solderIndalloy, 2880), Materials.Void.getMolten(2880L), Materials.DraconiumAwakened.getMolten(1440), - }, DECC, 1500, 8_000_000); + }, GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 5001), 1500, 8_000_000); } //region singleblocks -- cgit From fa64ac388249264734bd28c647a0622342257b0b Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Wed, 10 Aug 2022 22:15:41 +0100 Subject: get gt botania materials --- .../technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index 2bd5511707..f8c50aac4b 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -13,6 +13,7 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; +import gregtech.api.enums.MaterialsBotania; import gregtech.api.enums.OrePrefixes; import gregtech.api.interfaces.IItemContainer; import gregtech.api.util.GT_ModHandler; -- cgit From 45295e6d6fdc854de838d0bb022f16d93ec8e599 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Wed, 10 Aug 2022 22:30:21 +0100 Subject: typo --- .../tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java index f8c50aac4b..5da9551d34 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/compatibility/dreamcraft/DreamCraftRecipeLoader.java @@ -1393,7 +1393,7 @@ public class DreamCraftRecipeLoader { ELEMENT.STANDALONE.ASTRAL_TITANIUM.getFluidStack(576), }, GregtechItemList.Casing_Fusion_External.get(1), 300, 2000000); - // Draconic Evolution Fusion Controller controller + // Draconic Evolution Fusion Crafter Controller if (Loader.isModLoaded("AWWayofTime")&&Loader.isModLoaded("EMT")){ TT_recipeAdder.addResearchableAssemblylineRecipe(GT_ModHandler.getModItem("EMT", "EMT_GTBLOCK_CASEING", 1, 8), 16_777_216, 1024, 2_000_000, 8, new Object[]{ -- cgit From 6a30ab9aaa4cbf35b5fe93e80760f7908f810676 Mon Sep 17 00:00:00 2001 From: minecraft7771 Date: Thu, 11 Aug 2022 19:53:19 +0200 Subject: Backported rotation logic from enhanced mulitblock base to allow all TT based machines to be rotated more freely --- .../base/GT_MetaTileEntity_MultiblockBase_EM.java | 27 +++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index b74ac5023a..e8228d0f03 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java @@ -34,6 +34,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -175,22 +176,36 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt @Override public void setExtendedFacing(ExtendedFacing newExtendedFacing) { if (extendedFacing != newExtendedFacing) { + if(mMachine) + stopMachine(); extendedFacing = newExtendedFacing; - IGregTechTileEntity base = getBaseMetaTileEntity(); + final IGregTechTileEntity base = getBaseMetaTileEntity(); mMachine = false; + mUpdated = false; + mUpdate = 100; if (getBaseMetaTileEntity().isServerSide()) { - //NetworkDispatcher.INSTANCE.sendToAllAround(new AlignmentMessage.AlignmentData(this), - // base.getWorld().provider.dimensionId, - // base.getXCoord(), base.getYCoord(), base.getZCoord(), 512); StructureLibAPI.sendAlignment((IAlignmentProvider) base, - new NetworkRegistry.TargetPoint(base.getWorld().provider.dimensionId, - base.getXCoord(), base.getYCoord(), base.getZCoord(), 512)); + new NetworkRegistry.TargetPoint(base.getWorld().provider.dimensionId, base.getXCoord(), base.getYCoord(), base.getZCoord(), 512)); } else { base.issueTextureUpdate(); } } } + @Override + public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (aWrenchingSide != getBaseMetaTileEntity().getFrontFacing()) + return super.onWrenchRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ); + if (aPlayer.isSneaking()) { + // we won't be allowing horizontal flips, as it can be perfectly emulated by rotating twice and flipping horizontally + // allowing an extra round of flip make it hard to draw meaningful flip markers in GT_Proxy#drawGrid + toolSetFlip(getFlip().isHorizontallyFlipped() ? Flip.NONE : Flip.HORIZONTAL); + } else { + toolSetRotation(null); + } + return true; + } + @Override public boolean isFacingValid(byte aFacing) { return canSetToDirectionAny(ForgeDirection.getOrientation(aFacing)); -- cgit From eac4a73bd06afe71ac3bd69a35868e2018940e3b Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Wed, 17 Aug 2022 14:54:38 +0800 Subject: reduce visibility --- .../metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index e8228d0f03..45bd9d39de 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java @@ -346,7 +346,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } @Override - public GT_Multiblock_Tooltip_Builder createTooltip() { + protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addInfo("Nothing special just override me") .toolTipFinisher(TEC_MARK_GENERAL); -- cgit