From 68e266e0a227aaf90294d2a8ffd5081dc3bb640e Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Thu, 24 Oct 2019 00:58:51 +0100 Subject: + Added Chemical Plant. + Added more Bio Recipes. $ Fixed Strontium Hydroxide generating before it's components. $ Fixed existing Bio Recipes not working. --- .../core/slots/SlotChemicalPlantInput.java | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java (limited to 'src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java') diff --git a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java new file mode 100644 index 0000000000..6cd13dc209 --- /dev/null +++ b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java @@ -0,0 +1,45 @@ +package gtPlusPlus.core.slots; + +import gregtech.api.util.Recipe_GT; +import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class SlotChemicalPlantInput extends Slot { + + public SlotChemicalPlantInput(final IInventory inventory, final int index, final int x, final int y) { + super(inventory, index, x, y); + } + + @Override + public boolean isItemValid(final ItemStack itemstack) { + return isItemValidForChemicalPlantSlot(itemstack); + } + + public static boolean isItemValidForChemicalPlantSlot(ItemStack aStack) { + boolean validItem = Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.containsInput(aStack); + if (!validItem) { + for (Recipe_GT f : Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList) { + if (f.mFluidInputs.length > 0) { + for (FluidStack g : f.mFluidInputs) { + if (g != null) { + if (FluidContainerRegistry.containsFluid(aStack, g)) { + return true; + } + } + } + } + } + } + return validItem; + } + + @Override + public int getSlotStackLimit() { + return 64; + } + +} -- cgit