aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Robertz <dream-master@gmx.net>2022-08-31 10:43:06 +0200
committerGitHub <noreply@github.com>2022-08-31 10:43:06 +0200
commit0c50a48fc4d4448c084ca3535af37b4981dd2d7c (patch)
tree28077f6375f883a15cc91276677c857e616d83aa /src
parent4927a8885381ca48479be71e7cdb37aae9cbf5fd (diff)
downloadGT5-Unofficial-0c50a48fc4d4448c084ca3535af37b4981dd2d7c.tar.gz
GT5-Unofficial-0c50a48fc4d4448c084ca3535af37b4981dd2d7c.tar.bz2
GT5-Unofficial-0c50a48fc4d4448c084ca3535af37b4981dd2d7c.zip
Two slots wiremill (#1324)
* add a circuit slot to wiremil * add circuits to wire recipes * add 2 input slots to Wiremil * exchange circuit and material slot * add 2x-16x wires to wiremil * add missing 12x wires * add slot migration code (#1326) * spotlessApply (#1327) Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: GitHub GTNH Actions <> Co-authored-by: Glease <4586901+Glease@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/GT_Mod.java2
-rw-r--r--src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java2
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java14
-rw-r--r--src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java11
-rw-r--r--src/main/java/gregtech/api/util/GT_Recipe.java2
-rw-r--r--src/main/java/gregtech/common/GT_RecipeAdder.java21
-rw-r--r--src/main/java/gregtech/loaders/oreprocessing/ProcessingFineWire.java82
-rw-r--r--src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java1
-rw-r--r--src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java10
-rw-r--r--src/main/resources/assets/gregtech/textures/gui/basicmachines/Wiremill.pngbin2971 -> 5085 bytes
10 files changed, 130 insertions, 15 deletions
diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java
index 7025c16416..23ef836960 100644
--- a/src/main/java/gregtech/GT_Mod.java
+++ b/src/main/java/gregtech/GT_Mod.java
@@ -138,7 +138,7 @@ import org.apache.logging.log4j.Logger;
public class GT_Mod implements IGT_Mod {
@Deprecated // Keep for use in BaseMetaTileEntity
- public static final int VERSION = 509, SUBVERSION = 40;
+ public static final int VERSION = 509, SUBVERSION = 41;
@SuppressWarnings("DeprecatedIsStillUsed") // Need initialization until it is deleted
@Deprecated
diff --git a/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java b/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java
index d29dc96316..cfebfef7fc 100644
--- a/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java
+++ b/src/main/java/gregtech/api/interfaces/internal/IGT_RecipeAdder.java
@@ -595,6 +595,8 @@ public interface IGT_RecipeAdder {
*/
boolean addWiremillRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt);
+ boolean addWiremillRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput, int aDuration, int aEUt);
+
/**
* Adds a Polariser Recipe
*
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
index 911c1cabcb..76a6d3237e 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
@@ -2270,13 +2270,15 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity
* @param nbtVersion The GregTech version in which the original Inventory Index was saved.
* @return The corrected Inventory index
*/
- private int migrateInventoryIndex(int slotIndex, int nbtVersion) {
+ @Override
+ protected int migrateInventoryIndex(int slotIndex, int nbtVersion) {
final int oldInputSize;
final int newInputSize;
final int oldOutputSize;
final int newOutputSize;
final int chemistryUpdateVersion = GT_Mod.calculateTotalGTVersion(509, 31);
final int configCircuitAdditionVersion = GT_Mod.calculateTotalGTVersion(509, 40);
+ final int wireAdditionVersion = GT_Mod.calculateTotalGTVersion(509, 41);
// 4 is old GT_MetaTileEntity_BasicMachine.OTHER_SLOT_COUNT
if (nbtVersion < configCircuitAdditionVersion
&& getMetaTileEntity() instanceof GT_MetaTileEntity_BasicMachine
@@ -2320,6 +2322,16 @@ public class BaseMetaTileEntity extends CommonMetaTileEntity
newInputSize = 6;
newOutputSize = 1;
+ } else if (mID >= 351 && mID <= 355 || mID >= 11050 && mID <= 11056) { // wire mill
+ if (nbtVersion < wireAdditionVersion) {
+ oldInputSize = 1;
+ oldOutputSize = 1;
+ } else {
+ return slotIndex;
+ }
+ newInputSize = 2;
+ newOutputSize = 1;
+
} else {
return slotIndex;
}
diff --git a/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java
index 7e35f2e2c1..bf835b51bb 100644
--- a/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java
@@ -59,11 +59,12 @@ public abstract class CommonMetaTileEntity extends CoverableTileEntity implement
}
protected void loadMetaTileNBT(NBTTagCompound aNBT) {
+ final int nbtVersion = aNBT.getInteger("nbtVersion");
if (mID != 0 && createNewMetatileEntity(mID)) {
final NBTTagList tItemList = aNBT.getTagList("Inventory", 10);
for (int i = 0; i < tItemList.tagCount(); i++) {
final NBTTagCompound tTag = tItemList.getCompoundTagAt(i);
- final int tSlot = tTag.getInteger("IntSlot");
+ final int tSlot = migrateInventoryIndex(tTag.getInteger("IntSlot"), nbtVersion);
if (tSlot >= 0 && tSlot < getMetaTileEntity().getRealInventory().length) {
getMetaTileEntity().getRealInventory()[tSlot] = GT_Utility.loadItem(tTag);
}
@@ -78,6 +79,14 @@ public abstract class CommonMetaTileEntity extends CoverableTileEntity implement
}
}
+ /**
+ * Shifts the machine Inventory index according to the change in Input/Output Slots.
+ * Default implementation does not do anything to the slotIndex.
+ */
+ protected int migrateInventoryIndex(int slotIndex, int nbtVersion) {
+ return slotIndex;
+ }
+
@Override
public void markDirty() {
super.markDirty();
diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java
index 5ec8ad16a2..09549a52c8 100644
--- a/src/main/java/gregtech/api/util/GT_Recipe.java
+++ b/src/main/java/gregtech/api/util/GT_Recipe.java
@@ -1712,7 +1712,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
"Wiremill",
null,
RES_PATH_GUI + "basicmachines/Wiremill",
- 1,
+ 2,
1,
1,
0,
diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java
index a3fd8013c2..f75712a887 100644
--- a/src/main/java/gregtech/common/GT_RecipeAdder.java
+++ b/src/main/java/gregtech/common/GT_RecipeAdder.java
@@ -1147,6 +1147,27 @@ public class GT_RecipeAdder implements IGT_RecipeAdder {
}
@Override
+ public boolean addWiremillRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput, int aDuration, int aEUt) {
+ if ((aInput == null) || (aOutput == null)) {
+ return false;
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("wiremill", aInput, aDuration)) <= 0) {
+ return false;
+ }
+ GT_Recipe.GT_Recipe_Map.sWiremillRecipes.addRecipe(
+ true,
+ new ItemStack[] {aInput, aCircuit},
+ new ItemStack[] {aOutput},
+ null,
+ null,
+ null,
+ aDuration,
+ aEUt,
+ 0);
+ return true;
+ }
+
+ @Override
public boolean addPolarizerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) {
if ((aInput == null) || (aOutput == null)) {
return false;
diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingFineWire.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingFineWire.java
index 458146ffd7..bd6fb6a905 100644
--- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingFineWire.java
+++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingFineWire.java
@@ -21,16 +21,86 @@ public class ProcessingFineWire implements gregtech.api.interfaces.IOreRecipeReg
if (!aMaterial.contains(gregtech.api.enums.SubTag.NO_SMASHING)) {
GT_Values.RA.addWiremillRecipe(
GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L),
- GT_Utility.copy(
- GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 2L),
- GT_Utility.copyAmount(8L, aStack)),
+ GT_Utility.getIntegratedCircuit(1),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 2L),
+ 100,
+ 4);
+ GT_Values.RA.addWiremillRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L),
+ GT_Utility.getIntegratedCircuit(2),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L),
+ 150,
+ 4);
+ GT_Values.RA.addWiremillRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 2L),
+ GT_Utility.getIntegratedCircuit(4),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L),
+ 200,
+ 4);
+ GT_Values.RA.addWiremillRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 4L),
+ GT_Utility.getIntegratedCircuit(8),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L),
+ 250,
+ 4);
+ GT_Values.RA.addWiremillRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 6L),
+ GT_Utility.getIntegratedCircuit(12),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L),
+ 300,
+ 4);
+ GT_Values.RA.addWiremillRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 8L),
+ GT_Utility.getIntegratedCircuit(16),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L),
+ 350,
+ 4);
+ GT_Values.RA.addWiremillRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L),
+ GT_Utility.getIntegratedCircuit(1),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L),
+ 50,
+ 4);
+ GT_Values.RA.addWiremillRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 2L),
+ GT_Utility.getIntegratedCircuit(2),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L),
+ 100,
+ 4);
+ GT_Values.RA.addWiremillRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 4L),
+ GT_Utility.getIntegratedCircuit(4),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L),
+ 150,
+ 4);
+ GT_Values.RA.addWiremillRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 8L),
+ GT_Utility.getIntegratedCircuit(8),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L),
+ 200,
+ 4);
+ GT_Values.RA.addWiremillRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 12L),
+ GT_Utility.getIntegratedCircuit(12),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L),
+ 250,
+ 4);
+ GT_Values.RA.addWiremillRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 16L),
+ GT_Utility.getIntegratedCircuit(16),
+ GT_OreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L),
+ 300,
+ 4);
+ GT_Values.RA.addWiremillRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L),
+ GT_Utility.getIntegratedCircuit(3),
+ GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 8L),
100,
4);
GT_Values.RA.addWiremillRecipe(
GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L),
- GT_Utility.copy(
- GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L),
- GT_Utility.copyAmount(4L, aStack)),
+ GT_Utility.getIntegratedCircuit(3),
+ GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 4L),
50,
4);
}
diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java
index 708952ce8d..71724bf27f 100644
--- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java
+++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java
@@ -57,6 +57,7 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr
8);
GT_Values.RA.addWiremillRecipe(
GT_Utility.copyAmount(1L, aStack),
+ GT_Utility.getIntegratedCircuit(1),
GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 4L),
200,
8);
diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java
index aee66594ea..f0b9814db8 100644
--- a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java
+++ b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java
@@ -5469,7 +5469,7 @@ public class GT_Loader_MetaTileEntities implements Runnable { // TODO CHECK CIRC
1,
"Produces Wires more efficiently",
GT_Recipe.GT_Recipe_Map.sWiremillRecipes,
- 1,
+ 2,
1,
0,
0,
@@ -5501,7 +5501,7 @@ public class GT_Loader_MetaTileEntities implements Runnable { // TODO CHECK CIRC
2,
"Produces Wires more efficiently",
GT_Recipe.GT_Recipe_Map.sWiremillRecipes,
- 1,
+ 2,
1,
0,
0,
@@ -5533,7 +5533,7 @@ public class GT_Loader_MetaTileEntities implements Runnable { // TODO CHECK CIRC
3,
"Produces Wires more efficiently",
GT_Recipe.GT_Recipe_Map.sWiremillRecipes,
- 1,
+ 2,
1,
0,
0,
@@ -5565,7 +5565,7 @@ public class GT_Loader_MetaTileEntities implements Runnable { // TODO CHECK CIRC
4,
"Produces Wires more efficiently",
GT_Recipe.GT_Recipe_Map.sWiremillRecipes,
- 1,
+ 2,
1,
0,
0,
@@ -5597,7 +5597,7 @@ public class GT_Loader_MetaTileEntities implements Runnable { // TODO CHECK CIRC
5,
"Produces Wires more efficiently",
GT_Recipe.GT_Recipe_Map.sWiremillRecipes,
- 1,
+ 2,
1,
0,
0,
diff --git a/src/main/resources/assets/gregtech/textures/gui/basicmachines/Wiremill.png b/src/main/resources/assets/gregtech/textures/gui/basicmachines/Wiremill.png
index 47904bea1e..b2641822c5 100644
--- a/src/main/resources/assets/gregtech/textures/gui/basicmachines/Wiremill.png
+++ b/src/main/resources/assets/gregtech/textures/gui/basicmachines/Wiremill.png
Binary files differ