diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-07-27 00:26:22 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-07-27 00:26:22 +1000 |
commit | 926af00c0b3da2ba168f578eafb3ed8c7c2d9dba (patch) | |
tree | dc1a749573a9a9cc624671e9c63b785aae4fac40 /src/Java/miscutil/core/xmod/gregtech | |
parent | 28c115270dc90e6b7358cc45b77242ce9cdc0372 (diff) | |
download | GT5-Unofficial-926af00c0b3da2ba168f578eafb3ed8c7c2d9dba.tar.gz GT5-Unofficial-926af00c0b3da2ba168f578eafb3ed8c7c2d9dba.tar.bz2 GT5-Unofficial-926af00c0b3da2ba168f578eafb3ed8c7c2d9dba.zip |
+ Added a Plate Bender Recipe for Staballoy.
+ Added a Blast Furnace Recipe for Staballoy.
+ Added a Vacuum Freezer Recipe for Staballoy.
+ Added Some Raisin Bread for ImQ009.
+ Added a placeholder item for invalid recipes, so that broken recipes show up and hidden/unavailable stuff doesn't.
+ Added a handler for generating ingots & Hot ingots.
% Changed Staballoy to generate from this new ingotHandler.
% Changed getItemStackOfAmountFromOreDict to handle meta, thanks to Greg for pointing that out.
% Changed Matter Fabricator to actually have an output (It was returning 0 previously, thought worked)
- Removed pollution value from the Matter Fabricator.
Diffstat (limited to 'src/Java/miscutil/core/xmod/gregtech')
3 files changed, 137 insertions, 12 deletions
diff --git a/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index acb317401d..f483cc02f4 100644 --- a/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/Java/miscutil/core/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -116,8 +116,8 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { } GregtechItemList.Circuit_IV.set(addItem(tLastID = 704, "Symbiotic Circuit (IV)", "A Symbiotic Data Processor", new Object[]{GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic)})); - GregtechItemList.Circuit_LuV.set(addItem(tLastID = 705, "Neutronic Circuit (LuV)", "A Neutron Particle Processor", new Object[]{OrePrefixes.circuit.get(GT_Materials.Neutronic)})); - GregtechItemList.Circuit_ZPM.set(addItem(tLastID = 706, "Quantum Circuit (ZPM)", "A Singlularity Processor", new Object[]{OrePrefixes.circuit.get(GT_Materials.Quantum)})); + GregtechItemList.Circuit_LuV.set(addItem(tLastID = 705, "Neutronic Circuit (LuV)", "A Neutron Particle Processor", new Object[]{GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic)})); + GregtechItemList.Circuit_ZPM.set(addItem(tLastID = 706, "Quantum Circuit (ZPM)", "A Singlularity Processor", new Object[]{GregtechOrePrefixes.circuit.get(GT_Materials.Quantum)})); GregtechItemList.Circuit_Board_IV.set(addItem(tLastID = 710, "IV Circuit Board", "An IV Voltage Rated Circuit Board", new Object[0])); GregtechItemList.Circuit_Board_LuV.set(addItem(tLastID = 711, "LuV Circuit Board", "An LuV Voltage Rated Circuit Board", new Object[0])); GregtechItemList.Circuit_Board_ZPM.set(addItem(tLastID = 712, "ZPM Processor Board", "A ZPM Voltage Rated Processor Board", new Object[0])); diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java index 177769092d..7e2c552eed 100644 --- a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java +++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java @@ -9,10 +9,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; import java.util.ArrayList; -import java.util.Arrays; +import java.util.List; import miscutil.core.block.ModBlocks; import miscutil.core.lib.CORE; @@ -27,6 +26,8 @@ import net.minecraft.server.MinecraftServer; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.ArrayUtils; + public class GregtechMetaTileEntityIndustrialCentrifuge extends GregtechMeta_MultiBlockBase { private static boolean controller; @@ -76,14 +77,14 @@ extends GregtechMeta_MultiBlockBase { "Centrifuge Casings for the rest (16 at least)",}; } - + @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? aActive ? frontFaceActive : frontFace : Textures.BlockIcons.CASING_BLOCKS[57]}; } - - + + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "IndustrialCentrifuge.png"); @@ -104,6 +105,130 @@ extends GregtechMeta_MultiBlockBase { @Override public boolean checkRecipe(ItemStack aStack) { + /*if (!isCorrectMachinePart(mInventory[1])) { + return false; + }*/ + GT_Recipe.GT_Recipe_Map map = getRecipeMap(); + if (map == null) { + return false; + } + ArrayList<ItemStack> tInputList = getStoredInputs(); + int tTier = 0; + if (mInventory[1].getUnlocalizedName().endsWith("1")) { + tTier = 1; + } + if (mInventory[1].getUnlocalizedName().endsWith("2")) { + tTier = 2; + } + if (mInventory[1].getUnlocalizedName().endsWith("3")) { + tTier = 3; + } + if (mInventory[1].getUnlocalizedName().endsWith("4")) { + tTier = 4; + } + if (mInventory[1].getUnlocalizedName().endsWith("5")) { + tTier = 5; + } + if (mInventory[1].getUnlocalizedName().endsWith("6")) { + tTier = 6; + } + if (mInventory[1].getUnlocalizedName().endsWith("7")) { + tTier = 7; + } + if (mInventory[1].getUnlocalizedName().endsWith("8")) { + tTier = 8; + } + ItemStack[] tInputs = (ItemStack[]) tInputList.toArray(new ItemStack[tInputList.size()]); + ArrayList<FluidStack> tFluidList = getStoredFluids(); + FluidStack[] tFluids = (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]); + if (tInputList.size() > 0 || tFluids.length > 0) { + GT_Recipe tRecipe = map.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + if (tRecipe != null) { + mLastRecipe = tRecipe; + this.mEUt = 0; + this.mOutputItems = null; + this.mOutputFluids = null; + int machines = Math.min(16, mInventory[1].stackSize); + int i = 0; + for (; i < machines; i++) { + if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) { + if (i == 0) { + return false; + } + break; + } + } + this.mMaxProgresstime = tRecipe.mDuration; + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + if (tRecipe.mEUt <= 16) { + this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1)); + } else { + this.mEUt = tRecipe.mEUt; + this.mMaxProgresstime = tRecipe.mDuration; + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + this.mEUt *= i; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + ItemStack[] tOut = new ItemStack[tRecipe.mOutputs.length]; + for (int h = 0; h < tRecipe.mOutputs.length; h++) { + tOut[h] = tRecipe.getOutput(h).copy(); + tOut[h].stackSize = 0; + } + FluidStack tFOut = null; + if (tRecipe.getFluidOutput(0) != null) tFOut = tRecipe.getFluidOutput(0).copy(); + for (int f = 0; f < tOut.length; f++) { + if (tRecipe.mOutputs[f] != null && tOut[f] != null) { + for (int g = 0; g < i; g++) { + if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f)) + tOut[f].stackSize += tRecipe.mOutputs[f].stackSize; + } + } + } + if (tFOut != null) { + int tSize = tFOut.amount; + tFOut.amount = tSize * i; + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + List<ItemStack> overStacks = new ArrayList<ItemStack>(); + for (int f = 0; f < tOut.length; f++) { + if (tOut[f].getMaxStackSize() < tOut[f].stackSize) { + while (tOut[f].getMaxStackSize() < tOut[f].stackSize) { + ItemStack tmp = tOut[f].copy(); + tmp.stackSize = tmp.getMaxStackSize(); + tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize(); + overStacks.add(tmp); + } + } + } + if (overStacks.size() > 0) { + ItemStack[] tmp = new ItemStack[overStacks.size()]; + tmp = overStacks.toArray(tmp); + tOut = ArrayUtils.addAll(tOut, tmp); + } + List<ItemStack> tSList = new ArrayList<ItemStack>(); + for (ItemStack tS : tOut) { + if (tS.stackSize > 0) tSList.add(tS); + } + tOut = tSList.toArray(new ItemStack[tSList.size()]); + this.mOutputItems = tOut; + this.mOutputFluids = new FluidStack[]{tFOut}; + updateSlots(); + Utils.LOG_WARNING("Centrifuge: True"); + return true; + } + } + Utils.LOG_WARNING("Centrifuge: False"); + return false; + } + + /*public boolean checkRecipe(ItemStack aStack) { ArrayList<ItemStack> tInputList = getStoredInputs(); Utils.LOG_WARNING("Stored Input Items: "+tInputList.size()); for (int i = 0; i < tInputList.size() - 1; i++) { @@ -170,7 +295,7 @@ extends GregtechMeta_MultiBlockBase { } Utils.LOG_WARNING("Centrifuge: False"); return false; - } + }*/ @SuppressWarnings("static-method") public Block getCasingBlock() { @@ -192,7 +317,7 @@ extends GregtechMeta_MultiBlockBase { if (CORE.disableCentrifugeFormation){ EntityPlayerMP player = MinecraftServer.getServer().getConfigurationManager().func_152612_a(this.getBaseMetaTileEntity().getOwnerName()); if (!player.getEntityWorld().isRemote && isDisabled == false) - Utils.messagePlayer(player, "This Multiblock is disabled via the config. [Only re-enable if you're bugtesting.]"); + Utils.messagePlayer(player, "This Multiblock is disabled via the config. [Only re-enable if you're bugtesting.]"); isDisabled = true; return false; } @@ -272,5 +397,5 @@ extends GregtechMeta_MultiBlockBase { public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } - + }
\ No newline at end of file diff --git a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java index 67b204c1a6..92d8d23372 100644 --- a/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java +++ b/src/Java/miscutil/core/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java @@ -276,7 +276,7 @@ public class GregtechMetaTileEntityMassFabricator extends GT_MetaTileEntity_Mult @Override public int getPollutionPerTick(ItemStack aStack) { - return 20; + return 0; } @Override @@ -286,7 +286,7 @@ public class GregtechMetaTileEntityMassFabricator extends GT_MetaTileEntity_Mult @Override public int getAmountOfOutputs() { - return 0; + return 1; } @Override |