diff options
| author | Draknyte1 <Draknyte1@hotmail.com> | 2016-08-27 01:34:08 +1000 |
|---|---|---|
| committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-08-27 01:34:08 +1000 |
| commit | 072f6322fb789703f163030edf4b60bf5a0201af (patch) | |
| tree | 9d2d9c2ba6fe3bc5139a9868ee4eca95629fdd95 /src/Java/miscutil/xmod/psychedelicraft | |
| parent | f555ac2e146e572155e176131c23e73cd74684f1 (diff) | |
| download | GT5-Unofficial-072f6322fb789703f163030edf4b60bf5a0201af.tar.gz GT5-Unofficial-072f6322fb789703f163030edf4b60bf5a0201af.tar.bz2 GT5-Unofficial-072f6322fb789703f163030edf4b60bf5a0201af.zip | |
+ Attempted to add custom IC2 generators.
% Refactored the xmod package to be a parent, beside core. No longer is it a child, it needs room to grow.
Diffstat (limited to 'src/Java/miscutil/xmod/psychedelicraft')
| -rw-r--r-- | src/Java/miscutil/xmod/psychedelicraft/HANDLER_Psych.java | 27 | ||||
| -rw-r--r-- | src/Java/miscutil/xmod/psychedelicraft/fluids/PS_Fluids.java | 54 |
2 files changed, 81 insertions, 0 deletions
diff --git a/src/Java/miscutil/xmod/psychedelicraft/HANDLER_Psych.java b/src/Java/miscutil/xmod/psychedelicraft/HANDLER_Psych.java new file mode 100644 index 0000000000..423d164a3b --- /dev/null +++ b/src/Java/miscutil/xmod/psychedelicraft/HANDLER_Psych.java @@ -0,0 +1,27 @@ +package miscutil.xmod.psychedelicraft; + +import miscutil.core.lib.LoadedMods; +import miscutil.xmod.psychedelicraft.fluids.PS_Fluids; + + +public class HANDLER_Psych { + + public static void preInit(){ + if (LoadedMods.Psychedelicraft){ + PS_Fluids.registerFluids(); + } + } + + public static void init(){ + if (LoadedMods.Psychedelicraft){ + PS_Fluids.registerAlcohols(); + } + } + + public static void postInit(){ + if (LoadedMods.Psychedelicraft){ + + } + } + +} diff --git a/src/Java/miscutil/xmod/psychedelicraft/fluids/PS_Fluids.java b/src/Java/miscutil/xmod/psychedelicraft/fluids/PS_Fluids.java new file mode 100644 index 0000000000..ada7cb21bd --- /dev/null +++ b/src/Java/miscutil/xmod/psychedelicraft/fluids/PS_Fluids.java @@ -0,0 +1,54 @@ +package miscutil.xmod.psychedelicraft.fluids; + +import ivorius.ivtoolkit.gui.IntegerRange; +import ivorius.psychedelicraft.blocks.TileEntityMashTub; +import ivorius.psychedelicraft.config.PSConfig; +import ivorius.psychedelicraft.fluids.FluidAlcohol; +import ivorius.psychedelicraft.items.PSItems; +import miscutil.core.lib.CORE; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.ShapelessOreRecipe; +import cpw.mods.fml.common.registry.GameRegistry; + +public class PS_Fluids { + + public static FluidAlcohol alcJD; + + public static void registerFluids(){ + alcJD = new FluidAlcohol("psc_JD", 2, 0.45D, 1.9D, 0.15D, PSConfig.alcInfoPotato); + alcJD.addName(CORE.MODID + ":" + "drinkMash", new IntegerRange(0, -1), new IntegerRange(0, 0)); + alcJD.addName(CORE.MODID + ":" + "drinkAgedWhisky", new IntegerRange(0, 0), new IntegerRange(1, -1)); + alcJD.addName(CORE.MODID + ":" + "drinkWhisky", new IntegerRange(0, -1), new IntegerRange(1, -1)); + alcJD.setColor(-1426150904); + alcJD.setStillIconName(CORE.MODID + ":" + "mash_still"); + alcJD.setFlowingIconName(CORE.MODID + ":" + "mash_flow"); + alcJD.addIcon(new IntegerRange(-1, -1), new IntegerRange(0, 3), new IntegerRange(2, -1), CORE.MODID + ":" + "clear_still", CORE.MODID + ":" + "clear_flow"); + alcJD.addIcon(new IntegerRange(-1, -1), new IntegerRange(4, 13), new IntegerRange(0, -1), CORE.MODID + ":" + "rum_semi_mature_still", CORE.MODID + ":" + "rum_semi_mature_flow"); + alcJD.addIcon(new IntegerRange(-1, -1), new IntegerRange(14, -1), new IntegerRange(0, -1), CORE.MODID + ":" + "rum_mature_still", CORE.MODID + ":" + "rum_mature_flow"); + FluidRegistry.registerFluid(alcJD); + } + + public static void registerAlcohols(){ + addMashTubRecipe2(new FluidStack(alcJD, TileEntityMashTub.MASH_TUB_CAPACITY), new Object[] { "foodPotato", "foodPotato", "foodPotato", "foodPotato", "foodPotato", "foodBanana", "foodBanana", "foodBanana" }); + } + + private static void addMashTubRecipe2(FluidStack fluid, Object... ingredients) + { + ItemStack mashTubStack = new ItemStack(PSItems.itemMashTub); + PSItems.itemMashTub.fill(mashTubStack, fluid, true); + + Object[] ing = new Object[ingredients.length + 1]; + System.arraycopy(ingredients, 0, ing, 1, ingredients.length); + ing[0] = new ItemStack(PSItems.itemMashTub); + + addShapelessRecipe2(mashTubStack, ing); + } + + private static void addShapelessRecipe2(ItemStack output, Object... params) + { + GameRegistry.addRecipe(new ShapelessOreRecipe(output, params)); + } + +} |
