aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
authorDream-Master <dream-master@gmx.net>2018-06-21 19:20:27 +0200
committerDream-Master <dream-master@gmx.net>2018-06-21 19:20:27 +0200
commite916f91c2086b750fff1ca5818599e11c890e61c (patch)
tree98b39ffcc990761d0ef0ec05c921930a10824b1c /src/main/java/gregtech/api
parente3d224031b8bc1b579705ebe42b96ca73e651c38 (diff)
parent09addd7bdb0470a0d059e3a9edfcf1ff37937eb5 (diff)
downloadGT5-Unofficial-e916f91c2086b750fff1ca5818599e11c890e61c.tar.gz
GT5-Unofficial-e916f91c2086b750fff1ca5818599e11c890e61c.tar.bz2
GT5-Unofficial-e916f91c2086b750fff1ca5818599e11c890e61c.zip
Merge branch 'experimental' of https://github.com/GTNewHorizons/GT5-Unofficial into experimental
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java22
-rw-r--r--src/main/java/gregtech/api/util/GT_LanguageManager.java4
2 files changed, 20 insertions, 6 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
index e0f7037cdf..73ab28822a 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java
@@ -12,7 +12,7 @@ import net.minecraft.nbt.NBTTagCompound;
import static gregtech.api.enums.GT_Values.V;
public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredMachineBlock {
- public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false;
+ public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bStockingMode = true;
public int mSuccess = 0, mTargetStackSize = 0;
public GT_MetaTileEntity_Buffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) {
@@ -192,6 +192,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
aNBT.setBoolean("bInvert", bInvert);
aNBT.setBoolean("bOutput", bOutput);
aNBT.setBoolean("bRedstoneIfFull", bRedstoneIfFull);
+ aNBT.setBoolean("bStockingMode", bStockingMode);
aNBT.setInteger("mTargetStackSize", mTargetStackSize);
}
@@ -200,6 +201,9 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
bInvert = aNBT.getBoolean("bInvert");
bOutput = aNBT.getBoolean("bOutput");
bRedstoneIfFull = aNBT.getBoolean("bRedstoneIfFull");
+ if (aNBT.hasKey("bStockingMode")) { // Adding new key to existing NBT, need to protect if it is not there.
+ bStockingMode = aNBT.getBoolean("bStockingMode");
+ }
mTargetStackSize = aNBT.getInteger("mTargetStackSize");
}
@@ -253,10 +257,18 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
}
protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- int tCost = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), aBaseMetaTileEntity.getFrontFacing(), null, false, mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize, (byte) 64, (byte) 1);
- if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) {
- mSuccess = 50;
- aBaseMetaTileEntity.decreaseStoredEnergyUnits(Math.abs(tCost), true);
+ if( bStockingMode ) {
+ int tCost = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), aBaseMetaTileEntity.getFrontFacing(), null, false, mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize, (byte) 64, (byte) 1);
+ if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ mSuccess = 50;
+ aBaseMetaTileEntity.decreaseStoredEnergyUnits(Math.abs(tCost), true);
+ }
+ } else {
+ int tCost = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), aBaseMetaTileEntity.getFrontFacing(), null, false, (byte) 64, (byte) 1, mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize);
+ if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) {
+ mSuccess = 50;
+ aBaseMetaTileEntity.decreaseStoredEnergyUnits(Math.abs(tCost), true);
+ }
}
}
diff --git a/src/main/java/gregtech/api/util/GT_LanguageManager.java b/src/main/java/gregtech/api/util/GT_LanguageManager.java
index 08b1ec6a2a..96877deb26 100644
--- a/src/main/java/gregtech/api/util/GT_LanguageManager.java
+++ b/src/main/java/gregtech/api/util/GT_LanguageManager.java
@@ -323,6 +323,8 @@ public class GT_LanguageManager {
addStringLocalization("Interaction_DESCRIPTION_Index_214", "Connected");
addStringLocalization("Interaction_DESCRIPTION_Index_215", "Disconnected");
addStringLocalization("Interaction_DESCRIPTION_Index_216", "Deprecated Recipe");
+ addStringLocalization("Interaction_DESCRIPTION_Index_217", "Stocking mode. Keeps this many items in destination input slots.");
+ addStringLocalization("Interaction_DESCRIPTION_Index_218", "Transfer size mode. Add exactly this many items in destination input slots as long as there is room.");
addStringLocalization("Interaction_DESCRIPTION_Index_500", "Fitting: Loose - More Flow");
addStringLocalization("Interaction_DESCRIPTION_Index_501", "Fitting: Tight - More Efficiency");
@@ -349,4 +351,4 @@ public class GT_LanguageManager {
addStringLocalization("Item_DESCRIPTION_Index_501", "Optimal Steam flow (Loose): %s L/t");
}
-} \ No newline at end of file
+}