diff options
Diffstat (limited to 'src/Java')
10 files changed, 676 insertions, 32 deletions
diff --git a/src/Java/gtPlusPlus/core/item/general/chassis/itemDehydratorCoilMeta.java b/src/Java/gtPlusPlus/core/item/general/chassis/itemDehydratorCoilMeta.java new file mode 100644 index 0000000000..a743604547 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/general/chassis/itemDehydratorCoilMeta.java @@ -0,0 +1,74 @@ +public class itemDehydratorCoil extends Item { + + public IIcon[] icon = new IIcon[1]; + + public itemDehydratorCoil() { + super(); + this.setHasSubtypes(true); + String unlocalizedName = "itemDehydratorCoil"; + this.setUnlocalizedName(unlocalizedName); + this.setCreativeTab(AddToCreativeTab.tabMisc); + GameRegistry.registerItem(this, unlocalizedName); + } + + @Override + public void registerIcons(IIconRegister reg) { + this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "itemDehydratorCoil"); + } + + @Override + public IIcon getIconFromDamage(int meta) { + return this.icons[0]; + } + + @Override + public void getSubItems(Item item, CreativeTabs tab, List list) { + for (int i = 0; i < 4; i ++) { + list.add(new ItemStack(item, 1, i)); + } + } + + @Override + public String getUnlocalizedName(ItemStack stack) { + return this.getUnlocalizedName() + "_" + stack.getItemDamage(); + } + + @Override + public String getItemStackDisplayName(final ItemStack tItem) { + String itemName = "Dehydrator Coil"; + String suffixName = ""; + if (tItem.getItemDamage() == 0){ + suffixName = " [EV]"; + } + else if (tItem.getItemDamage() == 1){ + suffixName = " [IV]"; + } + else if (tItem.getItemDamage() == 2){ + suffixName = " [LuV]"; + } + else if (tItem.getItemDamage() == 3){ + suffixName = " [ZPM]"; + } + return (itemName+suffixName); + + } + + @Override + public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) { + int meta = stack.getItemDamage(); + if (meta == 0){ + HEX_OxFFFFFF = Utils.rgbToHex(10,110,30); + } + else if (meta == 1){ + HEX_OxFFFFFF = Utils.rgbToHex(150,180,35); + } + else if (meta == 2){ + HEX_OxFFFFFF = Utils.rgbToHex(200,85,40); + } + else if (meta == 3){ + HEX_OxFFFFFF = Utils.rgbToHex(255,100,50); + } + return HEX_OxFFFFFF; + } + +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/item/general/chassis/itemDehydratorCoilWireMeta.java b/src/Java/gtPlusPlus/core/item/general/chassis/itemDehydratorCoilWireMeta.java new file mode 100644 index 0000000000..8a59421b56 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/general/chassis/itemDehydratorCoilWireMeta.java @@ -0,0 +1,76 @@ +package com.bedrockminer.tutorial.item; + +public class itemDehydratorCoilWire extends Item { + + public IIcon[] icon = new IIcon[1]; + + public itemDehydratorCoilWire() { + super(); + this.setHasSubtypes(true); + String unlocalizedName = "itemDehydratorCoilWire"; + this.setUnlocalizedName(unlocalizedName); + this.setCreativeTab(AddToCreativeTab.tabMisc); + GameRegistry.registerItem(this, unlocalizedName); + } + + @Override + public void registerIcons(IIconRegister reg) { + this.icons[0] = reg.registerIcon(CORE.MODID + ":" + "itemDehydratorCoilWire"); + } + + @Override + public IIcon getIconFromDamage(int meta) { + return this.icons[0]; + } + + @Override + public void getSubItems(Item item, CreativeTabs tab, List list) { + for (int i = 0; i < 4; i ++) { + list.add(new ItemStack(item, 1, i)); + } + } + + @Override + public String getUnlocalizedName(ItemStack stack) { + return this.getUnlocalizedName() + "_" + stack.getItemDamage(); + } + + @Override + public String getItemStackDisplayName(final ItemStack tItem) { + String itemName = "Coil Wire"; + String suffixName = ""; + if (tItem.getItemDamage() == 0){ + suffixName = " [EV]"; + } + else if (tItem.getItemDamage() == 1){ + suffixName = " [IV]"; + } + else if (tItem.getItemDamage() == 2){ + suffixName = " [LuV]"; + } + else if (tItem.getItemDamage() == 3){ + suffixName = " [ZPM]"; + } + return (itemName+suffixName); + + } + + @Override + public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) { + int meta = stack.getItemDamage(); + if (meta == 0){ + HEX_OxFFFFFF = Utils.rgbToHex(10,110,30); + } + else if (meta == 1){ + HEX_OxFFFFFF = Utils.rgbToHex(150,180,35); + } + else if (meta == 2){ + HEX_OxFFFFFF = Utils.rgbToHex(200,85,40); + } + else if (meta == 3){ + HEX_OxFFFFFF = Utils.rgbToHex(255,100,50); + } + return HEX_OxFFFFFF; + } + +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java b/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java index e19332e4a9..6c80dc4a1d 100644 --- a/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java +++ b/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java @@ -330,38 +330,58 @@ public class RecipeUtils { final Object InputItem7, final Object InputItem8, final Object InputItem9, final ItemStack OutputItem){ - if ((!(InputItem1 instanceof ItemStack) && !(InputItem1 instanceof String) && (InputItem1 != null)) || - (!(InputItem2 instanceof ItemStack) && !(InputItem2 instanceof String) && (InputItem2 != null)) || - (!(InputItem3 instanceof ItemStack) && !(InputItem3 instanceof String) && (InputItem3 != null)) || - (!(InputItem4 instanceof ItemStack) && !(InputItem4 instanceof String) && (InputItem4 != null)) || - (!(InputItem5 instanceof ItemStack) && !(InputItem5 instanceof String) && (InputItem5 != null)) || - (!(InputItem6 instanceof ItemStack) && !(InputItem6 instanceof String) && (InputItem6 != null)) || - (!(InputItem7 instanceof ItemStack) && !(InputItem7 instanceof String) && (InputItem7 != null)) || - (!(InputItem8 instanceof ItemStack) && !(InputItem8 instanceof String) && (InputItem8 != null)) || - (!(InputItem9 instanceof ItemStack) && !(InputItem9 instanceof String) && (InputItem9 != null))){ - Utils.LOG_INFO("One Input item was not an ItemStack of an OreDict String."); - return false; - } + Object[] o = { + InputItem1, InputItem2, InputItem3, + InputItem4, InputItem5, InputItem6, + InputItem7, InputItem8, InputItem9 + }; + + if (addShapedGregtechRecipe(o, OutputItem)){ + return true; + } + else { + return false; + } + } - if (GT_ModHandler.addCraftingRecipe(OutputItem, - GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | - GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[]{"ABC", "DEF", "GHI", - 'A', InputItem1, - 'B', InputItem2, - 'C', InputItem3, - 'D', InputItem4, - 'E', InputItem5, - 'F', InputItem6, - 'G', InputItem7, - 'H', InputItem8, - 'I', InputItem9})){ - Utils.LOG_INFO("Success! Added a recipe for "+OutputItem.getDisplayName()); - RegistrationHandler.recipesSuccess++; - return true; - } - return false; - } + public static boolean addShapedGregtechRecipe(final Object[] inputs, final ItemStack output){ + + if (inputs.length != 9){ + Utils.LOG_INFO("Input array for "+output.getDisplayName()+" does not equal 9."); + return false; + } + + for (int x=0;x<9;x++){ + if (inputs[x] == null){ + inputs[x] = " "; + } + if (!(inputs[x] instanceof ItemStack) || !(inputs[x] instanceof String)){ + Utils.LOG_INFO("Invalid Item inserted into inputArray. Item:"+output.getDisplayName()+" has a bad recipe. Please report to Alkalus."); + } + } + + if (GT_ModHandler.addCraftingRecipe(output, + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | + GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[]{"ABC", "DEF", "GHI", + 'A', inputs[0], + 'B', inputs[1], + 'C', inputs[2], + 'D', inputs[3], + 'E', inputs[4], + 'F', inputs[5], + 'G', inputs[6], + 'H', inputs[7], + 'I', inputs[8]})){ + Utils.LOG_INFO("Success! Added a recipe for "+output.getDisplayName()); + RegistrationHandler.recipesSuccess++; + return true; + } + else { + Utils.LOG_INFO("Failed to add recipe for "+output.getDisplayName()+". Please report to Alkalus."); + return false; + } + } public static void addShapelessGregtechRecipe(final ItemStack OutputItem, final Object... inputItems){ diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index bfff2b2ff7..1e5305a683 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -159,7 +159,10 @@ public enum GregtechItemList implements GregtechItemContainer { //Tree Farm Industrial_TreeFarm, TreeFarmer_Structural, - Industrial_Sifter + Industrial_Sifter, + + //Advanced Boilers + Boiler_Advanced_LV, Boiler_Advanced_MV, Boiler_Advanced_HV ; public static final GregtechItemList[] diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java new file mode 100644 index 0000000000..ad354262d9 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java @@ -0,0 +1,215 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.generators; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.common.GT_Pollution; +import gregtech.common.gui.GT_Container_Boiler; +import gregtech.common.gui.GT_GUIContainer_Boiler; +import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.ChunkPosition; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + +public class GT_MetaTileEntity_Boiler_Base + extends GT_MetaTileEntity_Boiler { + + private int mSteamPerSecond = 0; + private int mPollutionPerSecond = 20; + private int mBoilerTier = 0; + + public GT_MetaTileEntity_Boiler_Base(int aID, String aNameRegional, int aBoilerTier) { + super(aID, "electricboiler."+aBoilerTier+".tier.single", aNameRegional, new String[]{ + "Steam Power! Hi-Ho!", + "Produces "+(750+(250*aBoilerTier))+"L of Steam per second", + "Causes "+(20*aBoilerTier)+" Pollution per second"}); + mSteamPerSecond = (750+(250*aBoilerTier)); + mPollutionPerSecond = 20+(15*aBoilerTier); + mBoilerTier = aBoilerTier; + } + + public GT_MetaTileEntity_Boiler_Base(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + public GT_MetaTileEntity_Boiler_Base(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[5][17][]; + for (byte i = -1; i < 16; i = (byte) (i + 1)) { + ITexture[] tmp0 = {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)]}; + rTextures[0][(i + 1)] = tmp0; + ITexture[] tmp1 = {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; + rTextures[1][(i + 1)] = tmp1; + ITexture[] tmp2 = {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; + rTextures[2][(i + 1)] = tmp2; + ITexture[] tmp4 = {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)], new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)}; + rTextures[3][(i + 1)] = tmp4; + ITexture[] tmp5 = {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(i + 1)], new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE)}; + rTextures[4][(i + 1)] = tmp5; + } + return rTextures; + } + + //Please find out what I do. + //I do stuff within the GUI. + //this.mTemperature = Math.min(54, Math.max(0, this.mTemperature * 54 / (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10))); + @Override + public int maxProgresstime() { + return 1000+(250*mBoilerTier); + } + + //Electric boiler? Okay. + @Override + public boolean isElectric(){ + return true; + } + + //Hold more Steam + @Override + public int getCapacity() { + return (16000+(16000*mBoilerTier)); + } + + //We want automation. + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return true; + } + + //We want automation. + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return true; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, getCapacity()); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "AdvancedBoiler.png", getCapacity()); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Boiler_Base(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) { + if (this.mTemperature <= 20) { + this.mTemperature = 20; + this.mLossTimer = 0; + } + if (++this.mLossTimer > 40) { + this.mTemperature -= 1; + this.mLossTimer = 0; + } + for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte) (i + 1)) { + if (i != aBaseMetaTileEntity.getFrontFacing()) { + IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); + if (tTileEntity != null) { + FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); + if (tDrained != null) { + int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); + if (tFilledAmount > 0) { + tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); + } + } + } + } + } + if (aTick % 10L == 0L) { + if (this.mTemperature > 100) { + if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) { + this.mHadNoWater = true; + } else { + if (this.mHadNoWater) { + aBaseMetaTileEntity.doExplosion(4096L); + return; + } + this.mFluid.amount -= 1; + if (this.mSteam == null) { + this.mSteam = GT_ModHandler.getSteam((this.mSteamPerSecond/2)); + } else if (GT_ModHandler.isSteam(this.mSteam)) { + this.mSteam.amount += (this.mSteamPerSecond/2); + } else { + this.mSteam = GT_ModHandler.getSteam((this.mSteamPerSecond/2)); + } + } + } else { + this.mHadNoWater = false; + } + } + if ((this.mSteam != null) && + (this.mSteam.amount > (getCapacity()*2))) { + sendSound((byte) 1); + this.mSteam.amount = (getCapacity()+(getCapacity()/2)); + } + ItemStack fuelSlot = this.mInventory[2]; + if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && + (fuelSlot != null)) { + + if (isInputFuelItem(fuelSlot)){ + useInputFuelItem(fuelSlot); + } + + + if ((this.mTemperature < maxProgresstime()) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) { + this.mProcessingEnergy -= 2; + this.mTemperature += 1; + } + if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { + GT_Pollution.addPollution(getBaseMetaTileEntity(), this.mPollutionPerSecond); + } + aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); + } + } + + public boolean isInputFuelItem(ItemStack inputItem){ + private int vCurrentBurnTime = 0; + vCurrentBurnTime = net.minecraftforge.event.ForgeEventFactory.getFuelBurnTime(inputItem); + if (vCurrentBurnTime > 0){ + return true; + } + return false; + } + + public boolean useInputFuelItem(ItemStack inputItem){ + private int vCurrentBurnTime = 0; + vCurrentBurnTime = net.minecraftforge.event.ForgeEventFactory.getFuelBurnTime(inputItem); + if (vCurrentBurnTime > 0){ + this.mProcessingEnergy += (vCurrentBurnTime/10); + aBaseMetaTileEntity.decrStackSize(2, 1); + if (aBaseMetaTileEntity.getRandomNumber(3) == 0) { + if (inputItem.getDisplayName().toLowercase().contains("charcoal") || inputItem.getDisplayName().toLowercase().contains("coke")){ + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); + } + else { + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); + } + } + return true; + } + else { + return false; + } + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java new file mode 100644 index 0000000000..d1110933df --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java @@ -0,0 +1,18 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.generators; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; + +public class GT_MetaTileEntity_Boiler_HV + extends GT_MetaTileEntity_Boiler_Base { + + public GT_MetaTileEntity_Boiler_HV(int aID, String aNameRegional, int aBoilerTier) { + super(aID, aNameRegional, aBoilerTier); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Boiler_HV(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java new file mode 100644 index 0000000000..53fca1cbee --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java @@ -0,0 +1,50 @@ +package gregtech.common.tileentities.boilers; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.common.GT_Pollution; +import gregtech.common.gui.GT_Container_Boiler; +import gregtech.common.gui.GT_GUIContainer_Boiler; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.world.ChunkPosition; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + +public class GT_MetaTileEntity_Boiler_LV + extends GT_MetaTileEntity_Boiler_Base { + + public GT_MetaTileEntity_Boiler_LV(int aID, String aNameRegional, int aBoilerTier) { + super(aID, aNameRegional, aBoilerTier); + } + + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[5][17][]; + for (byte i = -1; i < 16; i = (byte) (i + 1)) { + ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + rTextures[0][(i + 1)] = tmp0; + ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; + rTextures[1][(i + 1)] = tmp1; + ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; + rTextures[2][(i + 1)] = tmp2; + ITexture[] tmp4 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)}; + rTextures[3][(i + 1)] = tmp4; + ITexture[] tmp5 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE)}; + rTextures[4][(i + 1)] = tmp5; + } + return rTextures; + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Boiler_LV(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java new file mode 100644 index 0000000000..295840789c --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java @@ -0,0 +1,33 @@ +package gregtech.common.tileentities.boilers; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.common.GT_Pollution; +import gregtech.common.gui.GT_Container_Boiler; +import gregtech.common.gui.GT_GUIContainer_Boiler; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.world.ChunkPosition; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + +public class GT_MetaTileEntity_Boiler_MV + extends GT_MetaTileEntity_Boiler_Base { + + public GT_MetaTileEntity_Boiler_MV(int aID, String aNameRegional, int aBoilerTier) { + super(aID, aNameRegional, aBoilerTier); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Boiler_MV(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedBoilers.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedBoilers.java new file mode 100644 index 0000000000..7636fc366b --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedBoilers.java @@ -0,0 +1,103 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gregtech.api.enums.*; +import gregtech.api.util.GT_ModHandler; +import gregtech.common.tileentities.boilers.*; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.material.ALLOY; +import gtPlusPlus.core.recipe.RECIPE_CONSTANTS; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import net.minecraft.item.ItemStack; + +public class GregtechAdvancedBoilers { + + public static void run() { + if (LoadedMods.Gregtech){ + Utils.LOG_INFO("Gregtech5u Content | Registering Electric Boilers."); + run1(); + } + } + + private static void run1(){ + //Boilers + GregtechItemList.Boiler_Advanced_LV.set(new GT_MetaTileEntity_Boiler_LV(601, "Advanced Boiler [LV]", 1).getStackForm(1L)); + GregtechItemList.Boiler_Advanced_MV.set(new GT_MetaTileEntity_Boiler_MV(602, "Advanced Boiler [MV]", 2).getStackForm(1L)); + GregtechItemList.Boiler_Advanced_HV.set(new GT_MetaTileEntity_Boiler_HV(603, "Advanced Boiler [HV]", 3).getStackForm(1L)); + + + ItemStack chassisT1; + ItemStack chassisT2; + ItemStack chassisT3; + + + //Make the Coil in each following recipe a hammer and a Screwdriver. + + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Boiler_Advanced_LV.get(1L, new Object[0]), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[]{"ECE", "WMW", "GPG", + Character.valueOf('M'), ItemList.Hull_LV, + Character.valueOf('P'), ItemList.Robot_Arm_EV, //TODO + Character.valueOf('E'), coilT1, //TODO + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic), + Character.valueOf('W'), chassisT1, + Character.valueOf('G'), OrePrefixes.gear.get(Materials.Steel)}); + + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Boiler_Advanced_MV.get(1L, new Object[0]), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[]{"ECE", "WMW", "GPG", + Character.valueOf('M'), ItemList.Hull_MV, + Character.valueOf('P'), ItemList.Robot_Arm_IV, //TODO + Character.valueOf('E'), coilT2, //TODO + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good), + Character.valueOf('W'), chassisT2, + Character.valueOf('G'), ALLOY.SILICON_CARBIDE.getGear(1)}); + + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Boiler_Advanced_HV.get(1L, new Object[0]), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[]{"ECE", "WMW", "GPG", + Character.valueOf('M'), ItemList.Hull_HV, + Character.valueOf('P'), RECIPE_CONSTANTS.robotArm_LuV, //TODO + Character.valueOf('E'), coilT3, //TODO + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced), + Character.valueOf('W'), chassisT3, + Character.valueOf('G'), ALLOY.SILICON_CARBIDE.getGear(1)}); + + + GT_ModHandler.addCraftingRecipe( + chassisT1, + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[]{"WCW", "GMG", "WPW", + Character.valueOf('M'), ItemList.Hull_ULV, + Character.valueOf('P'), OrePrefixes.pipeLarge.get(Materials.Bronze), + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Primitive), + Character.valueOf('W'), OrePrefixes.plate.get(Materials.Lead), + Character.valueOf('G'), OrePrefixes.pipeSmall.get(Materials.Copper)}); + + GT_ModHandler.addCraftingRecipe( + chassisT2, + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[]{"WCW", "GMG", "WPW", + Character.valueOf('M'), ItemList.Hull_LV, + Character.valueOf('P'), OrePrefixes.pipeLarge.get(Materials.Steel), + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic), + Character.valueOf('W'), OrePrefixes.plate.get(Materials.Steel), + Character.valueOf('G'), OrePrefixes.pipeSmall.get(Materials.Bronze)}); + + GT_ModHandler.addCraftingRecipe( + chassisT3, + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[]{"WCW", "GMG", "WPW", + Character.valueOf('M'), ItemList.Hull_MV, + Character.valueOf('P'), OrePrefixes.pipeLarge.get(Materials.StainlessSteel), + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good), + Character.valueOf('W'), OrePrefixes.plate.get(Materials.Aluminium), + Character.valueOf('G'), OrePrefixes.pipeSmall.get(Materials.Steel)}); + + + + }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java index 0c14ca2eaf..038d367afd 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java @@ -1,11 +1,16 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; +import gregtech.api.enums.*; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe; +import gregtech.api.util.GT_ModHandler; import gregtech.api.util.Recipe_GT; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.material.ALLOY; +import gtPlusPlus.core.recipe.RECIPE_CONSTANTS; import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import net.minecraft.item.ItemStack; public class GregtechDehydrator { @@ -95,7 +100,54 @@ public class GregtechDehydrator //GregtechItemList..set(new GregtechMetaTileEntitySolarGenerator(816, "dehydrator.tier.04", "ZPM Voltage Chemical Dehydrator", 7).getStackForm(1L)); + ItemStack coilT1 = null; + ItemStack coilT2 = null; + ItemStack coilT3 = null; + ItemStack coilT4 = null; + GT_ModHandler.addCraftingRecipe( + GregtechItemList.GT_Dehydrator_EV.get(1L, new Object[0]), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[]{"ECE", "WMW", "GPG", + Character.valueOf('M'), ItemList.Hull_EV, + Character.valueOf('P'), ItemList.Robot_Arm_EV, + Character.valueOf('E'), coilT1, + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced), + Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Aluminium), + Character.valueOf('G'), ALLOY.TUMBAGA.getGear(1)}); + + GT_ModHandler.addCraftingRecipe( + GregtechItemList.GT_Dehydrator_IV.get(1L, new Object[0]), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[]{"ECE", "WMW", "GPG", + Character.valueOf('M'), ItemList.Hull_IV, + Character.valueOf('P'), ItemList.Robot_Arm_IV, + Character.valueOf('E'), coilT2, + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Elite), + Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Tungsten), + Character.valueOf('G'), ALLOY.INCONEL_690.getGear(1)}); + + GT_ModHandler.addCraftingRecipe( + GregtechItemList.GT_Dehydrator_LuV.get(1L, new Object[0]), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[]{"ECE", "WMW", "GPG", + Character.valueOf('M'), ItemList.Hull_LuV, + Character.valueOf('P'), RECIPE_CONSTANTS.robotArm_LuV, + Character.valueOf('E'), coilT3, + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Master), + Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Naquadah), + Character.valueOf('G'), ALLOY.HASTELLOY_N.getGear(1)}); + + GT_ModHandler.addCraftingRecipe( + GregtechItemList.GT_Dehydrator_ZPM.get(1L, new Object[0]), + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[]{"ECE", "WMW", "GPG", + Character.valueOf('M'), ItemList.Hull_ZPM, + Character.valueOf('P'), RECIPE_CONSTANTS.robotArm_ZPM, + Character.valueOf('E'), coilT4, + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Ultimate), + Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Osmium), + Character.valueOf('G'), ALLOY.ZERON_100.getGear(1)}); } } |