From 8e3024edfde8317f4f0073842563c45a3cb41ab6 Mon Sep 17 00:00:00 2001 From: basdxz Date: Mon, 6 Jul 2020 17:23:30 +0100 Subject: Add Plasma Boosting to Tesla Towers --- .../technus/tectech/loader/TecTechConfig.java | 22 +++-- .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 100 +++++++++++++++++---- 2 files changed, 99 insertions(+), 23 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java b/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java index 0c2920e585..2cc52e8513 100644 --- a/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java +++ b/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java @@ -24,12 +24,12 @@ public class TecTechConfig extends ConfigManager { public float TESLA_MULTI_MIN_EFFICIENCY; public float TESLA_MULTI_MAX_EFFICIENCY; public float TESLA_MULTI_OVERDRIVE_LOSS; + public int TESLA_MULTI_SCAN_RANGE; + public boolean TESLA_MULTI_MOLTEN_OUTPUT; public float TESLA_SINGLE_MIN_EFFICIENCY; public float TESLA_SINGLE_MAX_EFFICIENCY; public float TESLA_SINGLE_OVERDRIVE_LOSS; - - /** * This loading phases do not correspond to mod loading phases! */ @@ -47,6 +47,8 @@ public class TecTechConfig extends ConfigManager { TESLA_MULTI_MIN_EFFICIENCY = 0.955F; TESLA_MULTI_MAX_EFFICIENCY = 0.98F; TESLA_MULTI_OVERDRIVE_LOSS = 0.005F; + TESLA_MULTI_SCAN_RANGE = 40; + TESLA_MULTI_MOLTEN_OUTPUT = false; TESLA_SINGLE_MIN_EFFICIENCY = 0.91F; TESLA_SINGLE_MAX_EFFICIENCY = 0.95F; TESLA_SINGLE_OVERDRIVE_LOSS = 0.010F; @@ -78,17 +80,21 @@ public class TecTechConfig extends ConfigManager { "Set to true to disable the block hardness nerf"); DISABLE_MATERIAL_LOADING_FFS = _mainConfig.getBoolean("DisableMaterialLoading", "Debug", DISABLE_MATERIAL_LOADING_FFS, "Set to true to disable gregtech material processing"); - TESLA_MULTI_MIN_EFFICIENCY = _mainConfig.getFloat("teslaMultiMinEfficency", "Features", TESLA_MULTI_MIN_EFFICIENCY, 0, 1, + TESLA_MULTI_MIN_EFFICIENCY = _mainConfig.getFloat("TeslaMultiMinEfficency", "Features", TESLA_MULTI_MIN_EFFICIENCY, 0, 1, "Worst possible power loss per block for the multi block tesla"); - TESLA_MULTI_MAX_EFFICIENCY = _mainConfig.getFloat("teslaMultiMaxEfficency", "Features", TESLA_MULTI_MAX_EFFICIENCY, 0, 1, + TESLA_MULTI_MAX_EFFICIENCY = _mainConfig.getFloat("TeslaMultiMaxEfficency", "Features", TESLA_MULTI_MAX_EFFICIENCY, 0, 1, "Best possible power loss per block for the multi block tesla"); - TESLA_MULTI_OVERDRIVE_LOSS = _mainConfig.getFloat("teslaMultiOverdriveLoss", "Features", TESLA_MULTI_OVERDRIVE_LOSS, 0, 1, + TESLA_MULTI_OVERDRIVE_LOSS = _mainConfig.getFloat("TeslaMultiOverdriveLoss", "Features", TESLA_MULTI_OVERDRIVE_LOSS, 0, 1, "Additional losses for overdrive use on the multi block tesla"); - TESLA_SINGLE_MIN_EFFICIENCY = _mainConfig.getFloat("teslaSingleMinEfficency", "Features", TESLA_SINGLE_MIN_EFFICIENCY, 0, 1, + TESLA_MULTI_SCAN_RANGE = _mainConfig.getInt("TeslaMultiScanRange", "Features", TESLA_MULTI_SCAN_RANGE, 4, 256, + "Determines the scan range constant for multi block tesla"); + TESLA_MULTI_MOLTEN_OUTPUT = _mainConfig.getBoolean("TeslaMultiMoltenOutput", "Features", TESLA_MULTI_MOLTEN_OUTPUT, + "Set to true to get molten outputs when boosting the multi block tesla with plasmas"); + TESLA_SINGLE_MIN_EFFICIENCY = _mainConfig.getFloat("TeslaSingleMinEfficency", "Features", TESLA_SINGLE_MIN_EFFICIENCY, 0, 1, "Worst possible power loss per block for the single block tesla"); - TESLA_SINGLE_MAX_EFFICIENCY = _mainConfig.getFloat("teslaSingleMaxEfficency", "Features", TESLA_SINGLE_MAX_EFFICIENCY, 0, 1, + TESLA_SINGLE_MAX_EFFICIENCY = _mainConfig.getFloat("TeslaSingleMaxEfficency", "Features", TESLA_SINGLE_MAX_EFFICIENCY, 0, 1, "Best possible power loss per block for the single block tesla"); - TESLA_SINGLE_OVERDRIVE_LOSS = _mainConfig.getFloat("teslaSingleOverdriveLoss", "Features", TESLA_SINGLE_OVERDRIVE_LOSS, 0, 1, + TESLA_SINGLE_OVERDRIVE_LOSS = _mainConfig.getFloat("TeslaSingleOverdriveLoss", "Features", TESLA_SINGLE_OVERDRIVE_LOSS, 0, 1, "Additional losses for overdrive use on the single block tesla"); } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java index 89093bdba7..dac8800894 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -23,6 +23,7 @@ import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.Vec3Impl; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -33,6 +34,7 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.HashMap; @@ -57,20 +59,24 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; - + //TODO Make the setting abstractions static, if they aren't changed at tick time private int mTier = 0; //Determines max voltage and efficiency (MV to LuV) private int maxTier = 6; //Max tier for efficiency calcuation + private int plasmaTier = 0; //0 is None, 1 is Helium or Nitrogen, 2 is Radon + private boolean doFluidOutput = TecTech.configTecTech.TESLA_MULTI_MOLTEN_OUTPUT; //Default is false + private FluidStack[] mOutputFluidsQueue; //Used to buffer the fluid outputs for one second private float energyEfficiency = 1; private float overdriveEfficiency = 1; private float minEfficiency = TecTech.configTecTech.TESLA_MULTI_MIN_EFFICIENCY;//Default is 0.955F - private float maxEfficiency = TecTech.configTecTech.TESLA_MULTI_MAX_EFFICIENCY;//Default is 0.98F; + private float maxEfficiency = TecTech.configTecTech.TESLA_MULTI_MAX_EFFICIENCY;//Default is 0.98F private float overdriveEfficiencyExtra = TecTech.configTecTech.TESLA_MULTI_OVERDRIVE_LOSS;//Default is 0.005F private Map eTeslaMap = new HashMap<>(); //Used to store targets for power transmission private final ArrayList eCapacitorHatches = new ArrayList<>(); //Used to determine count and tier of capacitors present private int scanTime = 0; //Scan timer used for tesla search intervals + private int scanRangeXZ = TecTech.configTecTech.TESLA_MULTI_SCAN_RANGE;//Default is 40 private long energyCapacity = 0; //Total energy storage limited by capacitors private long outputVoltageMax = 0; //Tesla voltage output limited by capacitors @@ -254,11 +260,25 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock } private float getRangeMulti(int mTier, int vTier) { + //Helium and Nitrogen Plasmas will double the range + //Radon will quadruple the range + int plasmaBoost; + switch (plasmaTier) { + case 2: + plasmaBoost = 4; + break; + case 1: + plasmaBoost = 2; + break; + default: + plasmaBoost = 1; + } + //Over-tiered coils will add +25% range if (vTier > mTier) { - return 1.25F; + return 1.25F * plasmaBoost; } - return 1F; + return 1F * plasmaBoost; } private void scanForTransmissionTargets(Vec3Impl coordsMin, Vec3Impl coordsMax) { @@ -302,6 +322,46 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock sparkList.add(new ThaumSpark(posTop.get0(), posTop.get1(), posTop.get2(), xR, yR, zR, wID)); } + private void checkPlasmaBoost() { + //If there's fluid in the queue, try to output it + //That way it takes at least a second to 'process' the plasma + if (mOutputFluidsQueue != null) { + mOutputFluids = mOutputFluidsQueue; + mOutputFluidsQueue = null; + } + + for (GT_MetaTileEntity_Hatch_Input fluidHatch : mInputHatches) { + if (fluidHatch.mFluid != null) { + if (fluidHatch.mFluid.isFluidEqual(Materials.Helium.getPlasma(1)) && fluidHatch.mFluid.amount >= 100) { + System.out.print("HELIUM\n"); + fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - 100; + if (doFluidOutput) { + mOutputFluidsQueue = new FluidStack[]{Materials.Helium.getGas(100)}; + } + plasmaTier = 1; + return; + } else if (fluidHatch.mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && fluidHatch.mFluid.amount >= 50) { + System.out.print("NITRO\n"); + fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - 50; + if (doFluidOutput) { + mOutputFluidsQueue = new FluidStack[]{Materials.Nitrogen.getGas(50)}; + } + plasmaTier = 1; + return; + } else if (fluidHatch.mFluid.isFluidEqual(Materials.Radon.getPlasma(1)) && fluidHatch.mFluid.amount >= 50) { + System.out.print("RADON\n"); + fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - 50; + if (doFluidOutput) { + mOutputFluidsQueue = new FluidStack[]{Materials.Radon.getGas(50)}; + } + plasmaTier = 2; + return; + } + } + } + plasmaTier = 0; + } + @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_TM_teslaCoil(mName); @@ -340,20 +400,20 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock posTop = getExtendedFacing().getWorldOffset(new Vec3Impl(0, -14, 2)).add(getBaseMetaTileEntity()); //Calculate offsets for scanning - scanPosOffsets[0] = getExtendedFacing().getWorldOffset(new Vec3Impl(40, 0, 43)); - scanPosOffsets[1] = getExtendedFacing().getWorldOffset(new Vec3Impl(-40, -4, -37)); + scanPosOffsets[0] = getExtendedFacing().getWorldOffset(new Vec3Impl(scanRangeXZ, 0, scanRangeXZ + 3)); + scanPosOffsets[1] = getExtendedFacing().getWorldOffset(new Vec3Impl(-1 * scanRangeXZ, -4, -1 * scanRangeXZ + 3)); - scanPosOffsets[2] = getExtendedFacing().getWorldOffset(new Vec3Impl(40, -5, 43)); - scanPosOffsets[3] = getExtendedFacing().getWorldOffset(new Vec3Impl(-40, -8, -37)); + scanPosOffsets[2] = getExtendedFacing().getWorldOffset(new Vec3Impl(scanRangeXZ, -5, scanRangeXZ + 3)); + scanPosOffsets[3] = getExtendedFacing().getWorldOffset(new Vec3Impl(-1 * scanRangeXZ, -8, -1 * scanRangeXZ + 3)); - scanPosOffsets[4] = getExtendedFacing().getWorldOffset(new Vec3Impl(40, -9, 43)); - scanPosOffsets[5] = getExtendedFacing().getWorldOffset(new Vec3Impl(-40, -12, -37)); + scanPosOffsets[4] = getExtendedFacing().getWorldOffset(new Vec3Impl(scanRangeXZ, -9, scanRangeXZ + 3)); + scanPosOffsets[5] = getExtendedFacing().getWorldOffset(new Vec3Impl(-1 * scanRangeXZ, -12, -1 * scanRangeXZ + 3)); - scanPosOffsets[6] = getExtendedFacing().getWorldOffset(new Vec3Impl(40, -13, 43)); - scanPosOffsets[7] = getExtendedFacing().getWorldOffset(new Vec3Impl(-40, -16, -37)); + scanPosOffsets[6] = getExtendedFacing().getWorldOffset(new Vec3Impl(scanRangeXZ, -13, scanRangeXZ + 3)); + scanPosOffsets[7] = getExtendedFacing().getWorldOffset(new Vec3Impl(-1 * scanRangeXZ, -16, -1 * scanRangeXZ + 3)); - scanPosOffsets[8] = getExtendedFacing().getWorldOffset(new Vec3Impl(40, -17, 43)); - scanPosOffsets[9] = getExtendedFacing().getWorldOffset(new Vec3Impl(-40, -20, -37)); + scanPosOffsets[8] = getExtendedFacing().getWorldOffset(new Vec3Impl(scanRangeXZ, -17, scanRangeXZ + 3)); + scanPosOffsets[9] = getExtendedFacing().getWorldOffset(new Vec3Impl(-1 * scanRangeXZ, -20, -1 * scanRangeXZ + 3)); } return true; } @@ -362,6 +422,8 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock @Override public boolean checkRecipe_EM(ItemStack itemStack) { + checkPlasmaBoost(); + if (!histHighSetting.getStatus(false).isOk || !histLowSetting.getStatus(false).isOk || !transferRadiusTowerSetting.getStatus(false).isOk || @@ -825,6 +887,14 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return eParamHatches.add((GT_MetaTileEntity_Hatch_Param) aMetaTileEntity); } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + } return false; } @@ -841,4 +911,4 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock public String[] getStructureDescription(ItemStack stackSize) { return description; } -} \ No newline at end of file +} -- cgit From 3b388cd947255ccef57215862591228cb4421997 Mon Sep 17 00:00:00 2001 From: basdxz Date: Sat, 11 Jul 2020 13:37:02 +0100 Subject: Plasma range boosting now helps with loss Very generous imo, might need to be scaled back --- .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java index dac8800894..5ae1d86895 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -252,10 +252,22 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock } private long getEnergyEfficiency(long voltage, int distance, boolean overDriveToggle) { + //Helium and Nitrogen Plasmas will half the effective distance + //Radon will half it again + int effectiveDistance = distance; + switch (plasmaTier) { + case 2: + effectiveDistance = distance / 4; + break; + case 1: + effectiveDistance = distance / 2; + break; + } + if (overDriveToggle) { - return (long) ((voltage * 2) - (voltage * Math.pow(overdriveEfficiency, distance))); + return (long) ((voltage * 2) - (voltage * Math.pow(overdriveEfficiency, effectiveDistance))); } else { - return (long) (voltage * Math.pow(energyEfficiency, distance)); + return (long) (voltage * Math.pow(energyEfficiency, effectiveDistance)); } } @@ -333,7 +345,6 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock for (GT_MetaTileEntity_Hatch_Input fluidHatch : mInputHatches) { if (fluidHatch.mFluid != null) { if (fluidHatch.mFluid.isFluidEqual(Materials.Helium.getPlasma(1)) && fluidHatch.mFluid.amount >= 100) { - System.out.print("HELIUM\n"); fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - 100; if (doFluidOutput) { mOutputFluidsQueue = new FluidStack[]{Materials.Helium.getGas(100)}; @@ -341,7 +352,6 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock plasmaTier = 1; return; } else if (fluidHatch.mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && fluidHatch.mFluid.amount >= 50) { - System.out.print("NITRO\n"); fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - 50; if (doFluidOutput) { mOutputFluidsQueue = new FluidStack[]{Materials.Nitrogen.getGas(50)}; @@ -349,7 +359,6 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock plasmaTier = 1; return; } else if (fluidHatch.mFluid.isFluidEqual(Materials.Radon.getPlasma(1)) && fluidHatch.mFluid.amount >= 50) { - System.out.print("RADON\n"); fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - 50; if (doFluidOutput) { mOutputFluidsQueue = new FluidStack[]{Materials.Radon.getGas(50)}; @@ -450,6 +459,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock //Calculate Efficiency values energyEfficiency = map(mTier + 1, 1, maxTier, minEfficiency, maxEfficiency); + //OD Eff calc overdriveEfficiency = energyEfficiency - overdriveEfficiencyExtra; energyCapacity = 0; -- cgit From 011cfd255f5324dad9cf53e4efe1b0c455257152 Mon Sep 17 00:00:00 2001 From: basdxz Date: Sat, 11 Jul 2020 13:38:09 +0100 Subject: Expand Tesla tiers We now have ZPM Tier primary coils and LuV and ZPM tier capacitors, props to the madlads at the BigFlex MegaPlex for planning on using it with their fusion reactors --- .../dreamcraft/DreamCraftRecipeLoader.java | 27 ++++++++++++++++- .../tectech/loader/recipe/BloodyRecipeLoader.java | 22 ++++++++++++++ .../technus/tectech/thing/CustomItemList.java | 2 +- .../tectech/thing/casing/GT_Block_CasingsBA0.java | 35 +++++++++++++++------- .../tectech/thing/casing/GT_Item_CasingsBA0.java | 4 +++ .../tectech/thing/item/TeslaCoilCapacitor.java | 14 ++++++--- .../hatch/GT_MetaTileEntity_Hatch_Capacitor.java | 18 +++++------ .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 10 +++++-- 8 files changed, 103 insertions(+), 29 deletions(-) (limited to 'src/main/java') 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 b669165176..748888c5c9 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 @@ -224,7 +224,12 @@ public class DreamCraftRecipeLoader implements Runnable { GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorLuV, 8), getItemContainer("MicaInsulatorFoil").get(28) - }, Materials.Indium.getMolten(144), CustomItemList.tM_TeslaPrimary_5.get(1), 50, 30720); + }, Materials.Indium.getMolten(144), CustomItemList.tM_TeslaPrimary_5.get(1), 200, 30720); + //Tesla Primary Coils T6 + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorZPM, 8), + getItemContainer("MicaInsulatorFoil").get(32) + }, Materials.Naquadah.getMolten(144), CustomItemList.tM_TeslaPrimary_6.get(1), 200, 122880); //endregion @@ -1599,6 +1604,20 @@ public class DreamCraftRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 24), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 24), }, Materials.Epoxid.getMolten(360), CustomItemList.teslaCapacitor.getWithDamage(1, 4), 320, 7680); + //LuV Tesla Capacitor + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.HSSG, 4), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 14), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 28), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 28), + }, Materials.Epoxid.getMolten(432), CustomItemList.teslaCapacitor.getWithDamage(1, 5), 320, 30720); + //ZPM Tesla Capacitor + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Naquadah, 4), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 16), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 32), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 32), + }, Materials.Epoxid.getMolten(504), CustomItemList.teslaCapacitor.getWithDamage(1, 6), 320, 122880); //Tesla Cover GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.teslaComponent.getWithDamage(4, 0), @@ -1663,6 +1682,12 @@ public class DreamCraftRecipeLoader implements Runnable { //IV Tesla Capacitor GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 4), GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 12), 300, 2); + //LuV Tesla Capacitor + GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 5), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 14), 300, 2); + //ZPM Tesla Capacitor + GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 6), + GT_OreDictUnificator.get(OrePrefixes.itemCasing, Materials.BatteryAlloy, 16), 300, 2); //endregion diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java index 70f64d3719..7b8cc14f4d 100644 --- a/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/recipe/BloodyRecipeLoader.java @@ -191,6 +191,7 @@ public class BloodyRecipeLoader implements Runnable { GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"WWW", "WwW", "WWW", 'W', OrePrefixes.wireGt02.get(Materials.Superconductor)}); + //TODO Add Tesla Primary Coils T6 //endregion @@ -1157,6 +1158,21 @@ public class BloodyRecipeLoader implements Runnable { GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 24), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 24), }, Materials.Epoxid.getMolten(360), CustomItemList.teslaCapacitor.getWithDamage(1, 4), 320, 7680); + //LuV Tesla Capacitor + GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.HSSG, 4), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 14), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 28), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 28), + }, Materials.Epoxid.getMolten(432), CustomItemList.teslaCapacitor.getWithDamage(1, 5), 320, 30720); + //ZPM Tesla Capacitor + //GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ + // GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Naquadah, 4), + // GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 16), + // GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 32), + // GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Silicone, 32), + //}, Materials.Epoxid.getMolten(504), CustomItemList.teslaCapacitor.getWithDamage(1, 6), 320, 122880); + //TODO Allow with the coils, useless alone and will only cause trouble //Tesla Cover GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ CustomItemList.teslaComponent.getWithDamage(4, 0), @@ -1221,6 +1237,12 @@ public class BloodyRecipeLoader implements Runnable { //IV Tesla Capacitor GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 4), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 12), 300, 2); + //LuV Tesla Capacitor + GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 5), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 14), 300, 2); + //ZPM Tesla Capacitor + GT_Values.RA.addExtractorRecipe(CustomItemList.teslaCapacitor.getWithDamage(1, 6), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 16), 300, 2); //endregion diff --git a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java index 5265ad25c6..a86695ff4a 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -78,7 +78,7 @@ public enum CustomItemList implements IItemContainer { eM_Containment, eM_Containment_Field, eM_Containment_Advanced, eM_Coil, eM_Teleportation, eM_Dimensional, eM_Ultimate_Containment, eM_Ultimate_Containment_Advanced, eM_Ultimate_Containment_Field, eM_Spacetime, eM_Computer_Casing, eM_Computer_Bus, eM_Computer_Vent, eM_Hollow, eM_Power, debugBlock, - tM_TeslaBase, tM_TeslaToroid, tM_TeslaSecondary, tM_TeslaPrimary_0, tM_TeslaPrimary_1, tM_TeslaPrimary_2, tM_TeslaPrimary_3, tM_TeslaPrimary_4, tM_TeslaPrimary_5, + tM_TeslaBase, tM_TeslaToroid, tM_TeslaSecondary, tM_TeslaPrimary_0, tM_TeslaPrimary_1, tM_TeslaPrimary_2, tM_TeslaPrimary_3, tM_TeslaPrimary_4, tM_TeslaPrimary_5, tM_TeslaPrimary_6, Machine_Multi_Microwave, Machine_Multi_TeslaCoil, Machine_Multi_Transformer, diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java index 6d5bcd2b04..823f9ae26e 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java @@ -23,8 +23,8 @@ import static com.github.technus.tectech.TecTech.tectechTexturePage1; * Created by danie_000 on 03.10.2016. */ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { - public static final byte texturePage=tectechTexturePage1; - public static final short textureOffset = (texturePage << 7)+16;//Start of PAGE 8 (which is the 9th page) (8*128)+16 + public static final byte texturePage = tectechTexturePage1; + public static final short textureOffset = (texturePage << 7) + 16;//Start of PAGE 8 (which is the 9th page) (8*128)+16 private static IIcon[] tM0 = new IIcon[2]; private static IIcon[] tM1 = new IIcon[2]; @@ -35,11 +35,12 @@ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { private static IIcon[] tM6 = new IIcon[2]; private static IIcon tM7; private static IIcon[] tM8 = new IIcon[2]; + private static IIcon[] tM9 = new IIcon[2]; public GT_Block_CasingsBA0() { super(GT_Item_CasingsBA0.class, "gt.blockcasingsBA0", GT_Material_Casings.INSTANCE); for (byte b = 0; b < 16; b = (byte) (b + 1)) { - Textures.BlockIcons.casingTexturePages[texturePage][b+16] = new GT_CopiedBlockTexture(this, 6, b); + Textures.BlockIcons.casingTexturePages[texturePage][b + 16] = new GT_CopiedBlockTexture(this, 6, b); /*IMPORTANT for block recoloring**/ } @@ -49,6 +50,7 @@ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "EV Superconductor Primary Tesla Windings"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "IV Superconductor Primary Tesla Windings"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "LuV Superconductor Primary Tesla Windings"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "ZPM Superconductor Primary Tesla Windings"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Tesla Base Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Tesla Toroid Casing"); @@ -60,6 +62,7 @@ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { CustomItemList.tM_TeslaPrimary_3.set(new ItemStack(this, 1, 3)); CustomItemList.tM_TeslaPrimary_4.set(new ItemStack(this, 1, 4)); CustomItemList.tM_TeslaPrimary_5.set(new ItemStack(this, 1, 5)); + CustomItemList.tM_TeslaPrimary_6.set(new ItemStack(this, 1, 9)); CustomItemList.tM_TeslaBase.set(new ItemStack(this, 1, 6)); CustomItemList.tM_TeslaToroid.set(new ItemStack(this, 1, 7)); @@ -80,6 +83,8 @@ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { tM4[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_4"); tM5[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_5"); tM5[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_5"); + tM9[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_6"); + tM9[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_6"); tM6[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_BASE_TOP_BOTTOM"); tM6[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_BASE_SIDES"); @@ -92,7 +97,7 @@ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { public IIcon getIcon(int aSide, int aMeta) { switch (aMeta) { case 0: - switch (aSide){ + switch (aSide) { case 0: case 1: return tM0[0]; @@ -100,7 +105,7 @@ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { return tM0[1]; } case 1: - switch (aSide){ + switch (aSide) { case 0: case 1: return tM1[0]; @@ -108,7 +113,7 @@ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { return tM1[1]; } case 2: - switch (aSide){ + switch (aSide) { case 0: case 1: return tM2[0]; @@ -116,7 +121,7 @@ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { return tM2[1]; } case 3: - switch (aSide){ + switch (aSide) { case 0: case 1: return tM3[0]; @@ -124,7 +129,7 @@ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { return tM3[1]; } case 4: - switch (aSide){ + switch (aSide) { case 0: case 1: return tM4[0]; @@ -132,7 +137,7 @@ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { return tM4[1]; } case 5: - switch (aSide){ + switch (aSide) { case 0: case 1: return tM5[0]; @@ -140,7 +145,7 @@ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { return tM5[1]; } case 6: - switch (aSide){ + switch (aSide) { case 0: case 1: return tM6[0]; @@ -150,13 +155,21 @@ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { case 7: return tM7; case 8: - switch (aSide){ + switch (aSide) { case 0: case 1: return tM8[0]; default: return tM8[1]; } + case 9: + switch (aSide) { + case 0: + case 1: + return tM9[0]; + default: + return tM9[1]; + } default: return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); } diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsBA0.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsBA0.java index 56fdfd22bb..50630820df 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsBA0.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Item_CasingsBA0.java @@ -45,6 +45,10 @@ public class GT_Item_CasingsBA0 extends GT_Item_Casings_Abstract { aList.add(translateToLocal("gt.blockcasingsBA0.8.desc.0"));//Picks up power from a primary coil aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockcasingsBA0.8.desc.1"));//Who wouldn't want a 32k epoxy multi? break; + case 9://"ZPM Superconductor Primary Tesla Windings" + aList.add(translateToLocal("gt.blockcasingsBA0.0.desc.0") + " " + V[7] + " EU/t");//Handles up to + aList.add(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + translateToLocal("gt.blockcasingsBA0.0.desc.1"));//What one man calls God, another calls the laws of physics. + break; default://WTF? aList.add("Damn son where did you get that!?"); aList.add(EnumChatFormatting.BLUE.toString() + "From outer space... I guess..."); diff --git a/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java index 6e7e8c426d..86982e7c09 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java +++ b/src/main/java/com/github/technus/tectech/thing/item/TeslaCoilCapacitor.java @@ -22,7 +22,7 @@ import static net.minecraft.util.StatCollector.translateToLocal; public final class TeslaCoilCapacitor extends Item { public static TeslaCoilCapacitor INSTANCE; - private static IIcon LVicon, MVicon, HVicon, EVicon, IVicon; + private static IIcon LVicon, MVicon, HVicon, EVicon, IVicon, LuVicon, ZPMicon; private TeslaCoilCapacitor() { setHasSubtypes(true); @@ -33,8 +33,8 @@ public final class TeslaCoilCapacitor extends Item { @Override public void addInformation(ItemStack aStack, EntityPlayer ep, List aList, boolean boo) { aList.add(CommonValues.BASS_MARK); - if (aStack.getItemDamage() >= 0 && aStack.getItemDamage() <= 4) { - aList.add(translateToLocal("item.tm.teslaCoilCapacitor.desc.0") + " " + V[aStack.getItemDamage() + 1] * 512 + " " + translateToLocal("item.tm.teslaCoilCapacitor.desc.1") +" " + V[aStack.getItemDamage() + 1] + " EU/t");//Stores 16384 EU in a tesla tower at 32 EU/t + if (aStack.getItemDamage() >= 0 && aStack.getItemDamage() <= 6) { + aList.add(translateToLocal("item.tm.teslaCoilCapacitor.desc.0") + " " + V[aStack.getItemDamage() + 1] * 512 + " " + translateToLocal("item.tm.teslaCoilCapacitor.desc.1") + " " + V[aStack.getItemDamage() + 1] + " EU/t");//Stores 16384 EU in a tesla tower at 32 EU/t } else { aList.add(translateToLocal("item.tm.teslaCoilCapacitor.desc.2"));//Yeet this broken item into some spicy water! } @@ -61,6 +61,8 @@ public final class TeslaCoilCapacitor extends Item { HVicon = iconRegister.registerIcon(MODID + ":itemCapacitorHV"); EVicon = iconRegister.registerIcon(MODID + ":itemCapacitorEV"); IVicon = iconRegister.registerIcon(MODID + ":itemCapacitorIV"); + LuVicon = iconRegister.registerIcon(MODID + ":itemCapacitorLuV"); + ZPMicon = iconRegister.registerIcon(MODID + ":itemCapacitorZPM"); } @Override @@ -74,6 +76,10 @@ public final class TeslaCoilCapacitor extends Item { return EVicon; case 4: return IVicon; + case 5: + return LuVicon; + case 6: + return ZPMicon; default: return LVicon; } @@ -81,7 +87,7 @@ public final class TeslaCoilCapacitor extends Item { @Override public void getSubItems(Item aItem, CreativeTabs par2CreativeTabs, List aList) { - for (int i = 0; i <= 4; i++) { + for (int i = 0; i <= 6; i++) { aList.add(new ItemStack(aItem, 1, i)); } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java index b4e8f03a74..4e07622c25 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_Capacitor.java @@ -38,7 +38,7 @@ public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_Capacitor(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 16, ""); - Util.setTier(aTier,this); + Util.setTier(aTier, this); } public GT_MetaTileEntity_Hatch_Capacitor(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -173,11 +173,13 @@ public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch { } public static void run() { - new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID+":item.tm.teslaCoilCapacitor.0", 0, 1, V[1]*512);//LV Capacitor - new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID+":item.tm.teslaCoilCapacitor.1", 1, 1, V[2]*512);//MV Capacitor - new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID+":item.tm.teslaCoilCapacitor.2", 2, 1, V[3]*512);//HV Capacitor - new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID+":item.tm.teslaCoilCapacitor.3", 3, 1, V[4]*512);//EV Capacitor - new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID+":item.tm.teslaCoilCapacitor.4", 4, 1, V[5]*512);//IV Capacitor + new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID + ":item.tm.teslaCoilCapacitor.0", 0, 1, V[1] * 512);//LV Capacitor + new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID + ":item.tm.teslaCoilCapacitor.1", 1, 1, V[2] * 512);//MV Capacitor + new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID + ":item.tm.teslaCoilCapacitor.2", 2, 1, V[3] * 512);//HV Capacitor + new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID + ":item.tm.teslaCoilCapacitor.3", 3, 1, V[4] * 512);//EV Capacitor + new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID + ":item.tm.teslaCoilCapacitor.4", 4, 1, V[5] * 512);//IV Capacitor + new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID + ":item.tm.teslaCoilCapacitor.5", 5, 1, V[6] * 512);//LuV Capacitor + new GT_MetaTileEntity_Hatch_Capacitor.CapacitorComponent(Reference.MODID + ":item.tm.teslaCoilCapacitor.6", 6, 1, V[7] * 512);//ZPM Capacitor } public static class CapacitorComponent implements Comparable { @@ -206,12 +208,10 @@ public class GT_MetaTileEntity_Hatch_Capacitor extends GT_MetaTileEntity_Hatch { @Override public boolean equals(Object obj) { - if(obj instanceof CapacitorComponent) { + if (obj instanceof CapacitorComponent) { return compareTo((CapacitorComponent) obj) == 0; } return false; } } } - - diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java index 5ae1d86895..58ea6d322b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -61,7 +61,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock private static Textures.BlockIcons.CustomIcon ScreenON; //TODO Make the setting abstractions static, if they aren't changed at tick time private int mTier = 0; //Determines max voltage and efficiency (MV to LuV) - private int maxTier = 6; //Max tier for efficiency calcuation + private int maxTier = 7; //Max tier for efficiency calcuation private int plasmaTier = 0; //0 is None, 1 is Helium or Nitrogen, 2 is Radon private boolean doFluidOutput = TecTech.configTecTech.TESLA_MULTI_MOLTEN_OUTPUT; //Default is false private FluidStack[] mOutputFluidsQueue; //Used to buffer the fluid outputs for one second @@ -110,7 +110,8 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock private static final byte[] blockMetaT3 = new byte[]{7, 3, 6, 8}; private static final byte[] blockMetaT4 = new byte[]{7, 4, 6, 8}; private static final byte[] blockMetaT5 = new byte[]{7, 5, 6, 8}; - private static final byte[][] blockMetas = new byte[][]{blockMetaT0, blockMetaT1, blockMetaT2, blockMetaT3, blockMetaT4, blockMetaT5}; + private static final byte[] blockMetaT6 = new byte[]{7, 9, 6, 8}; + private static final byte[][] blockMetas = new byte[][]{blockMetaT0, blockMetaT1, blockMetaT2, blockMetaT3, blockMetaT4, blockMetaT5, blockMetaT6}; private static final IHatchAdder[] addingMethods = adders( GT_MetaTileEntity_TM_teslaCoil::addCapacitorToMachineList, GT_MetaTileEntity_TM_teslaCoil::addFrameToMachineList); @@ -389,6 +390,9 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock xyzOffsets = getExtendedFacing().getWorldOffset(new Vec3Impl(0, -1, 1)); mTier = iGregTechTileEntity.getMetaIDOffset(xyzOffsets.get0(), xyzOffsets.get1(), xyzOffsets.get2()); + if (mTier == 9){ + mTier = 6; + } if (structureCheck_EM(shape, blockType, blockMetas[mTier], addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 3, 16, 0) && eCapacitorHatches.size() > 0) { for (GT_MetaTileEntity_Hatch_Capacitor cap : eCapacitorHatches) { @@ -914,7 +918,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - Structure.builder(shape, blockType, blockMetas[(stackSize.stackSize - 1) % 6], 3, 16, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + Structure.builder(shape, blockType, blockMetas[(stackSize.stackSize - 1) % 7], 3, 16, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); } @Override -- cgit From 792d54ffa2fde437a3af9925c7c41399821b2d83 Mon Sep 17 00:00:00 2001 From: basdxz Date: Sat, 11 Jul 2020 13:51:59 +0100 Subject: Patch ZPM Tesla Primaries missing from NEI --- .../com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java index 823f9ae26e..0d2f710ae9 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsBA0.java @@ -184,7 +184,7 @@ public class GT_Block_CasingsBA0 extends GT_Block_Casings_Abstract { @Override public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { - for (int i = 0; i <= 8; i++) { + for (int i = 0; i <= 9; i++) { aList.add(new ItemStack(aItem, 1, i)); } } -- cgit From d895a4f85ae7edad8884c5ded8c29ff47bbb8de9 Mon Sep 17 00:00:00 2001 From: basdxz Date: Sat, 18 Jul 2020 09:38:35 +0100 Subject: Lots of Tesla Tower work Reworked power loss Fixed Tesla Tower exploding when already powered off Added and reworded some comments Added plasma consumption values to config --- .../technus/tectech/loader/TecTechConfig.java | 65 +++++------ .../multi/GT_MetaTileEntity_TM_teslaCoil.java | 119 ++++++++++----------- .../single/GT_MetaTileEntity_TeslaCoil.java | 64 ++++++----- 3 files changed, 119 insertions(+), 129 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java b/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java index 2cc52e8513..030be65f3b 100644 --- a/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java +++ b/src/main/java/com/github/technus/tectech/loader/TecTechConfig.java @@ -21,14 +21,17 @@ public class TecTechConfig extends ConfigManager { public boolean DISABLE_BLOCK_HARDNESS_NERF; public float TURRET_DAMAGE_FACTOR; public float TURRET_EXPLOSION_FACTOR; - public float TESLA_MULTI_MIN_EFFICIENCY; - public float TESLA_MULTI_MAX_EFFICIENCY; - public float TESLA_MULTI_OVERDRIVE_LOSS; - public int TESLA_MULTI_SCAN_RANGE; - public boolean TESLA_MULTI_MOLTEN_OUTPUT; - public float TESLA_SINGLE_MIN_EFFICIENCY; - public float TESLA_SINGLE_MAX_EFFICIENCY; - public float TESLA_SINGLE_OVERDRIVE_LOSS; + public int TESLA_MULTI_HELIUM_PLASMA_PER_SECOND; + public int TESLA_MULTI_NITROGEN_PLASMA_PER_SECOND; + public int TESLA_MULTI_RADON_PLASMA_PER_SECOND; + public int TESLA_MULTI_LOSS_PER_BLOCK_T0; + public int TESLA_MULTI_LOSS_PER_BLOCK_T1; + public int TESLA_MULTI_LOSS_PER_BLOCK_T2; + public float TESLA_MULTI_OVERDRIVE_LOSS_FACTOR; + public int TESLA_MULTI_SCAN_RANGE;//TODO delete + public boolean TESLA_MULTI_GAS_OUTPUT; + public int TESLA_SINGLE_LOSS_PER_BLOCK; + public float TESLA_SINGLE_OVERDRIVE_LOSS_FACTOR; /** * This loading phases do not correspond to mod loading phases! @@ -44,17 +47,19 @@ public class TecTechConfig extends ConfigManager { DISABLE_MATERIAL_LOADING_FFS = false; TURRET_DAMAGE_FACTOR = 10; TURRET_EXPLOSION_FACTOR = 1; - TESLA_MULTI_MIN_EFFICIENCY = 0.955F; - TESLA_MULTI_MAX_EFFICIENCY = 0.98F; - TESLA_MULTI_OVERDRIVE_LOSS = 0.005F; + TESLA_MULTI_HELIUM_PLASMA_PER_SECOND = 100; + TESLA_MULTI_NITROGEN_PLASMA_PER_SECOND = 50; + TESLA_MULTI_RADON_PLASMA_PER_SECOND = 50; + TESLA_MULTI_LOSS_PER_BLOCK_T0 = 1; + TESLA_MULTI_LOSS_PER_BLOCK_T1 = 1; + TESLA_MULTI_LOSS_PER_BLOCK_T2 = 1; + TESLA_MULTI_OVERDRIVE_LOSS_FACTOR = 0.25F; TESLA_MULTI_SCAN_RANGE = 40; - TESLA_MULTI_MOLTEN_OUTPUT = false; - TESLA_SINGLE_MIN_EFFICIENCY = 0.91F; - TESLA_SINGLE_MAX_EFFICIENCY = 0.95F; - TESLA_SINGLE_OVERDRIVE_LOSS = 0.010F; + TESLA_MULTI_GAS_OUTPUT = false; + TESLA_SINGLE_LOSS_PER_BLOCK = 1; + TESLA_SINGLE_OVERDRIVE_LOSS_FACTOR = 0.25F; } - /** * This loading phases do not correspond to mod loading phases! */ @@ -80,22 +85,18 @@ public class TecTechConfig extends ConfigManager { "Set to true to disable the block hardness nerf"); DISABLE_MATERIAL_LOADING_FFS = _mainConfig.getBoolean("DisableMaterialLoading", "Debug", DISABLE_MATERIAL_LOADING_FFS, "Set to true to disable gregtech material processing"); - TESLA_MULTI_MIN_EFFICIENCY = _mainConfig.getFloat("TeslaMultiMinEfficency", "Features", TESLA_MULTI_MIN_EFFICIENCY, 0, 1, - "Worst possible power loss per block for the multi block tesla"); - TESLA_MULTI_MAX_EFFICIENCY = _mainConfig.getFloat("TeslaMultiMaxEfficency", "Features", TESLA_MULTI_MAX_EFFICIENCY, 0, 1, - "Best possible power loss per block for the multi block tesla"); - TESLA_MULTI_OVERDRIVE_LOSS = _mainConfig.getFloat("TeslaMultiOverdriveLoss", "Features", TESLA_MULTI_OVERDRIVE_LOSS, 0, 1, - "Additional losses for overdrive use on the multi block tesla"); - TESLA_MULTI_SCAN_RANGE = _mainConfig.getInt("TeslaMultiScanRange", "Features", TESLA_MULTI_SCAN_RANGE, 4, 256, - "Determines the scan range constant for multi block tesla"); - TESLA_MULTI_MOLTEN_OUTPUT = _mainConfig.getBoolean("TeslaMultiMoltenOutput", "Features", TESLA_MULTI_MOLTEN_OUTPUT, - "Set to true to get molten outputs when boosting the multi block tesla with plasmas"); - TESLA_SINGLE_MIN_EFFICIENCY = _mainConfig.getFloat("TeslaSingleMinEfficency", "Features", TESLA_SINGLE_MIN_EFFICIENCY, 0, 1, - "Worst possible power loss per block for the single block tesla"); - TESLA_SINGLE_MAX_EFFICIENCY = _mainConfig.getFloat("TeslaSingleMaxEfficency", "Features", TESLA_SINGLE_MAX_EFFICIENCY, 0, 1, - "Best possible power loss per block for the single block tesla"); - TESLA_SINGLE_OVERDRIVE_LOSS = _mainConfig.getFloat("TeslaSingleOverdriveLoss", "Features", TESLA_SINGLE_OVERDRIVE_LOSS, 0, 1, - "Additional losses for overdrive use on the single block tesla"); + + TESLA_MULTI_HELIUM_PLASMA_PER_SECOND = _mainConfig.getInt("TeslaMultiHeliumPlasmaPerSecond", "Balance Tweaks", TESLA_MULTI_HELIUM_PLASMA_PER_SECOND, 0, Integer.MAX_VALUE, "Tesla Tower helium plasma consumed each second the tesla tower is active"); + TESLA_MULTI_NITROGEN_PLASMA_PER_SECOND = _mainConfig.getInt("TeslaMultiNitrogenPlasmaPerSecond", "Balance Tweaks", TESLA_MULTI_NITROGEN_PLASMA_PER_SECOND, 0, Integer.MAX_VALUE, "Tesla Tower nitrogen plasma consumed each second the tesla tower is active"); + TESLA_MULTI_RADON_PLASMA_PER_SECOND = _mainConfig.getInt("TeslaMultiRadonPlasmaPerSecond", "Balance Tweaks", TESLA_MULTI_RADON_PLASMA_PER_SECOND, 0, Integer.MAX_VALUE, "Tesla Tower radon plasma consumed each second the tesla tower is active"); + TESLA_MULTI_LOSS_PER_BLOCK_T0 = _mainConfig.getInt("TeslaMultiLossPerBlockT0", "Balance Tweaks", TESLA_MULTI_LOSS_PER_BLOCK_T0, 0, Integer.MAX_VALUE, "Tesla Tower power transmission loss per block per amp using no plasmas"); + TESLA_MULTI_LOSS_PER_BLOCK_T1 = _mainConfig.getInt("TeslaMultiLossPerBlockT1", "Balance Tweaks", TESLA_MULTI_LOSS_PER_BLOCK_T1, 0, Integer.MAX_VALUE, "Tesla Tower power transmission loss per block per amp using helium or nitrogen plasma"); + TESLA_MULTI_LOSS_PER_BLOCK_T2 = _mainConfig.getInt("TeslaMultiLossPerBlockT1", "Balance Tweaks", TESLA_MULTI_LOSS_PER_BLOCK_T2, 0, Integer.MAX_VALUE, "Tesla Tower power transmission loss per block per amp using radon plasma"); + TESLA_MULTI_OVERDRIVE_LOSS_FACTOR = _mainConfig.getFloat("TeslaMultiOverdriveLossFactor", "Balance Tweaks", TESLA_MULTI_OVERDRIVE_LOSS_FACTOR, 0, 1, "Additional Tesla Tower power loss per amp as a factor of the tier voltage"); + TESLA_MULTI_SCAN_RANGE = _mainConfig.getInt("TeslaMultiScanRange", "Balance Tweaks", TESLA_MULTI_SCAN_RANGE, 4, 256, "The horizontal radius scanned by the Tesla Tower"); + TESLA_MULTI_GAS_OUTPUT = _mainConfig.getBoolean("TeslaMultiMoltenOutput", "Balance Tweaks", TESLA_MULTI_GAS_OUTPUT, "Set to true to enable outputting plasmas as gasses from the tesla tower with a 1:1 ratio"); + TESLA_SINGLE_LOSS_PER_BLOCK = _mainConfig.getInt("TeslaSingleLossPerBlock", "Balance Tweaks", TESLA_SINGLE_LOSS_PER_BLOCK, 0, Integer.MAX_VALUE, "Tesla Transceiver power transmission loss per block per amp"); + TESLA_SINGLE_OVERDRIVE_LOSS_FACTOR = _mainConfig.getFloat("TeslaSingleOverdriveLossFactor", "Balance Tweaks", TESLA_SINGLE_OVERDRIVE_LOSS_FACTOR, 0, 1, "Additional Tesla Transceiver power loss per amp as a factor of the tier voltage"); } /** diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java index 58ea6d322b..09f6d597ad 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_teslaCoil.java @@ -55,42 +55,44 @@ import static net.minecraft.util.StatCollector.translateToLocal; public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region variables - private final static HashSet sparkList = new HashSet<>(); - + private static final int heliumUse = TecTech.configTecTech.TESLA_MULTI_HELIUM_PLASMA_PER_SECOND;//Default is 100 + private static final int nitrogenUse = TecTech.configTecTech.TESLA_MULTI_NITROGEN_PLASMA_PER_SECOND;//Default is 50 + private static final int radonUse = TecTech.configTecTech.TESLA_MULTI_RADON_PLASMA_PER_SECOND;//Default is 50 + //Default is {1, 1, 1} + private static final int[] plasmaTierLoss = new int[]{TecTech.configTecTech.TESLA_MULTI_LOSS_PER_BLOCK_T0, + TecTech.configTecTech.TESLA_MULTI_LOSS_PER_BLOCK_T1, TecTech.configTecTech.TESLA_MULTI_LOSS_PER_BLOCK_T2}; + private static final float overDriveLoss = TecTech.configTecTech.TESLA_MULTI_OVERDRIVE_LOSS_FACTOR;//Default is 0.25F; + private static final int scanRangeXZ = TecTech.configTecTech.TESLA_MULTI_SCAN_RANGE;//Default is 40 + private static final boolean doFluidOutput = TecTech.configTecTech.TESLA_MULTI_GAS_OUTPUT; //Default is false + + //Face icons private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; - //TODO Make the setting abstractions static, if they aren't changed at tick time - private int mTier = 0; //Determines max voltage and efficiency (MV to LuV) - private int maxTier = 7; //Max tier for efficiency calcuation - private int plasmaTier = 0; //0 is None, 1 is Helium or Nitrogen, 2 is Radon - private boolean doFluidOutput = TecTech.configTecTech.TESLA_MULTI_MOLTEN_OUTPUT; //Default is false - private FluidStack[] mOutputFluidsQueue; //Used to buffer the fluid outputs for one second - private float energyEfficiency = 1; - private float overdriveEfficiency = 1; - private float minEfficiency = TecTech.configTecTech.TESLA_MULTI_MIN_EFFICIENCY;//Default is 0.955F - private float maxEfficiency = TecTech.configTecTech.TESLA_MULTI_MAX_EFFICIENCY;//Default is 0.98F - private float overdriveEfficiencyExtra = TecTech.configTecTech.TESLA_MULTI_OVERDRIVE_LOSS;//Default is 0.005F + private int mTier = 0; //Determines max voltage (LV to ZPM) + private int plasmaTier = 0; //0 is None, 1 is Helium or Nitrogen, 2 is Radon (Does not match actual plasma tiers) + + private FluidStack[] mOutputFluidsQueue; //Used to buffer the fluid outputs, so the tesla takes a second to 'cool' any plasma it would output as a gas - private Map eTeslaMap = new HashMap<>(); //Used to store targets for power transmission - private final ArrayList eCapacitorHatches = new ArrayList<>(); //Used to determine count and tier of capacitors present + private final HashSet sparkList = new HashSet<>(); //Thaumcraft lighting coordinate pairs, so we can send them in bursts and save on lag + private final Map eTeslaMap = new HashMap<>(); //Targets for power transmission //TODO Make this fill more efficently and globally + private final ArrayList eCapacitorHatches = new ArrayList<>(); //Capacitor hatches which determine the max voltage tier and count of amps - private int scanTime = 0; //Scan timer used for tesla search intervals - private int scanRangeXZ = TecTech.configTecTech.TESLA_MULTI_SCAN_RANGE;//Default is 40 + private int scanTime = 0; //Scan timer used for tesla search intervals //TODO Replace with something that fetches from a global map private long energyCapacity = 0; //Total energy storage limited by capacitors private long outputVoltageMax = 0; //Tesla voltage output limited by capacitors private int vTier = -1; //Tesla voltage tier limited by capacitors private long outputCurrentMax = 0; //Tesla current output limited by capacitors - //Prevents unnecessary offset calculation + //Prevents unnecessary offset calculation, saving on lag private byte oldRotation = -1; private byte oldOrientation = -1; //Coordinate Arrays private final Vec3Impl[] scanPosOffsets = new Vec3Impl[10]; - private Vec3Impl posZap = Vec3Impl.NULL_VECTOR;//Power Transfer Origin - public Vec3Impl posTop = Vec3Impl.NULL_VECTOR;//Lightning Origin + private Vec3Impl posZap = Vec3Impl.NULL_VECTOR;//Location of the bottom middle of the tower, used as the power transfer origin + public Vec3Impl posTop = Vec3Impl.NULL_VECTOR;//Location of the center of the sphere on top of the tower, used as theThaumcraft lightning origin //endregion //region structure @@ -252,24 +254,22 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock super(aName); } - private long getEnergyEfficiency(long voltage, int distance, boolean overDriveToggle) { - //Helium and Nitrogen Plasmas will half the effective distance - //Radon will half it again - int effectiveDistance = distance; - switch (plasmaTier) { - case 2: - effectiveDistance = distance / 4; - break; - case 1: - effectiveDistance = distance / 2; - break; - } + private int getPerBlockLoss(){ + return plasmaTierLoss[plasmaTier]; + } + + private long[] getOutputVoltage(long outputVoltage, int distance, boolean overDriveToggle) { + long outputVoltageInjectable; + long outputVoltageConsumption; if (overDriveToggle) { - return (long) ((voltage * 2) - (voltage * Math.pow(overdriveEfficiency, effectiveDistance))); + outputVoltageInjectable = outputVoltage; + outputVoltageConsumption = outputVoltage + (distance * getPerBlockLoss()) + (long) Math.round(overDriveLoss * outputVoltage); } else { - return (long) (voltage * Math.pow(energyEfficiency, effectiveDistance)); + outputVoltageInjectable = outputVoltage - (distance * getPerBlockLoss()); + outputVoltageConsumption = outputVoltage; } + return new long[]{outputVoltageInjectable, outputVoltageConsumption}; } private float getRangeMulti(int mTier, int vTier) { @@ -345,24 +345,24 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock for (GT_MetaTileEntity_Hatch_Input fluidHatch : mInputHatches) { if (fluidHatch.mFluid != null) { - if (fluidHatch.mFluid.isFluidEqual(Materials.Helium.getPlasma(1)) && fluidHatch.mFluid.amount >= 100) { - fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - 100; + if (fluidHatch.mFluid.isFluidEqual(Materials.Helium.getPlasma(1)) && fluidHatch.mFluid.amount >= heliumUse) { + fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - heliumUse; if (doFluidOutput) { - mOutputFluidsQueue = new FluidStack[]{Materials.Helium.getGas(100)}; + mOutputFluidsQueue = new FluidStack[]{Materials.Helium.getGas(heliumUse)}; } plasmaTier = 1; return; - } else if (fluidHatch.mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && fluidHatch.mFluid.amount >= 50) { - fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - 50; + } else if (fluidHatch.mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && fluidHatch.mFluid.amount >= nitrogenUse) { + fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - nitrogenUse; if (doFluidOutput) { - mOutputFluidsQueue = new FluidStack[]{Materials.Nitrogen.getGas(50)}; + mOutputFluidsQueue = new FluidStack[]{Materials.Nitrogen.getGas(nitrogenUse)}; } plasmaTier = 1; return; - } else if (fluidHatch.mFluid.isFluidEqual(Materials.Radon.getPlasma(1)) && fluidHatch.mFluid.amount >= 50) { - fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - 50; + } else if (fluidHatch.mFluid.isFluidEqual(Materials.Radon.getPlasma(1)) && fluidHatch.mFluid.amount >= radonUse) { + fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - radonUse; if (doFluidOutput) { - mOutputFluidsQueue = new FluidStack[]{Materials.Radon.getGas(50)}; + mOutputFluidsQueue = new FluidStack[]{Materials.Radon.getGas(radonUse)}; } plasmaTier = 2; return; @@ -390,9 +390,7 @@ public class GT_MetaTileEntity_TM_teslaCoil extends GT_MetaTileEntity_Multiblock xyzOffsets = getExtendedFacing().getWorldOffset(new Vec3Impl(0, -1, 1)); mTier = iGregTechTileEntity.getMetaIDOffset(xyzOffsets.get0(), xyzOffsets.get1(), xyzOffsets.get2()); - if (mTier == 9){ - mTier = 6; - } + if (mTier == 9){mTier = 6;}//Hacky remap because the ZPM coils were added later if (structureCheck_EM(shape, blockType, blockMetas[mTier], addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 3, 16, 0) && eCapacitorHatches.size() > 0) { for (