Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some fixes for old bugs #1529

Merged
merged 9 commits into from
Jun 16, 2019
6 changes: 5 additions & 1 deletion src/main/java/gregtech/GT_Mod.java
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,11 @@ public void onPreLoad(FMLPreInitializationEvent aEvent) {
for (Runnable tRunnable : GregTech_API.sAfterGTPreload) {
tRunnable.run();
}
} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
if (FMLCommonHandler.instance().getEffectiveSide().isServer())
GT_Assemblyline_Server.fillMap(aEvent);
}

@Mod.EventHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import gregtech.api.util.GT_ModHandler.RecipeBits;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.GT_OreDictUnificator;
import ic2.core.Ic2Items;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
Expand Down Expand Up @@ -647,6 +648,11 @@ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex
case 2:
return (!mRequiresFluidForFiltering || getFillableStack() != null) && (((getInputAt(0) != null && getInputAt(1) != null) || (getInputAt(0) == null && getInputAt(1) == null ? getRecipeList().containsInput(aStack) : (getRecipeList().containsInput(aStack) && null != getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), aIndex == getInputSlot() ? new ItemStack[]{aStack, getInputAt(1)} : new ItemStack[]{getInputAt(0), aStack})))));
default:
int tID = getBaseMetaTileEntity().getMetaTileID();
if (tID >= 211 && tID <= 218) {// assemblers IDs
if (GT_OreDictUnificator.isItemStackInstanceOf(aStack, "circuitBasic")) return true; // allow input all LV-circuits for assemblers
if (GT_OreDictUnificator.isItemStackInstanceOf(aStack, "circuitAdvanced")) return true; // allow input all HV-circuits for assemblers
}
return getRecipeList().containsInput(aStack);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,53 @@ public void onToolClick(ItemStack aStack, EntityLivingBase aPlayer) {

@Override
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return mAuto && GT_Mod.gregtechproxy.mAMHInteraction;
if(!(mAuto && GT_Mod.gregtechproxy.mAMHInteraction))
return false;
ItemStack[] mInputs = new ItemStack[]{ItemList.Duct_Tape.get(32, new Object[]{}), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 32), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 32), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 32)};
ItemStack[] aInputs = mInventory;
for(ItemStack nStack :mInputs) {
if (GT_Utility.areUnificationsEqual(aStack, nStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), GT_OreDictUnificator.get(false, nStack), true)) {
for (byte i = 0;i<mInventory.length;i++) {
ItemStack tStack =aInputs[i];
if (GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), GT_OreDictUnificator.get(false, tStack), true)) {
if ((tStack.stackSize < 64)){
return true;
}
return false;
}
if(i == 3){
return true;
}

}
}
}
return false;
}

@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return mAuto && GT_Mod.gregtechproxy.mAMHInteraction;
if(!(mAuto && GT_Mod.gregtechproxy.mAMHInteraction))
return false;
ItemStack[] mInputs = new ItemStack[]{ItemList.Duct_Tape.get(32, new Object[]{}), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 32), GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 32), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 32)};
ItemStack[] aInputs = mInventory;
for(ItemStack nStack :mInputs) {
if (GT_Utility.areUnificationsEqual(aStack, nStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), GT_OreDictUnificator.get(false, nStack), true)) {
for (byte i = 0;i<mInventory.length;i++) {
ItemStack tStack =aInputs[i];
if (GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), GT_OreDictUnificator.get(false, tStack), true)) {
if ((tStack.stackSize < 64)){
return true;
}
return false;
}
if(i == 3){
return true;
}

}
}
}
return false;
}
}
Loading