GT 5.08.24

This commit is contained in:
Blood-Asp 2015-07-12 12:45:19 +02:00
parent 070f7c32ca
commit eac14b4b28
6 changed files with 95 additions and 18 deletions

View file

@ -90,13 +90,13 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
((IEnergySource)tTileEntity).drawEnergy(tEU);
aBaseMetaTileEntity.injectEnergyUnits((byte)6, tEU, 1);
}else if (GregTech_API.mInputRF && tTileEntity instanceof IEnergyProvider&& ((IEnergyProvider)tTileEntity).extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)),1,true)==1) {
long tEU = Math.min(maxEUInput(), (long)((IEnergyProvider)tTileEntity).extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)),(int) maxEUInput()* 100 / GregTech_API.mRFtoEU ,false));
long tEU = (long)((IEnergyProvider)tTileEntity).extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(i)),(int) maxEUInput()* 100 / GregTech_API.mRFtoEU ,false);
tEU = tEU * GregTech_API.mRFtoEU / 100;
aBaseMetaTileEntity.injectEnergyUnits((byte)6, tEU, 1);
aBaseMetaTileEntity.injectEnergyUnits((byte)6, Math.min(tEU,maxEUInput()), 1);
}else if (GregTech_API.mInputRF && tTileEntity instanceof IEnergyStorage&& ((IEnergyStorage)tTileEntity).extractEnergy(1,true)==1) {
long tEU = Math.min(maxEUInput(), (long)((IEnergyStorage)tTileEntity).extractEnergy((int) maxEUInput()* 100 / GregTech_API.mRFtoEU ,false));
long tEU = (long)((IEnergyStorage)tTileEntity).extractEnergy((int) maxEUInput()* 100 / GregTech_API.mRFtoEU ,false);
tEU = tEU * GregTech_API.mRFtoEU / 100;
aBaseMetaTileEntity.injectEnergyUnits((byte)6, tEU, 1);
aBaseMetaTileEntity.injectEnergyUnits((byte)6, Math.min(tEU,maxEUInput()), 1);
}else if (GregTech_API.mInputRF && GregTech_API.meIOLoaded && tTileEntity instanceof IPowerContainer && ((IPowerContainer)tTileEntity).getEnergyStored()>0) {
int storedRF = ((IPowerContainer)tTileEntity).getEnergyStored();
int extractRF = (int) maxEUInput()* 100 / GregTech_API.mRFtoEU;
@ -116,7 +116,7 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
tEU = storedRF * GregTech_API.mRFtoEU / 100 ;
}
}
aBaseMetaTileEntity.injectEnergyUnits((byte)6, tEU, 1);
aBaseMetaTileEntity.injectEnergyUnits((byte)6, Math.min(tEU,maxEUInput()), 1);
}
}
}

View file

@ -1825,6 +1825,9 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
}else if(tOre.mModID!=null&&tOre.mModID.toLowerCase().equals("appliedenergistics2")&&tOre.mPrefix==OrePrefixes.gem&&tOre.mMaterial==Materials.CertusQuartz){
GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
GT_OreDictUnificator.set(tOre.mPrefix,tOre.mMaterial,tOre.mEvent.Ore,(tOre.mModID != null) && (GregTech_API.sUnification.get(ConfigCategories.specialunificationtargets + "." + tOre.mModID, tOre.mEvent.Name, true)), true);
}else if(tOre.mModID!=null&&tOre.mModID.toLowerCase().equals("appliedenergistics2")&&tOre.mPrefix==OrePrefixes.gem&&tOre.mMaterial==Materials.ChargedCertusQuartz){
GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
GT_OreDictUnificator.set(tOre.mPrefix,tOre.mMaterial,tOre.mEvent.Ore,(tOre.mModID != null) && (GregTech_API.sUnification.get(ConfigCategories.specialunificationtargets + "." + tOre.mModID, tOre.mEvent.Name, true)), true);
}else if(tOre.mModID!=null&&tOre.mModID.toLowerCase().equals("appliedenergistics2")&&tOre.mPrefix==OrePrefixes.dust&&tOre.mMaterial==Materials.CertusQuartz){
GT_OreDictUnificator.addAssociation(tOre.mPrefix, tOre.mMaterial, tOre.mEvent.Ore, false);
GT_OreDictUnificator.set(tOre.mPrefix,tOre.mMaterial,tOre.mEvent.Ore,(tOre.mModID != null) && (GregTech_API.sUnification.get(ConfigCategories.specialunificationtargets + "." + tOre.mModID, tOre.mEvent.Name, true)), true);

View file

@ -1,9 +1,18 @@
package gregtech.common.covers;
import ic2.api.item.IElectricItem;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.items.GT_MetaBase_Item;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicBatteryBuffer;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import gregtech.api.util.GT_BaseCrop;
import gregtech.api.util.GT_CoverBehavior;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
public class GT_Cover_EUMeter
@ -57,12 +66,46 @@ public class GT_Cover_EUMeter
aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable % 2 == 0 ? 0 : 15));
}
}
else if (aCoverVariable < 12)
{
tScale = aTileEntity.getEUCapacity();
long tStored = aTileEntity.getStoredEU();
if(aTileEntity instanceof IGregTechTileEntity){
IGregTechTileEntity tTileEntity = (IGregTechTileEntity) aTileEntity;
IMetaTileEntity mTileEntity = tTileEntity.getMetaTileEntity();
if(mTileEntity instanceof GT_MetaTileEntity_BasicBatteryBuffer){
GT_MetaTileEntity_BasicBatteryBuffer buffer = (GT_MetaTileEntity_BasicBatteryBuffer) mTileEntity;
if(buffer.mInventory!=null){
for(ItemStack aStack : buffer.mInventory){
if (GT_ModHandler.isElectricItem(aStack)) {
if(aStack.getItem() instanceof GT_MetaBase_Item){
Long[] stats = ((GT_MetaBase_Item)aStack.getItem()).getElectricStats(aStack);
if(stats!=null){
tScale = tScale + stats[0];
tStored = tStored + ((GT_MetaBase_Item)aStack.getItem()).getRealCharge(aStack);
}
}else if(aStack.getItem() instanceof IElectricItem){
tStored = tStored + (long)ic2.api.item.ElectricItem.manager.getCharge(aStack);
tScale = tScale + (long)((IElectricItem)aStack.getItem()).getMaxCharge(aStack);
}
}
}
}}}
tScale = tScale/15L;
if (tScale > 0L) {
aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable % 2 == 0 ? (byte)(int)(tStored / tScale) : (byte)(int)(15L - tStored / tScale));
} else {
aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable % 2 == 0 ? 0 : 15));
}
}
return aCoverVariable;
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ)
{
aCoverVariable = (aCoverVariable + 1) % 10;
aCoverVariable = (aCoverVariable + 1) % 12;
if (aCoverVariable == 0) {
GT_Utility.sendChatToPlayer(aPlayer, "Normal Universal Storage");
}
@ -93,6 +136,12 @@ public class GT_Cover_EUMeter
if (aCoverVariable == 9) {
GT_Utility.sendChatToPlayer(aPlayer, "Inverted Average Electric Output");
}
if (aCoverVariable == 10) {
GT_Utility.sendChatToPlayer(aPlayer, "Normal Electricity Storage(Including Batterys)");
}
if (aCoverVariable == 11) {
GT_Utility.sendChatToPlayer(aPlayer, "Inverted Electricity Storage(Including Batterys)");
}
return aCoverVariable;
}
@ -133,7 +182,7 @@ public class GT_Cover_EUMeter
public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
{
return 5;
return 20;
}
}

View file

@ -404,6 +404,11 @@ public boolean onRunningTick(ItemStack aStack) {
return false;
}
}
if(this.mEUStore<=0){
this.mLastRecipe=null;
stopMachine();
return false;
}
return true;
}

View file

@ -2,6 +2,9 @@ package gregtech.common.tileentities.machines.multi;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@ -101,6 +104,12 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl
return GT_Recipe.GT_Recipe_Map.sHammerRecipes;
}else if(tmp.startsWith("sifter")){
return GT_Recipe.GT_Recipe_Map.sSifterRecipes;
}else if(tmp.startsWith("extruder")){
return GT_Recipe.GT_Recipe_Map.sExtruderRecipes;
}else if(tmp.startsWith("laserengraver")){
return GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes;
}else if(tmp.startsWith("bender")){
return GT_Recipe.GT_Recipe_Map.sBenderRecipes;
}
return null;
}
@ -176,13 +185,6 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl
for(;i<machines;i++){
if(!tRecipe.isRecipeInputEqual(true, tFluids, tInputs))break;
}
// System.out.println("recipe:"+i+" "+tRecipe.mDuration+" "+tRecipe.mEUt);
// if(tRecipe.mOutputs.length>0){
// System.out.println(tRecipe.mOutputs[0].getUnlocalizedName());
// }
// if(tRecipe.mFluidOutputs.length>0){
// System.out.println(tRecipe.mFluidOutputs[0].getUnlocalizedName());
// }
if (tRecipe.mEUt <= 16)
{
this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
@ -220,9 +222,24 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl
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);
}
this.mOutputItems = tOut;
this.mOutputFluids = new FluidStack[]{tFOut};
// System.out.println("ArrayOut"+mOutputItems.length+" "+mOutputFluids.length+" "+(mOutputItems.length>0?mOutputItems[0].getUnlocalizedName():"")+" "+(mOutputFluids.length>0?mOutputFluids[0].getUnlocalizedName():" "));
updateSlots();
return true;
}

View file

@ -618,6 +618,9 @@ public class GT_MachineRecipeLoader
GT_ModHandler.addCompressionRecipe(new ItemStack(Blocks.ice, 2, 32767), new ItemStack(Blocks.packed_ice, 1, 0));
GT_ModHandler.addCompressionRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ice, 1L), new ItemStack(Blocks.ice, 1, 0));
GT_ModHandler.addCompressionRecipe(GT_OreDictUnificator.get(OrePrefixes.gem, Materials.CertusQuartz, 4L), GT_ModHandler.getModItem("appliedenergistics2", "tile.BlockQuartz", 1L));
GT_ModHandler.addCompressionRecipe(GT_ModHandler.getModItem("appliedenergistics2", "item.ItemMultiMaterial", 8L, 10), GT_ModHandler.getModItem("appliedenergistics2", "tile.BlockQuartz", 1L));
GT_ModHandler.addCompressionRecipe(GT_ModHandler.getModItem("appliedenergistics2", "item.ItemMultiMaterial", 8L, 11), new ItemStack(Blocks.quartz_block, 1, 0));
GT_ModHandler.addCompressionRecipe(GT_ModHandler.getModItem("appliedenergistics2", "item.ItemMultiMaterial", 8L, 12), GT_ModHandler.getModItem("appliedenergistics2", "tile.BlockFluix", 1L));
GT_ModHandler.addCompressionRecipe(new ItemStack(Items.quartz, 4, 0), new ItemStack(Blocks.quartz_block, 1, 0));
GT_ModHandler.addCompressionRecipe(new ItemStack(Items.wheat, 9, 0), new ItemStack(Blocks.hay_block, 1, 0));
GT_ModHandler.addCompressionRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 4L), new ItemStack(Blocks.glowstone, 1));
@ -920,7 +923,7 @@ public class GT_MachineRecipeLoader
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.AnnealedCopper, 2L), ItemList.Casing_MV.get(1L, new Object[0]), ItemList.Hull_MV.get(1L, new Object[0]), 50, 16);
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Gold, 2L), ItemList.Casing_HV.get(1L, new Object[0]), ItemList.Hull_HV.get(1L, new Object[0]), 50, 16);
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Aluminium, 2L), ItemList.Casing_EV.get(1L, new Object[0]), ItemList.Hull_EV.get(1L, new Object[0]), 50, 16);
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Steel, 2L), ItemList.Casing_IV.get(1L, new Object[0]), ItemList.Hull_IV.get(1L, new Object[0]), 50, 16);
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt02, Materials.Tungsten, 2L), ItemList.Casing_IV.get(1L, new Object[0]), ItemList.Hull_IV.get(1L, new Object[0]), 50, 16);
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Tungsten, 2L), ItemList.Casing_LuV.get(1L, new Object[0]), ItemList.Hull_LuV.get(1L, new Object[0]), 50, 16);
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Osmium, 2L), ItemList.Casing_ZPM.get(1L, new Object[0]), ItemList.Hull_ZPM.get(1L, new Object[0]), 50, 16);
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Osmium, 2L), ItemList.Casing_UV.get(1L, new Object[0]), ItemList.Hull_UV.get(1L, new Object[0]), 50, 16);
@ -1156,11 +1159,11 @@ public class GT_MachineRecipeLoader
tKey = "GT_TRANSSOLDERINGALLOY";
GT_LanguageManager.addStringLocalization("gt.research.page.1." + tKey, "Your discovery of Bronze Transmutation has lead you to the conclusion it works with other Alloys such as Soldering Alloy as well.");
GregTech_API.sThaumcraftCompat.addResearch(tKey, "Soldering Alloy Transmutation", "Transformation of metals into soldering alloy", new String[] { "GT_TRANSBRONZE", "GT_TRANSANTIMONY" }, "ALCHEMY", GT_OreDictUnificator.get(OrePrefixes.nugget, Materials.SolderingAlloy, 1L), 2, 1, 11, 14, Arrays.asList(new TC_Aspects.TC_AspectStack[] { new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 5L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 3L) }), null, new Object[] { "gt.research.page.1." + tKey, GregTech_API.sThaumcraftCompat.addCrucibleRecipe(tKey, OrePrefixes.nugget.get(Materials.SolderingAlloy), GT_OreDictUnificator.get(OrePrefixes.nugget, Materials.SolderingAlloy, 3L), Arrays.asList(new TC_Aspects.TC_AspectStack[] { new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L) })) });
GregTech_API.sThaumcraftCompat.addResearch(tKey, "Soldering Alloy Transmutation", "Transformation of metals into soldering alloy", new String[] { "GT_TRANSBRONZE", "GT_TRANSANTIMONY" }, "ALCHEMY", GT_OreDictUnificator.get(OrePrefixes.nugget, Materials.SolderingAlloy, 1L), 2, 1, 11, 14, Arrays.asList(new TC_Aspects.TC_AspectStack[] { new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 5L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 3L) }), null, new Object[] { "gt.research.page.1." + tKey, GregTech_API.sThaumcraftCompat.addCrucibleRecipe(tKey, OrePrefixes.nugget.get(Materials.SolderingAlloy), GT_OreDictUnificator.get(OrePrefixes.nugget, Materials.SolderingAlloy, 3L), Arrays.asList(new TC_Aspects.TC_AspectStack[] { new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L) })) });
tKey = "GT_ADVANCEDMETALLURGY";
GT_LanguageManager.addStringLocalization("gt.research.page.1." + tKey, "Now that you have discovered all the basic metals, you can finally move on to the next Level of magic metallurgy and create more advanced metals");
GregTech_API.sThaumcraftCompat.addResearch(tKey, "Advanced Metallurgic Transmutation", "Mastering the basic metals", new String[] { "GT_TRANSBISMUTH", "GT_IRON_TO_STEEL", "GT_TRANSSOLDERINGALLOY", "GT_TRANSBATTERYALLOY", "GT_TRANSBRASS", "GT_TRANSELECTRUM", "GT_TRANSCUPRONICKEL", "GT_TRANSINVAR" }, "ALCHEMY", GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Iron, 1L), 4, 4, 16, 14, Arrays.asList(new TC_Aspects.TC_AspectStack[] { new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 50L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 20L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITO, 20L), new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTIO, 20L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 20L), new TC_Aspects.TC_AspectStack(TC_Aspects.MAGNETO, 20L) }), null, new Object[] { "gt.research.page.1." + tKey });
GregTech_API.sThaumcraftCompat.addResearch(tKey, "Advanced Metallurgic Transmutation", "Mastering the basic metals", new String[] { "GT_TRANSBISMUTH", "GT_IRON_TO_STEEL", "GT_TRANSSOLDERINGALLOY", "GT_TRANSBATTERYALLOY", "GT_TRANSBRASS", "GT_TRANSELECTRUM", "GT_TRANSCUPRONICKEL", "GT_TRANSINVAR" }, "ALCHEMY", GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Iron, 1L), 3, 0, 16, 14, Arrays.asList(new TC_Aspects.TC_AspectStack[] { new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 50L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 20L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITO, 20L), new TC_Aspects.TC_AspectStack(TC_Aspects.PRAECANTIO, 20L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 20L), new TC_Aspects.TC_AspectStack(TC_Aspects.MAGNETO, 20L) }), null, new Object[] { "gt.research.page.1." + tKey });
tKey = "GT_TRANSALUMINIUM";
GT_LanguageManager.addStringLocalization("gt.research.page.1." + tKey, "You have discovered a way to multiply aluminium by steeping aluminium nuggets in metallum harvested from other metals.<BR><BR>This transmutation is slightly harder to achieve, because aluminium has special properties, which require more order to achieve the desired result.");