aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2023-12-04 06:26:09 +0900
committerGitHub <noreply@github.com>2023-12-03 22:26:09 +0100
commitb6caaf255da083516286321155ef339b60a07393 (patch)
tree89416c1d29e63de37cb43295a81913de3c24e015 /src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity
parent4ff3ef790f4e22cc80986258f13f8a8643fda0dc (diff)
downloadGT5-Unofficial-b6caaf255da083516286321155ef339b60a07393.tar.gz
GT5-Unofficial-b6caaf255da083516286321155ef339b60a07393.tar.bz2
GT5-Unofficial-b6caaf255da083516286321155ef339b60a07393.zip
Migrate to new RecipeMap (#788)
* Remove reference to GTPP_Recipe itself * Remove GTPP_Recipe_Map_Internal * Move recipemaps to separated class * Remove unused recipemaps * Migrate GT++ recipemaps Remove sElementalDuplicatorRecipes in favor of GT replicatorRecipes supporting findRecipe * Migrate the rest * Adjust catalyst priorities * Add ABS non-alloy recipe category * Remove s prefixes from recipemaps * Adapt to GT_StreamUtil rename * Adjust recipe catalysts * Fix build * update gradle+bs+deps (cherry picked from commit 8b185c7a4d881d38580cc98456265ebb751b6d93) * update deps --------- Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java22
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java8
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java20
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java2
7 files changed, 31 insertions, 32 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java
index 68aaa75aa1..2d534a493d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java
@@ -20,7 +20,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
@@ -29,8 +28,6 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileEntity_Hatch
implements IConfigurationCircuitSupport {
- public GT_Recipe_Map mRecipeMap = null;
-
public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(int aID, String aName, String aNameRegional, int aTier) {
super(
aID,
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java
index 254c81a515..46d6917beb 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java
@@ -18,8 +18,8 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.recipe.RecipeMap;
import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.gui.widget.ElectricSlotWidget;
@@ -27,7 +27,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
public class GT_MetaTileEntity_Hatch_InputBattery extends GT_MetaTileEntity_Hatch {
- public final GT_Recipe_Map mRecipeMap = null;
+ public final RecipeMap<?> mRecipeMap = null;
public GT_MetaTileEntity_Hatch_InputBattery(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, getSlots(aTier), "Chargeable Item Bus for Multiblocks");
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java
index 47e30ab50c..0122b1b0c8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java
@@ -19,14 +19,14 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.recipe.RecipeMap;
import gregtech.api.render.TextureFactory;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
public class GT_MetaTileEntity_Hatch_Steam_BusInput extends GT_MetaTileEntity_Hatch {
- public GT_Recipe_Map mRecipeMap = null;
+ public RecipeMap<?> mRecipeMap = null;
public boolean disableSort;
public GT_MetaTileEntity_Hatch_Steam_BusInput(int aID, String aName, String aNameRegional, int aTier) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
index aa7422a79b..caf96ebf4f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -69,9 +69,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maint
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus;
+import gregtech.api.recipe.RecipeMap;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.IGT_HatchAdder;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
@@ -391,7 +391,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
@Override
protected void setProcessingLogicPower(ProcessingLogic logic) {
- logic.setAvailableVoltage(GT_Utility.roundDownVoltage(this.getMaxInputVoltage()));
+ logic.setAvailableVoltage(GT_Utility.roundUpVoltage(this.getMaxInputVoltage()));
logic.setAvailableAmperage(1L);
}
@@ -809,7 +809,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
return resetRecipeMapForAllInputHatches(this.getRecipeMap());
}
- public boolean resetRecipeMapForAllInputHatches(GT_Recipe_Map aMap) {
+ public boolean resetRecipeMapForAllInputHatches(RecipeMap<?> aMap) {
int cleared = 0;
for (GT_MetaTileEntity_Hatch_Input g : this.mInputHatches) {
if (resetRecipeMapForHatch(g, aMap)) {
@@ -824,7 +824,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
return cleared > 0;
}
- public boolean resetRecipeMapForHatch(IGregTechTileEntity aTileEntity, GT_Recipe_Map aMap) {
+ public boolean resetRecipeMapForHatch(IGregTechTileEntity aTileEntity, RecipeMap<?> aMap) {
try {
final IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity);
if (aMetaTileEntity == null) {
@@ -843,7 +843,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
}
}
- public boolean resetRecipeMapForHatch(GT_MetaTileEntity_Hatch aTileEntity, GT_Recipe_Map aMap) {
+ public boolean resetRecipeMapForHatch(GT_MetaTileEntity_Hatch aTileEntity, RecipeMap<?> aMap) {
if (aTileEntity == null) {
return false;
}
@@ -854,24 +854,24 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex
if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) {
((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = null;
((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = aMap;
- if (aMap != null && aMap.mNEIName != null) {
- log("Remapped Input Hatch to " + aMap.mNEIName + ".");
+ if (aMap != null) {
+ log("Remapped Input Hatch to " + aMap.unlocalizedName + ".");
} else {
log("Cleared Input Hatch.");
}
} else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) {
((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = null;
((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = aMap;
- if (aMap != null && aMap.mNEIName != null) {
- log("Remapped Input Bus to " + aMap.mNEIName + ".");
+ if (aMap != null) {
+ log("Remapped Input Bus to " + aMap.unlocalizedName + ".");
} else {
log("Cleared Input Bus.");
}
} else {
((GT_MetaTileEntity_Hatch_Steam_BusInput) aMetaTileEntity).mRecipeMap = null;
((GT_MetaTileEntity_Hatch_Steam_BusInput) aMetaTileEntity).mRecipeMap = aMap;
- if (aMap != null && aMap.mNEIName != null) {
- log("Remapped Input Bus to " + aMap.mNEIName + ".");
+ if (aMap != null) {
+ log("Remapped Input Bus to " + aMap.unlocalizedName + ".");
} else {
log("Cleared Input Bus.");
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java
index 7b88f718b5..55288bc85c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java
@@ -23,8 +23,8 @@ import gregtech.api.logic.ProcessingLogic;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.recipe.RecipeMap;
import gregtech.api.util.GT_HatchElementBuilder;
-import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.IGT_HatchAdder;
import gtPlusPlus.core.util.minecraft.FluidUtils;
@@ -161,7 +161,9 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu
log("Adding Steam Input Hatch");
aDidAdd = addToMachineListInternal(mSteamInputFluids, aMetaTileEntity, aBaseCasingIndex);
} else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput) {
- log("Trying to set recipe map. Type: " + (getRecipeMap() != null ? getRecipeMap().mNEIName : "Null"));
+ log(
+ "Trying to set recipe map. Type: "
+ + (getRecipeMap() != null ? getRecipeMap().unlocalizedName : "Null"));
this.resetRecipeMapForHatch(aTileEntity, getRecipeMap());
log("Adding Steam Input Bus");
aDidAdd = addToMachineListInternal(mSteamInputs, aMetaTileEntity, aBaseCasingIndex);
@@ -317,7 +319,7 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu
}
@Override
- public boolean resetRecipeMapForAllInputHatches(GT_Recipe.GT_Recipe_Map aMap) {
+ public boolean resetRecipeMapForAllInputHatches(RecipeMap<?> aMap) {
boolean ret = super.resetRecipeMapForAllInputHatches(aMap);
for (GT_MetaTileEntity_Hatch_Steam_BusInput hatch : mSteamInputs) {
if (resetRecipeMapForHatch(hatch, aMap)) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
index cab45a9a7b..6d898337ac 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
@@ -16,15 +16,16 @@ import gregtech.api.enums.Textures;
import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.interfaces.tileentity.RecipeMapWorkable;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
+import gregtech.api.recipe.RecipeMap;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
-public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_BasicTank {
+public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_BasicTank implements RecipeMapWorkable {
private boolean useFuel = false;
protected int pollMin, pollMax;
@@ -295,7 +296,8 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
return MathUtils.randInt(pollMin, pollMax);
}
- public abstract GT_Recipe_Map getRecipes();
+ @Override
+ public abstract RecipeMap<?> getRecipeMap();
public abstract int getEfficiency();
@@ -304,11 +306,11 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
}
public int getFuelValue(final FluidStack aLiquid) {
- if ((aLiquid == null) || (this.getRecipes() == null)) {
+ if ((aLiquid == null) || (this.getRecipeMap() == null)) {
return 0;
}
FluidStack tLiquid;
- final Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
+ final Collection<GT_Recipe> tRecipeList = this.getRecipeMap().getAllRecipes();
if (tRecipeList != null) {
// Logger.INFO("Step A");
for (final GT_Recipe tFuel : tRecipeList) {
@@ -329,10 +331,10 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
}
public int getFuelValue(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack) || (this.getRecipes() == null)) {
+ if (GT_Utility.isStackInvalid(aStack) || (this.getRecipeMap() == null)) {
return 0;
}
- final GT_Recipe tFuel = this.getRecipes()
+ final GT_Recipe tFuel = this.getRecipeMap()
.findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack);
if (tFuel != null) {
return (int) ((tFuel.mSpecialValue * 1000L * this.getEfficiency()) / 100);
@@ -341,10 +343,10 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
}
public ItemStack getEmptyContainer(final ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack) || (this.getRecipes() == null)) {
+ if (GT_Utility.isStackInvalid(aStack) || (this.getRecipeMap() == null)) {
return null;
}
- final GT_Recipe tFuel = this.getRecipes()
+ final GT_Recipe tFuel = this.getRecipeMap()
.findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack);
if (tFuel != null) {
return GT_Utility.copy(tFuel.getOutput(0));
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java
index 53c988676f..2ca8b0ba74 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java
@@ -16,7 +16,6 @@ import gregtech.api.interfaces.modularui.IAddGregtechLogo;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
@@ -25,7 +24,6 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileEntity_Hatch
implements IAddGregtechLogo {
- public GT_Recipe_Map mRecipeMap = null;
private final int mInputslotCount;
private final int mTotalSlotCount;
private final boolean mAllowDuplicateUsageTypes;