diff options
| author | Techlone <techlone.mc@gmail.com> | 2017-06-01 00:01:54 +0500 | 
|---|---|---|
| committer | Techlone <techlone.mc@gmail.com> | 2017-06-01 00:01:54 +0500 | 
| commit | f19e920925aa5c85ec32e7e4b6e17588528eb3e3 (patch) | |
| tree | 6ae3805868bd5bd8c5af224f127f59bee9aaaa4f /src | |
| parent | 21f2b50507732f5a1c7eab00eff5d8efbd367aab (diff) | |
| parent | 5386a69022b360b5380f41c856116b11bc60db4e (diff) | |
| download | GT5-Unofficial-f19e920925aa5c85ec32e7e4b6e17588528eb3e3.tar.gz GT5-Unofficial-f19e920925aa5c85ec32e7e4b6e17588528eb3e3.tar.bz2 GT5-Unofficial-f19e920925aa5c85ec32e7e4b6e17588528eb3e3.zip | |
Merge branch 'unstable' of https://github.com/Blood-Asp/GT5-Unofficial into unstable
Diffstat (limited to 'src')
10 files changed, 27 insertions, 15 deletions
| diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 7b6c5bafd5..fd208d5dfb 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -258,6 +258,7 @@ public class GT_Mod implements IGT_Mod {          Calendar now = Calendar.getInstance();
          gregtechproxy.mAprilFool = GregTech_API.sSpecialFile.get(ConfigCategories.general, "AprilFool", now.get(Calendar.MONTH) == Calendar.APRIL && now.get(Calendar.DAY_OF_MONTH) == 1);
          gregtechproxy.mCropNeedBlock = tMainConfig.get("general", "CropNeedBlockBelow", true).getBoolean(true);
 +        gregtechproxy.mAMHInteraction = tMainConfig.get("general", "AllowAutoMaintenanceHatchInteraction", true).getBoolean(true);
          GregTech_API.mOutputRF = GregTech_API.sOPStuff.get(ConfigCategories.general, "OutputRF", true);
          GregTech_API.mInputRF = GregTech_API.sOPStuff.get(ConfigCategories.general, "InputRF", false);
          GregTech_API.mEUtoRF = GregTech_API.sOPStuff.get(ConfigCategories.general, "100EUtoRF", 360);
 diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java index 3bcd29a6c9..608bec114e 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java @@ -23,8 +23,8 @@ import net.minecraft.entity.player.EntityPlayerMP;  import net.minecraft.entity.player.InventoryPlayer;  import net.minecraft.item.ItemStack;  import net.minecraft.nbt.NBTTagCompound; -import scala.actors.threadpool.Arrays; +import java.util.Arrays;  import java.util.List;  public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch { @@ -99,7 +99,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch      @Override      public boolean isValidSlot(int aIndex) { -        return false; +        return mAuto && GT_Mod.gregtechproxy.mAMHInteraction;      }      @Override @@ -128,6 +128,11 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch          return new GT_GUIContainer_MaintenanceHatch(aPlayerInventory, aBaseMetaTileEntity);      } +    public void updateSlots() { +        for (int i = 0; i < mInventory.length; i++) +            if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null; +    } +      public boolean autoMaintainance() {          boolean tSuccess = true;          ItemStack[] mInputs = new ItemStack[]{ItemList.Duct_Tape.get(4, new Object[]{}), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 2), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 4), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2)}; @@ -174,6 +179,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch              this.mSoftHammer = true;              this.mSolderingTool = true;              this.mWrench = true; +            updateSlots();              return true;          }          return false; @@ -208,11 +214,11 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch      @Override      public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { -        return false; +        return mAuto && GT_Mod.gregtechproxy.mAMHInteraction;      }      @Override      public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { -        return false; +        return mAuto && GT_Mod.gregtechproxy.mAMHInteraction;      }  } diff --git a/src/main/java/gregtech/api/objects/MaterialStack.java b/src/main/java/gregtech/api/objects/MaterialStack.java index 6066d3cf23..62adefa35b 100644 --- a/src/main/java/gregtech/api/objects/MaterialStack.java +++ b/src/main/java/gregtech/api/objects/MaterialStack.java @@ -35,7 +35,7 @@ public class MaterialStack implements Cloneable {           String temp1 = "", temp2 = mMaterial.getToolTip(true), temp3 = "", temp4 = "";           if (mAmount > 1) {               temp4 = String.valueOf(mAmount); -             if (mMaterial.mMaterialList.size() > 1) { +             if (mMaterial.mMaterialList.size() > 1 || (mMaterial.mMaterialList.size() == 1 && mMaterial.mElement == null)) {                  temp1 = "(";                  temp3 = ")";               } diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java index 62c8714807..daa1b67069 100644 --- a/src/main/java/gregtech/api/util/GT_ModHandler.java +++ b/src/main/java/gregtech/api/util/GT_ModHandler.java @@ -682,8 +682,8 @@ public class GT_ModHandler {                  for (ItemStack tStack : ((IRecipeInput) tRecipe.getKey()).getInputs()) {                      if (GT_Utility.isStackValid(tStack)) {                          if (aAddGTRecipe && (aGTRecipeMap.findRecipe(null, false, Long.MAX_VALUE, null, tStack) == null)) { +                        	try{                              if (aExcludeGTIC2Items && ((tStack.getUnlocalizedName().contains("gt.metaitem.01") || tStack.getUnlocalizedName().contains("gt.blockores") || tStack.getUnlocalizedName().contains("ic2.itemCrushed") || tStack.getUnlocalizedName().contains("ic2.itemPurifiedCrushed")))) continue; -                            try{                              switch (aGTRecipeMap.mUnlocalizedName) {                                  case "gt.recipe.macerator":                                      aGTRecipeMap.addRecipe(true, new ItemStack[]{GT_Utility.copyAmount(((IRecipeInput) tRecipe.getKey()).getAmount(), tStack)}, (ItemStack[]) ((RecipeOutput) tRecipe.getValue()).items.toArray(), null, null, null, null, 300, 2, 0); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 91033a1f34..e7fcd1e01d 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -196,6 +196,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {      public boolean mLowGravProcessing = false;      public boolean mAprilFool = false;      public boolean mCropNeedBlock = true; +    public boolean mAMHInteraction = true;      public GT_Proxy() {          GameRegistry.registerFuelHandler(this); diff --git a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java index 9c61f4feee..d76a05117b 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java @@ -57,8 +57,8 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior {          if(aCoverVariable <0){aCoverVariable = 2;}          switch(aCoverVariable) {              case 0: GT_Utility.sendChatToPlayer(aPlayer, "Emit if any Player is close"); break; -            case 1: GT_Utility.sendChatToPlayer(aPlayer, "Emit if you are close"); break; -            case 2: GT_Utility.sendChatToPlayer(aPlayer, "Emit if other player is close"); break; +            case 1: GT_Utility.sendChatToPlayer(aPlayer, "Emit if other player is close"); break; +            case 2: GT_Utility.sendChatToPlayer(aPlayer, "Emit if you are close"); break;          }          return aCoverVariable;      } diff --git a/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java b/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java index d2e51e67f1..761f263d79 100644 --- a/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java +++ b/src/main/java/gregtech/common/items/armor/ModularArmor_Item.java @@ -89,6 +89,7 @@ public class ModularArmor_Item extends ItemArmor implements ISpecialArmor, IGogg  			data = fillArmorData((EntityPlayer) player, armor);  		}  		if (player != null && armor != null && source != null) { +			try{  			double tmp = 0.0d;  			if (source.isMagicDamage()) {  				tmp = data.mStat.get(StatType.MAGICDEFENCE); @@ -127,6 +128,9 @@ public class ModularArmor_Item extends ItemArmor implements ISpecialArmor, IGogg  				tmp = 1.0f - ((1.0f - tmp) / 2.0f);  			}  			return new ISpecialArmor.ArmorProperties(0, data.getBaseAbsorptionRatio() * tmp, 1000); +			}catch(Exception e){System.err.println(e); +			return new ISpecialArmor.ArmorProperties(0, 0, 0); +			}  		} else {  			return new ISpecialArmor.ArmorProperties(0, 0, 0); @@ -266,10 +270,10 @@ public class ModularArmor_Item extends ItemArmor implements ISpecialArmor, IGogg  				}  					aPlayer.openGui(GT_Values.GT, openGuiNr+(typeMod), aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ);  			} -			if(data.helmet!=null&&data.helmet.openGui){data.helmet.openGui=false;aPlayer.openGui(GT_Values.GT, openGuiNr+400, aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ);} -			if(data.chestplate!=null&&data.chestplate.openGui){data.chestplate.openGui=false;aPlayer.openGui(GT_Values.GT, openGuiNr+300, aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ);} -			if(data.leggings!=null&&data.leggings.openGui){data.leggings.openGui=false;aPlayer.openGui(GT_Values.GT, openGuiNr+200, aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ);} -			if(data.boots!=null&&data.boots.openGui){data.boots.openGui=false;aPlayer.openGui(GT_Values.GT, openGuiNr+100, aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ);} +//			if(data.helmet!=null&&data.helmet.openGui){data.helmet.openGui=false;aPlayer.openGui(GT_Values.GT, openGuiNr+400, aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ);} +//			if(data.chestplate!=null&&data.chestplate.openGui){data.chestplate.openGui=false;aPlayer.openGui(GT_Values.GT, openGuiNr+300, aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ);} +//			if(data.leggings!=null&&data.leggings.openGui){data.leggings.openGui=false;aPlayer.openGui(GT_Values.GT, openGuiNr+200, aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ);} +//			if(data.boots!=null&&data.boots.openGui){data.boots.openGui=false;aPlayer.openGui(GT_Values.GT, openGuiNr+100, aWorld, (int) aPlayer.posX, (int) aPlayer.posY, (int) aPlayer.posZ);}  			// Night Vision  			if (timer >= 200) {  				timer = 0; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java index 22dd01c755..78f247bb3b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java @@ -90,7 +90,7 @@ public class GT_MetaTileEntity_DistillationTower          long tVoltage = getMaxInputVoltage();          byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); -        FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tFluidList.size()]), 0, tFluidList.size()); +        FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);          if (tFluids.length > 0) {          	for(int i = 0;i<tFluids.length;i++){              GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluids[i]}, new ItemStack[]{}); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index e0d0ee46d1..0f07a3e743 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -91,7 +91,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace                  }
              }
          }
 -        ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
 +        ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]);
          ArrayList<FluidStack> tFluidList = getStoredFluids();
          int tFluidList_sS = tFluidList.size();
 diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java index 81e9485ecf..090b84320b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -83,7 +83,7 @@ public class GT_MetaTileEntity_ImplosionCompressor                  }
              }
          }
 -        ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
 +        ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]);
          if (tInputList.size() > 0) {
              GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs);
              if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, null, tInputs))) {
 | 
