Skip to content

Commit

Permalink
Added some fixes for old bugs (#1529)
Browse files Browse the repository at this point in the history
* Improved LuV+conveyor modules

now LuV+ Conveyors can work with more than 1 stack per tick

* Fixed conveyors

* Fixed AL books at servers

Added a fix for unlocalized item names in AL books at minecraft servers

* Fixed automaintance hatch

Automaintance hatches cannot be used for automainting if they allow to put in any items. This fix changes this, now automaintance hatches can hold only 1 stack of each needed for maintating item

* Fix for LV and HV circuits

fixed old bug when LV and HV circuits cannot be automatically put in any machines

* Revert "Fixed conveyors"

This reverts commit 467563b.

* Revert "Improved LuV+conveyor modules"

This reverts commit 4dc2e21.

* Update GT_MetaTileEntity_BasicMachine_GT_Recipe.java

* Deleted GC schematics from scanner code

now this is the port of NH fork fix
  • Loading branch information
AndreySolodovnikov authored and Blood-Asp committed Jun 16, 2019
1 parent 25d4422 commit aa577dd
Show file tree
Hide file tree
Showing 5 changed files with 367 additions and 63 deletions.
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 @@ -563,7 +563,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

0 comments on commit aa577dd

Please sign in to comment.