aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
authorD-Cysteine <54219287+D-Cysteine@users.noreply.github.com>2021-08-01 16:29:52 -0600
committerD-Cysteine <54219287+D-Cysteine@users.noreply.github.com>2021-08-01 16:41:43 -0600
commit3e59d9f8f2db7d56d9b1431b1e3b93c97752e20a (patch)
tree93722d4cc0d01c99328b45fb7be0a588868bf57b /src/main/java/gregtech/api
parent8680bb2d9a0db42451a277e01d6e881f5c376333 (diff)
downloadGT5-Unofficial-3e59d9f8f2db7d56d9b1431b1e3b93c97752e20a.tar.gz
GT5-Unofficial-3e59d9f8f2db7d56d9b1431b1e3b93c97752e20a.tar.bz2
GT5-Unofficial-3e59d9f8f2db7d56d9b1431b1e3b93c97752e20a.zip
Add cracked fluid cells
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/enums/OrePrefixes.java30
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java21
-rw-r--r--src/main/java/gregtech/api/util/GT_ModHandler.java17
3 files changed, 55 insertions, 13 deletions
diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java
index 3aaea29f28..77b6ee9426 100644
--- a/src/main/java/gregtech/api/enums/OrePrefixes.java
+++ b/src/main/java/gregtech/api/enums/OrePrefixes.java
@@ -1,6 +1,7 @@
package gregtech.api.enums;
import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableList;
import gregtech.api.GregTech_API;
import gregtech.api.enums.TC_Aspects.TC_AspectStack;
import gregtech.api.interfaces.ICondition;
@@ -319,8 +320,27 @@ public enum OrePrefixes {
bars("Bars", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
bar("Bars", "", "", false, false, false, false, false, false, false, false, false, false, 0, -1, 64, -1),
toolHeadMallet("Mallet Heads", "", " Mallet Head", true, true, false, false, false, false, true, true, false, false, B[6], M * 6, 16, 127), // Reverse Head consisting out of 6 Ingots.
- handleMallet("Mallet Handle", "", " Handle", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 2, 64, 126); // Reverse Stick made of half an Ingot. Introduced by Eloraam
-
+ handleMallet("Mallet Handle", "", " Handle", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M / 2, 64, 126), // Reverse Stick made of half an Ingot. Introduced by Eloraam
+
+ // Cracked fluids
+ cellHydroCracked1("Cells", "Lightly Hydro-Cracked ", " Cell", true, true, true, true, false, false, false, true, false, false, 0, M * 1, 64, 30),
+ cellHydroCracked2("Cells", "Moderately Hydro-Cracked ", " Cell", true, true, true, true, false, false, false, true, false, false, 0, M * 1, 64, 30),
+ cellHydroCracked3("Cells", "Severely Hydro-Cracked ", " Cell", true, true, true, true, false, false, false, true, false, false, 0, M * 1, 64, 30),
+ cellSteamCracked1("Cells", "Lightly Steam-Cracked ", " Cell", true, true, true, true, false, false, false, true, false, false, 0, M * 1, 64, 30),
+ cellSteamCracked2("Cells", "Moderately Steam-Cracked ", " Cell", true, true, true, true, false, false, false, true, false, false, 0, M * 1, 64, 30),
+ cellSteamCracked3("Cells", "Severely Steam-Cracked ", " Cell", true, true, true, true, false, false, false, true, false, false, 0, M * 1, 64, 30);
+
+ public static final ImmutableList<OrePrefixes> CELL_TYPES =
+ ImmutableList.of(
+ cell, cellMolten, cellPlasma,
+ cellHydroCracked1, cellHydroCracked2, cellHydroCracked3,
+ cellSteamCracked1, cellSteamCracked2, cellSteamCracked3);
+
+ public static final ImmutableList<OrePrefixes> CRACKED_CELL_TYPES =
+ ImmutableList.of(
+ cellHydroCracked1, cellHydroCracked2, cellHydroCracked3,
+ cellSteamCracked1, cellSteamCracked2, cellSteamCracked3);
+
public static volatile int VERSION = 509;
static {
@@ -531,6 +551,12 @@ public enum OrePrefixes {
cell.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
cellPlasma.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
cellMolten.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
+ cellHydroCracked1.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
+ cellHydroCracked2.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
+ cellHydroCracked3.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
+ cellSteamCracked1.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
+ cellSteamCracked2.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
+ cellSteamCracked3.mSecondaryMaterial = new MaterialStack(Materials.Tin, plate.mMaterialAmount * 2);
oreRedgranite.mSecondaryMaterial = new MaterialStack(Materials.GraniteRed, dust.mMaterialAmount);
oreBlackgranite.mSecondaryMaterial = new MaterialStack(Materials.GraniteBlack, dust.mMaterialAmount);
oreNetherrack.mSecondaryMaterial = new MaterialStack(Materials.Netherrack, dust.mMaterialAmount);
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java
index 48d1bd8a18..57f7073e24 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java
@@ -245,16 +245,17 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
public boolean solidFuelOverride(ItemStack stack) {
//this could be used for a coal generator for example aswell...
ItemData association = GT_OreDictUnificator.getAssociation(stack);
- //if it is a gregtech Item, make sure its not a VOLUMETRIC_FLASK, cell, motlen cell or plasma cell, else do vanilla checks
- return association != null ? !OrePrefixes.cell.equals(association.mPrefix) &&
- !OrePrefixes.cellMolten.equals(association.mPrefix) &&
- !OrePrefixes.cellPlasma.equals(association.mPrefix) &&
- !GT_Utility.areStacksEqual(ItemList.VOLUMETRIC_FLASK.get(1L), stack, true) :
- stack != null && //when the stack is null its not a solid
- stack.getItem() != null && //when the item in the stack is null its not a solid
- !(stack.getItem() instanceof IFluidContainerItem) && //when the item is a fluid container its not a solid...
- !(stack.getItem() instanceof IFluidHandler) && //when the item is a fluid handler its not a solid...
- !stack.getItem().getUnlocalizedName().contains("bucket"); //since we cant really check for buckets...
+ //if it is a gregtech Item, make sure its not a VOLUMETRIC_FLASK or any type of cell, else do vanilla checks
+ if (association != null) {
+ return !OrePrefixes.CELL_TYPES.contains(association.mPrefix) &&
+ !GT_Utility.areStacksEqual(ItemList.VOLUMETRIC_FLASK.get(1L), stack, true);
+ } else {
+ return stack != null && //when the stack is null its not a solid
+ stack.getItem() != null && //when the item in the stack is null its not a solid
+ !(stack.getItem() instanceof IFluidContainerItem) && //when the item is a fluid container its not a solid...
+ !(stack.getItem() instanceof IFluidHandler) && //when the item is a fluid handler its not a solid...
+ !stack.getItem().getUnlocalizedName().contains("bucket"); //since we cant really check for buckets...
+ }
}
public abstract int getPollution();
diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java
index ac9f7bd3d4..a910723069 100644
--- a/src/main/java/gregtech/api/util/GT_ModHandler.java
+++ b/src/main/java/gregtech/api/util/GT_ModHandler.java
@@ -2008,7 +2008,22 @@ public class GT_ModHandler {
public static int getCapsuleCellContainerCount(ItemStack aStack) {
if (aStack == null) return 0;
- return GT_Utility.areStacksEqual(GT_Utility.getContainerForFilledItem(aStack, true), ItemList.Cell_Empty.get(1)) || OrePrefixes.cell.contains(aStack) || OrePrefixes.cellMolten.contains(aStack) || OrePrefixes.cellPlasma.contains(aStack) || GT_Utility.areStacksEqual(aStack, getIC2Item("waterCell", 1, W)) ? 1 : 0;
+
+ if (GT_Utility.areStacksEqual(GT_Utility.getContainerForFilledItem(aStack, true), ItemList.Cell_Empty.get(1))) {
+ return 1;
+ }
+
+ if (GT_Utility.areStacksEqual(aStack, getIC2Item("waterCell", 1, W))) {
+ return 1;
+ }
+
+ for (OrePrefixes cellType : OrePrefixes.CELL_TYPES) {
+ if (cellType.contains(aStack)) {
+ return 1;
+ }
+ }
+
+ return 0;
}
public static class RecipeBits {