aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorMartin Robertz <dream-master@gmx.net>2021-04-29 21:20:38 +0200
committerGitHub <noreply@github.com>2021-04-29 21:20:38 +0200
commitc24dee8429df1eca4d41e97730b831f76c16fdab (patch)
treef66235c0d7b00ee53cdb3a4054376686a582c77d /src/main
parent7c526103068c562590eb2a45a42528c3eaf180ce (diff)
parent3db66d3a7850b955868fff2ad5e628afa7c81534 (diff)
downloadGT5-Unofficial-c24dee8429df1eca4d41e97730b831f76c16fdab.tar.gz
GT5-Unofficial-c24dee8429df1eca4d41e97730b831f76c16fdab.tar.bz2
GT5-Unofficial-c24dee8429df1eca4d41e97730b831f76c16fdab.zip
Merge pull request #12 from Prometheus0000/cap-change
Add EV and empty capacitors
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/common/Recipes.java35
-rw-r--r--src/main/java/common/blocks/Block_LapotronicEnergyUnit.java16
-rw-r--r--src/main/java/common/itemBlocks/IB_LapotronicEnergyUnit.java2
-rw-r--r--src/main/java/common/tileentities/GTMTE_LapotronicSuperCapacitor.java110
-rw-r--r--src/main/resources/assets/kekztech/lang/en_US.lang2
-rw-r--r--src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit6_side.pngbin0 -> 279 bytes
-rw-r--r--src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit6_top.pngbin0 -> 259 bytes
-rw-r--r--src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit7_side.pngbin0 -> 279 bytes
-rw-r--r--src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit7_top.pngbin0 -> 276 bytes
9 files changed, 132 insertions, 33 deletions
diff --git a/src/main/java/common/Recipes.java b/src/main/java/common/Recipes.java
index 87b495cf1a..d93b40b47f 100644
--- a/src/main/java/common/Recipes.java
+++ b/src/main/java/common/Recipes.java
@@ -427,6 +427,28 @@ public class Recipes {
'L', OrePrefixes.block.get(Materials.Lapis)
};
GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 0), lcBase_recipe);
+
+ // Empty Capacitor
+ final Object[] lcEmpty_recipe = {
+ "SLS", "L L", "SLS",
+ 'S', OrePrefixes.screw.get(Materials.Lapis),
+ 'L', OrePrefixes.plate.get(Materials.Lapis)
+ };
+ GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 6), lcEmpty_recipe);
+
+ // EV Capacitor
+ final Object[] lcEV_recipe = {
+ "SLS", "LCL", "SLS",
+ 'S', OrePrefixes.screw.get(Materials.Lapis),
+ 'L', OrePrefixes.plate.get(Materials.Lapis),
+ 'C', GT_ModHandler.getIC2Item("lapotronCrystal", 1L, GT_Values.W)
+ };
+ GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 7), lcEV_recipe);
+
+ //EV cap alt recipe
+ GT_Values.RA.addAssemblerRecipe(new ItemStack[] {(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 6)), GT_ModHandler.getIC2Item("lapotronCrystal", 1L, GT_Values.W), GT_Utility.getIntegratedCircuit(7)}, null, new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 7), 200, 480);
+
+ // IV Capacitor
final Object[] lcIV_recipe = {
"SLS", "LOL", "SLS",
'S', OrePrefixes.screw.get(Materials.Lapis),
@@ -435,6 +457,9 @@ public class Recipes {
};
GT_ModHandler.addCraftingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 1), lcIV_recipe);
+ //IV cap alt recipe
+ GT_Values.RA.addAssemblerRecipe(new ItemStack[] {(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 6)), ItemList.Energy_LapotronicOrb.get(1L), GT_Utility.getIntegratedCircuit(1)}, null, new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 1), 200, 1920);
+
// LuV Capacitor
GT_Values.RA.addAssemblylineRecipe(
new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 1), 288000,
@@ -458,6 +483,7 @@ public class Recipes {
},
new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 2), 2000, 100000
);
+
// ZPM Capacitor
GT_Values.RA.addAssemblylineRecipe(
new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 2), 288000,
@@ -482,6 +508,7 @@ public class Recipes {
},
new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 3), 2000, 100000
);
+
// UV Capacitor
GT_Values.RA.addAssemblylineRecipe(
new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 3), 288000,
@@ -506,6 +533,7 @@ public class Recipes {
},
new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 4), 2000, 200000
);
+
// Ultimate Capacitor
GT_Values.RA.addAssemblylineRecipe(
new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 4), 288000,
@@ -534,9 +562,13 @@ public class Recipes {
);
// Capacitor recycling
+ GT_Values.RA.addUnboxingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 7),
+ GT_ModHandler.getIC2Item("lapotronCrystal", 1L, 26),
+ new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 6),
+ 1200, 32);
GT_Values.RA.addUnboxingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 1),
ItemList.Energy_LapotronicOrb.get(1L),
- GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Lapis, 4),
+ new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 6),
1200, 32);
GT_Values.RA.addUnboxingRecipe(new ItemStack(Blocks.lscLapotronicEnergyUnit, 1, 2),
ItemList.Energy_LapotronicOrb2.get(1L),
@@ -596,7 +628,6 @@ public class Recipes {
}*/
private static void registerRecipes_Cosmetics() {
-
// Hex Tiles
final ItemStack[] hexTiles = {
GT_Utility.getIntegratedCircuit(6),
diff --git a/src/main/java/common/blocks/Block_LapotronicEnergyUnit.java b/src/main/java/common/blocks/Block_LapotronicEnergyUnit.java
index b49d287669..75de60a308 100644
--- a/src/main/java/common/blocks/Block_LapotronicEnergyUnit.java
+++ b/src/main/java/common/blocks/Block_LapotronicEnergyUnit.java
@@ -19,6 +19,10 @@ public class Block_LapotronicEnergyUnit extends BaseGTUpdateableBlock {
private IIcon iconBaseSide;
private IIcon iconBaseTop;
+ private IIcon iconLapoEmptySide;
+ private IIcon iconLapoEmptyTop;
+ private IIcon iconLapoEVSide;
+ private IIcon iconLapoEVTop;
private IIcon iconLapoIVSide;
private IIcon iconLapoIVTop;
private IIcon iconLapoLuVSide;
@@ -50,6 +54,11 @@ public class Block_LapotronicEnergyUnit extends BaseGTUpdateableBlock {
iconBaseSide = ir.registerIcon("kekztech:LSCBase_side");
iconBaseTop = ir.registerIcon("kekztech:LSCBase_top");
+
+ iconLapoEmptySide = ir.registerIcon("kekztech:LapotronicEnergyUnit6_side");
+ iconLapoEmptyTop = ir.registerIcon("kekztech:LapotronicEnergyUnit6_top");
+ iconLapoEVSide = ir.registerIcon("kekztech:LapotronicEnergyUnit7_side");
+ iconLapoEVTop = ir.registerIcon("kekztech:LapotronicEnergyUnit7_top");
iconLapoIVSide = ir.registerIcon("kekztech:LapotronicEnergyUnit1_side");
iconLapoIVTop = ir.registerIcon("kekztech:LapotronicEnergyUnit1_top");
iconLapoLuVSide = ir.registerIcon("kekztech:LapotronicEnergyUnit2_side");
@@ -68,7 +77,10 @@ public class Block_LapotronicEnergyUnit extends BaseGTUpdateableBlock {
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
// Multi casing
par3List.add(new ItemStack(par1, 1, 0));
- // Lapo units IV - UV
+ // Empty capacitor
+ par3List.add(new ItemStack(par1, 1, 6));
+ // Lapo capacitors EV - UV
+ par3List.add(new ItemStack(par1, 1, 7));
par3List.add(new ItemStack(par1, 1, 1));
par3List.add(new ItemStack(par1, 1, 2));
par3List.add(new ItemStack(par1, 1, 3));
@@ -86,6 +98,8 @@ public class Block_LapotronicEnergyUnit extends BaseGTUpdateableBlock {
case 3: return (side < 2) ? iconLapoZPMTop : iconLapoZPMSide;
case 4: return (side < 2) ? iconLapoUVTop : iconLapoUVSide;
case 5: return (side < 2) ? iconUltimateTop : iconUltimateSide;
+ case 6: return (side < 2) ? iconLapoEmptyTop : iconLapoEmptySide;
+ case 7: return (side < 2) ? iconLapoEVTop : iconLapoEVSide;
default: return iconUltimateTop;
}
}
diff --git a/src/main/java/common/itemBlocks/IB_LapotronicEnergyUnit.java b/src/main/java/common/itemBlocks/IB_LapotronicEnergyUnit.java
index 7891be8ea1..b6a8fc2468 100644
--- a/src/main/java/common/itemBlocks/IB_LapotronicEnergyUnit.java
+++ b/src/main/java/common/itemBlocks/IB_LapotronicEnergyUnit.java
@@ -39,6 +39,8 @@ public class IB_LapotronicEnergyUnit extends ItemBlock {
case 3: lines.add("Capacity: 10,000,000,000 EU"); break;
case 4: lines.add("Capacity: 100,000,000,000 EU"); break;
case 5: lines.add("Capacity: 9,223,372,036,854,775,807 EU"); break;
+ case 6: lines.add("Capacity: None"); break;
+ case 7: lines.add("Capacity: 10,000,000 EU"); break;
}
}
}
diff --git a/src/main/java/common/tileentities/GTMTE_LapotronicSuperCapacitor.java b/src/main/java/common/tileentities/GTMTE_LapotronicSuperCapacitor.java
index 07d99fbdb9..0b95e5ffb2 100644
--- a/src/main/java/common/tileentities/GTMTE_LapotronicSuperCapacitor.java
+++ b/src/main/java/common/tileentities/GTMTE_LapotronicSuperCapacitor.java
@@ -51,7 +51,7 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
private final Set<GT_MetaTileEntity_Hatch_EnergyTunnel> mEnergyTunnelsTT = new HashSet<>();
private final Set<GT_MetaTileEntity_Hatch_DynamoTunnel> mDynamoTunnelsTT = new HashSet<>();
// Count the amount of capacitors of each tier in each slot (translate with meta - 1)
- private final int[] capacitors = new int[5];
+ private final int[] capacitors = new int[7];
private BigInteger capacity = BigInteger.ZERO;
private BigInteger stored = BigInteger.ZERO;
private BigInteger passiveDischargeAmount = BigInteger.ZERO;
@@ -89,7 +89,8 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
.addStructureInfo("Modular height of 4-18 blocks.")
.addController("Front center bottom")
.addOtherStructurePart("Lapotronic Super Capacitor Casing", "5x2x5 base (at least 17x)")
- .addOtherStructurePart("Lapotronic Capacitor (IV-UV), Ultimate Capacitor (UHV)", "Center 3x(1-15)x3 above base (9-135 blocks)")
+ .addOtherStructurePart("Lapotronic Capacitor (EV-UV), Ultimate Capacitor (UHV)", "Center 3x(1-15)x3 above base (9-135 blocks)")
+ .addStructureInfo("You can also use the Empty Capacitor to save materials if you use it for less than half the blocks")
.addOtherStructurePart("Borosilicate Glass (any)", "41-265x, Encase capacitor pillar")
.addEnergyHatch("Any casing")
.addDynamoHatch("Any casing")
@@ -200,8 +201,7 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
}
final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, Z);
- final IGregTechTileEntity currentTE =
- thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());
+ final IGregTechTileEntity currentTE = thisController.getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z());
// Tries to add TE as either of those kinds of hatches.
// The number is the texture index number for the texture that needs to be painted over the hatch texture
@@ -233,14 +233,7 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
final int meta = thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z());
if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == LSC_PART && (meta > 0)) {
// Add capacity
- if(meta <= 4){
- final long c = (long) (100000000L * Math.pow(10, meta - 1));
- tempCapacity = tempCapacity.add(BigInteger.valueOf(c));
- capacity = capacity.add(BigInteger.valueOf(c));
- } else if(meta <= 5){
- tempCapacity = tempCapacity.add(BigInteger.valueOf((long) (100000000L * Math.pow(10, 3))));
- capacity = capacity.add(MAX_LONG);
- }
+ tempCapacity = calculateTempCapacity(tempCapacity, meta);
capacitors[meta - 1]++;
} else if(thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName().equals(glassNameBorosilicate)){
firstGlassHeight = Y;
@@ -285,7 +278,7 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
}
}
- if(minCasingAmount > 0){
+ if(minCasingAmount > 0) {
formationChecklist = false;
}
@@ -294,11 +287,8 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
// Borosilicate glass after 5 are just recolours of 0
final int colourCorrectedMeta = firstGlassMeta > 5 ? 0 : firstGlassMeta;
for(int highestCapacitor = capacitors.length - 1; highestCapacitor >= 0; highestCapacitor--){
- if(capacitors[highestCapacitor] > 0){
- if(colourCorrectedMeta < highestCapacitor){
- formationChecklist = false;
- }
- break;
+ if(capacitors[highestCapacitor] > 0 && formationChecklist == true) {
+ formationChecklist = checkGlassTier(colourCorrectedMeta, highestCapacitor);
}
}
@@ -309,27 +299,87 @@ public class GTMTE_LapotronicSuperCapacitor extends GT_MetaTileEntity_MultiBlock
}
mEnergyTunnelsTT.clear();
mDynamoTunnelsTT.clear();
-
}
+ //Check if enough (more than 50%) non-empty caps
+ double emptyCheck = ((double) capacitors[5]) / (double) (capacitors[0] + capacitors[1] + capacitors[2] + capacitors[3] + capacitors[4] + capacitors[6]);
+ if (emptyCheck > 0.5)
+ formationChecklist = false;
+
// Calculate total capacity
- capacity = BigInteger.ZERO;
- for(int i = 0; i < capacitors.length; i++){
- if(i <= 3){
- final long c = (long) (100000000L * Math.pow(10, i));
- capacity = capacity.add(
- BigInteger.valueOf(c).multiply(BigInteger.valueOf(capacitors[i])));
- } else {
- capacity = capacity.add(
- MAX_LONG.multiply(BigInteger.valueOf(capacitors[i])));
- }
- }
+ calculateCapacity();
+
// Calculate how much energy to void each tick
passiveDischargeAmount = new BigDecimal(tempCapacity).multiply(PASSIVE_DISCHARGE_FACTOR_PER_TICK).toBigInteger();
passiveDischargeAmount = recalculateLossWithMaintenance(super.getRepairStatus());
return formationChecklist;
}
+ public BigInteger calculateTempCapacity(BigInteger tempCapacity, int meta) {
+ switch(meta) {
+ case 1: tempCapacity = tempCapacity.add(BigInteger.valueOf(100000000L)); capacity = capacity.add(BigInteger.valueOf(100000000L)); break;
+ case 2: tempCapacity = tempCapacity.add(BigInteger.valueOf(1000000000L)); capacity = capacity.add(BigInteger.valueOf(1000000000L)); break;
+ case 3: tempCapacity = tempCapacity.add(BigInteger.valueOf(10000000000L)); capacity = capacity.add(BigInteger.valueOf(10000000000L)); break;
+ case 4: tempCapacity = tempCapacity.add(BigInteger.valueOf(100000000000L)); capacity = capacity.add(BigInteger.valueOf(100000000000L)); break;
+ case 5: tempCapacity = tempCapacity.add(BigInteger.valueOf(100000000000L)); capacity = capacity.add(MAX_LONG); break;
+ case 6: break;
+ case 7: tempCapacity = tempCapacity.add(BigInteger.valueOf(10000000L)); capacity = capacity.add(BigInteger.valueOf(10000000L)); break;
+ default: break;
+ }
+ return tempCapacity;
+ }
+
+ public boolean checkGlassTier(int colourCorrectedMeta, int highestCapacitor) {
+ Boolean check = true;
+ switch (highestCapacitor) {
+ case 0://For the empty/EV/IV caps, any BS glass works. The case is meta - 1
+ break;
+ case 1:
+ if(colourCorrectedMeta < highestCapacitor) {
+ check = false;
+ }
+ break;
+ case 2:
+ if(colourCorrectedMeta < highestCapacitor) {
+ check = false;
+ }
+ break;
+ case 3:
+ if(colourCorrectedMeta < highestCapacitor) {
+ check = false;
+ }
+ break;
+ case 4:
+ if(colourCorrectedMeta < highestCapacitor) {
+ check = false;
+ }
+ break;
+ case 5:
+ break;
+ case 6:
+ break;
+ default:
+ check = false;
+ }
+ return check; //Return false if it fails the check, otherwise true
+ }
+
+ public void calculateCapacity() {
+ capacity = BigInteger.ZERO;
+ for(int i = 0; i < capacitors.length; i++) {
+ switch(i) {
+ case 0: capacity = capacity.add(BigInteger.valueOf(100000000L).multiply(BigInteger.valueOf(capacitors[i]))); break;
+ case 1: capacity = capacity.add(BigInteger.valueOf(1000000000L).multiply(BigInteger.valueOf(capacitors[i]))); break;
+ case 2: capacity = capacity.add(BigInteger.valueOf(10000000000L).multiply(BigInteger.valueOf(capacitors[i]))); break;
+ case 3: capacity = capacity.add(BigInteger.valueOf(100000000000L).multiply(BigInteger.valueOf(capacitors[i]))); break;
+ case 4: capacity = capacity.add(MAX_LONG.multiply(BigInteger.valueOf(capacitors[i]))); break;
+ case 5: break;
+ case 6: capacity = capacity.add(BigInteger.valueOf(10000000L).multiply(BigInteger.valueOf(capacitors[i]))); break;
+ default: break;
+ }
+ }
+ }
+
@Override
public boolean addEnergyInputToMachineList(IGregTechTileEntity te, int aBaseCasingIndex) {
if (te == null) {
diff --git a/src/main/resources/assets/kekztech/lang/en_US.lang b/src/main/resources/assets/kekztech/lang/en_US.lang
index 174c4863b1..13fc831a0c 100644
--- a/src/main/resources/assets/kekztech/lang/en_US.lang
+++ b/src/main/resources/assets/kekztech/lang/en_US.lang
@@ -140,6 +140,8 @@ tile.kekztech_lapotronicenergyunit_block.2.name=Lapotronic Capacitor (LuV)
tile.kekztech_lapotronicenergyunit_block.3.name=Lapotronic Capacitor (ZPM)
tile.kekztech_lapotronicenergyunit_block.4.name=Lapotronic Capacitor (UV)
tile.kekztech_lapotronicenergyunit_block.5.name=Ultimate Capacitor (UHV)
+tile.kekztech_lapotronicenergyunit_block.6.name=Empty Capacitor (-)
+tile.kekztech_lapotronicenergyunit_block.7.name=Lapotron Capacitor (EV)
tile.kekztech_lapotronicenergyunit_block.desc=Part of the Lapotronic Super Capacitor
# -------- Thaumium Reinforced Jar: Block
diff --git a/src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit6_side.png b/src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit6_side.png
new file mode 100644
index 0000000000..852873db1d
--- /dev/null
+++ b/src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit6_side.png
Binary files differ
diff --git a/src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit6_top.png b/src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit6_top.png
new file mode 100644
index 0000000000..c5034dfd93
--- /dev/null
+++ b/src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit6_top.png
Binary files differ
diff --git a/src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit7_side.png b/src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit7_side.png
new file mode 100644
index 0000000000..852873db1d
--- /dev/null
+++ b/src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit7_side.png
Binary files differ
diff --git a/src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit7_top.png b/src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit7_top.png
new file mode 100644
index 0000000000..06a1bd064f
--- /dev/null
+++ b/src/main/resources/assets/kekztech/textures/blocks/LapotronicEnergyUnit7_top.png
Binary files differ