aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java1
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java78
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java56
4 files changed, 138 insertions, 1 deletions
diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
index cafc650352..2ec0c9abdd 100644
--- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
+++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -114,6 +114,7 @@ public class COMPAT_HANDLER {
GregtechThaumcraftDevices.run();
GregtechThreadedBuffers.run();
GregtechIndustrialMixer.run();
+ GregtechCustomHatches.run();
//New Horizons Content
NewHorizonsAccelerator.run();
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
index 25e1b7d395..b2172519d5 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -343,7 +343,9 @@ public enum GregtechItemList implements GregtechItemContainer {
Infinite_Item_Chest,
- Industrial_Mixer,
+ Industrial_Mixer,
+
+ Hatch_Input_Cryotheum, Hatch_Input_Pyrotheum,
;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java
new file mode 100644
index 0000000000..5a12905756
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java
@@ -0,0 +1,78 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
+
+import gregtech.api.util.GT_Utility;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.ITexture;
+
+public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_Hatch_Input {
+
+ public final Fluid mLockedFluid;
+ public final int mFluidCapacity;
+
+ public GT_MetaTileEntity_Hatch_CustomFluidBase(Fluid aFluid, int aAmount, final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional, 6);
+ this.mRecipeMap = null;
+ this.mLockedFluid = aFluid;
+ this.mFluidCapacity = aAmount;
+ }
+
+ public GT_MetaTileEntity_Hatch_CustomFluidBase(Fluid aFluid, int aAmount, final String aName, final String aDescription,
+ final ITexture[][][] aTextures) {
+ super(aName, 6, aDescription, aTextures);
+ this.mRecipeMap = null;
+ this.mLockedFluid = aFluid;
+ this.mFluidCapacity = aAmount;
+ }
+
+ public GT_MetaTileEntity_Hatch_CustomFluidBase(Fluid aFluid, int aAmount, final String aName, final String[] aDescription, final ITexture[][][] aTextures) {
+ super(aName, 6, aDescription, aTextures);
+ this.mRecipeMap = null;
+ this.mLockedFluid = aFluid;
+ this.mFluidCapacity = aAmount;
+ }
+
+ public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
+ final ItemStack aStack) {
+ return aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0
+ && (this.mRecipeMap == null || GT_Utility.getFluidForFilledItem(aStack, true).getFluid() == this.mLockedFluid);
+ }
+
+ public ITexture[] getTexturesActive(final ITexture aBaseTexture) {
+ return new ITexture[]{aBaseTexture,
+ new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_PUMP)};
+ }
+
+ public ITexture[] getTexturesInactive(final ITexture aBaseTexture) {
+ return new ITexture[]{aBaseTexture,
+ new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_PUMP)};
+ }
+
+ public int getCapacity() {
+ return this.mFluidCapacity;
+ }
+
+ @Override
+ public String[] getDescription() {
+ String[] s2 = new String[]{
+ "Fluid Input for Multiblocks",
+ "Capacity: " + getCapacity()+"L"
+ };
+ return s2;
+ }
+
+ public boolean isFluidInputAllowed(final FluidStack aFluid) {
+ return aFluid.getFluid() == this.mLockedFluid;
+ }
+
+ public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return (MetaTileEntity) new GT_MetaTileEntity_Hatch_CustomFluidBase(this.mLockedFluid, this.mFluidCapacity, this.mName, this.mDescriptionArray, this.mTextures);
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java
new file mode 100644
index 0000000000..6ad5ff2866
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java
@@ -0,0 +1,56 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gregtech.api.enums.ItemList;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.material.ALLOY;
+import gtPlusPlus.core.recipe.common.CI;
+import gtPlusPlus.core.util.minecraft.FluidUtils;
+import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GT_MetaTileEntity_Hatch_CustomFluidBase;
+
+public class GregtechCustomHatches {
+
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Custom Fluid Hatches.");
+ run1();
+ }
+ }
+
+ private static void run1() {
+
+
+ GregtechItemList.Hatch_Input_Cryotheum.set(
+ new GT_MetaTileEntity_Hatch_CustomFluidBase(
+ FluidUtils.getFluidStack("cryotheum", 1).getFluid(), // Fluid to resitrct hatch to
+ 128000, // Capacity
+ 967, // ID
+ "hatch.cryotheum.input.tier.00", // unlocal name
+ "Cryotheum Cooling Hatch" //Local name
+ ).getStackForm(1L));
+
+ GregtechItemList.Hatch_Input_Pyrotheum.set(
+ new GT_MetaTileEntity_Hatch_CustomFluidBase(
+ FluidUtils.getFluidStack("pyrotheum", 1).getFluid(), // Fluid to resitrct hatch to
+ 128000, // Capacity
+ 968, // ID
+ "hatch.pyrotheum.input.tier.00", // unlocal name
+ "Pyrotheum Heating Vent" //Local name
+ ).getStackForm(1L));
+
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[6], ALLOY.MARAGING250.getGear(1), CI.component_Plate[6],
+ CI.getTieredCircuitOreDictName(4), GregtechItemList.Casing_AdvancedVacuum.get(1), CI.getTieredCircuitOreDictName(4),
+ CI.component_Plate[5], ItemList.Hatch_Input_IV.get(1), CI.component_Plate[5],
+ GregtechItemList.Hatch_Input_Cryotheum.get(1L, new Object[0]));
+
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.component_Plate[5], ALLOY.MARAGING300.getGear(1), CI.component_Plate[5],
+ CI.getTieredCircuitOreDictName(4), GregtechItemList.Casing_Adv_BlastFurnace.get(1), CI.getTieredCircuitOreDictName(4),
+ CI.component_Plate[6], ItemList.Hatch_Input_IV.get(1), CI.component_Plate[6],
+ GregtechItemList.Hatch_Input_Pyrotheum.get(1L, new Object[0]));
+
+ }
+
+}