diff options
author | Martin Robertz <dream-master@gmx.net> | 2022-08-19 14:05:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-19 14:05:30 +0200 |
commit | 406ee6c4df68152f44615caeb62ddc448b119676 (patch) | |
tree | 56892ef0064ade9288804b2e513128e7bd9cb011 | |
parent | cb2da6fac873099cf138aaf498ac27bd4629d803 (diff) | |
parent | 9ed7b4b6d68662ea53324db342a7b41c2c900b23 (diff) | |
download | GT5-Unofficial-406ee6c4df68152f44615caeb62ddc448b119676.tar.gz GT5-Unofficial-406ee6c4df68152f44615caeb62ddc448b119676.tar.bz2 GT5-Unofficial-406ee6c4df68152f44615caeb62ddc448b119676.zip |
Merge branch 'master' into feature/autoplace
6 files changed, 165 insertions, 72 deletions
diff --git a/dependencies.gradle b/dependencies.gradle index 4689997e66..9e2ff3e98a 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,19 +2,18 @@ dependencies { shadowImplementation('com.github.GTNewHorizons:AVRcore:master-SNAPSHOT') - - compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.40.89:dev') + compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.00:dev') compile('com.github.GTNewHorizons:Yamcl:0.5.82:dev') - compile('com.github.GTNewHorizons:NotEnoughItems:2.2.15-GTNH:dev') + compile('com.github.GTNewHorizons:NotEnoughItems:2.2.22:dev') compile('com.github.GTNewHorizons:CodeChickenLib:1.1.5.3:dev') compile('com.github.GTNewHorizons:CodeChickenCore:1.1.4:dev') - compile('com.github.GTNewHorizons:StructureLib:1.0.15:dev') + compile('com.github.GTNewHorizons:StructureLib:1.1.3:dev') compile('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev') compileOnly('com.github.GTNewHorizons:OpenModularTurrets:2.2.11-247:dev') {transitive=false} compileOnly('com.github.GTNewHorizons:OpenComputers:1.7.5.23-GTNH:dev') {transitive=false} - compileOnly('com.github.GTNewHorizons:GTplusplus:1.7.32:dev') {transitive=false} - compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-85-GTNH:dev') {transitive=false} + compileOnly('com.github.GTNewHorizons:GTplusplus:1.7.71:dev') {transitive=false} + compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-94-GTNH:dev') {transitive=false} compileOnly('curse.maven:cofh-lib-220333:2388748') {transitive=false} compileOnly('curse.maven:computercraft-67504:2269339') {transitive=false} 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..40e81c5706 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; @@ -152,35 +153,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 +770,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(); @@ -874,7 +872,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 +892,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 +913,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 +936,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 +1102,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 +1133,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 +1156,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 +1165,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); @@ -1392,6 +1390,27 @@ public class DreamCraftRecipeLoader { ELEMENT.STANDALONE.ASTRAL_TITANIUM.getFluidStack(576), }, GregtechItemList.Casing_Fusion_External.get(1), 300, 2000000); + // 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[]{ + 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), + }, GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 1, 5001), 1500, 8_000_000); + } //region singleblocks 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); } 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..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 @@ -11,8 +11,10 @@ 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; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; @@ -21,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; @@ -35,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") + ":", @@ -68,12 +76,32 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa eDismantleBoom = true; } + private boolean isItemStackFullyCharged(ItemStack stack) { + if (stack == null) { + return true; + } + 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 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) { 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 +122,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); @@ -122,16 +149,24 @@ 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) { + Item item = itemStackInBus.getItem(); + if (itemStackInBus.stackSize == 1 && item != null) { + if (isItemStackFullyCharged(itemStackInBus) && isItemStackFullyRepaired(itemStackInBus)) { + if (addOutput(itemStackInBus)) { + this.depleteInput(itemStackInBus); + } + } else { + mEfficiencyIncrease = 10000; + mMaxProgresstime = 20; + return true; + } + } + } + } } } return false; @@ -139,31 +174,55 @@ 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(); - } - return; - } else if (TecTech.hasCOFH && ofThis instanceof IEnergyContainerItem) { - if (doChargeItemStackRF((IEnergyContainerItem) 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 && 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 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)); + } + } + } + if (item instanceof IElectricItem) { + doChargeItemStack((IElectricItem) item, itemStackInBus); + return; + } else if (TecTech.hasCOFH && item instanceof IEnergyContainerItem) { + doChargeItemStackRF((IEnergyContainerItem) item, itemStackInBus); + return; + } + } + } + } } - return; } } - getBaseMetaTileEntity().disableWorking(); + if (!itemProcessed) { + afterRecipeCheckFailed(); + } } @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/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 33dc1270d3..86ca00d80e 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 @@ -37,6 +37,8 @@ import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -182,16 +184,16 @@ 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(); } @@ -199,6 +201,20 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt } @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)); } @@ -349,7 +365,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); 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) |