From 5b506d3a2b512d143c4b4ea55bf844b44900cfed Mon Sep 17 00:00:00 2001 From: reobf <2215595288@qq.com> Date: Wed, 19 Feb 2025 16:42:38 +0800 Subject: [PATCH] update --- .../BufferedDualInputHatch.java | 52 +- .../metatileentity/PatternDualInputHatch.java | 22 +- .../StockingDualInputHatchME.java | 555 +++++++++++------- .../metatileentity/bufferutil/FluidTankG.java | 206 +++++++ .../metatileentity/bufferutil/ItemStackG.java | 29 +- .../assets/proghatches/lang/en_US.lang | 4 + .../assets/proghatches/lang/zh_CN.lang | 4 + 7 files changed, 630 insertions(+), 242 deletions(-) create mode 100644 src/main/java/reobf/proghatches/gt/metatileentity/bufferutil/FluidTankG.java diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/BufferedDualInputHatch.java b/src/main/java/reobf/proghatches/gt/metatileentity/BufferedDualInputHatch.java index 19f8342..cc40463 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/BufferedDualInputHatch.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/BufferedDualInputHatch.java @@ -14,6 +14,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map.Entry; +import java.util.Objects; import java.util.Optional; import java.util.Random; import java.util.function.Consumer; @@ -103,6 +104,7 @@ import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import reobf.proghatches.gt.metatileentity.BufferedDualInputHatch.Recipe; +import reobf.proghatches.gt.metatileentity.bufferutil.FluidTankG; import reobf.proghatches.gt.metatileentity.bufferutil.ItemStackG; import reobf.proghatches.gt.metatileentity.util.BaseSlotPatched; import reobf.proghatches.gt.metatileentity.util.FirstObjectHolder; @@ -258,7 +260,7 @@ public class DualInvBuffer implements INeoDualInputInventory { public long tickFirstClassify = -1; public void onChange(){} - protected FluidTank[] mStoredFluidInternal; + protected FluidTankG[] mStoredFluidInternal; protected ItemStackG[] mStoredItemInternal; protected FluidTank[] mStoredFluidInternalSingle; protected ItemStack[] mStoredItemInternalSingle; @@ -289,9 +291,9 @@ public boolean full() { } for (int index = 0; index < mStoredFluidInternalSingle.length; index++) { - FluidTank i = mStoredFluidInternal[index]; + FluidTankG i = mStoredFluidInternal[index]; FluidTank si = mStoredFluidInternalSingle[index]; - if (si != null && Integer.MAX_VALUE - i.getFluidAmount() < si.getFluidAmount()) { + if (si != null && Long.MAX_VALUE - i.getFluidAmount() < si.getFluidAmount()) { return true;// over flow! count as full } if (i.getFluidAmount() >= fluidLimit()) { @@ -392,7 +394,7 @@ public void fromTag(NBTTagCompound tag) { public void init(int item, int fluid) { i = item; f = fluid; - mStoredFluidInternal = initFluidTack(new FluidTank[fluid]); + mStoredFluidInternal = initFluidTack(new FluidTankG[fluid]); mStoredFluidInternalSingle = initFluidTack(new FluidTank[fluid]); mStoredItemInternal = new ItemStackG[item + v]; mStoredItemInternalSingle = new ItemStack[item]; @@ -404,7 +406,12 @@ private FluidTank[] initFluidTack(FluidTank[] t) { } return t; } - + private FluidTankG[] initFluidTack(FluidTankG[] t) { + for (int i = 0; i < t.length; i++) { + t[i] = new FluidTankG(); + } + return t; + } public boolean isAccessibleForMulti() { /* @@ -421,7 +428,7 @@ public long currentTick() { public boolean isEmpty() { - for (FluidTank f : mStoredFluidInternal) { + for (FluidTankG f : mStoredFluidInternal) { if (f.getFluidAmount() > 0) { return false; } @@ -497,7 +504,14 @@ private boolean fluidEqualsIngoreAmount(FluidTank a, FluidTank b) { return true; } + private boolean fluidEqualsIngoreAmount(FluidTankG a, FluidTank b) { + + if (a.getFluid() == null && a.getFluid() == null) return true; + if (a.getFluid() != null && (!a.getFluid() + .equals(b.getFluid()))) return false; + return true; + } public boolean areItemStacksEqualIngoreAmount(ItemStack p_77989_0_, ItemStack p_77989_1_) { return p_77989_0_ == null && p_77989_1_ == null ? true : (p_77989_0_ != null && p_77989_1_ != null ? isItemStackEqualIngoreAmount(p_77989_0_, p_77989_1_) @@ -725,7 +739,7 @@ public int space() { for (int ix = 0; ix < f; ix++) { if (mStoredFluidInternalSingle[ix].getFluidAmount() > 0) { - int now = mStoredFluidInternal[ix].getFluidAmount(); + long now = mStoredFluidInternal[ix].getFluidAmount(); long tmp = (fluidLimit() - now) / mStoredFluidInternalSingle[ix].getFluidAmount(); if (tmp < ret) { @@ -1589,10 +1603,10 @@ public void program() { public class LimitedFluidTank implements IFluidTank { - IFluidTank inner; + FluidTankG inner; - public LimitedFluidTank(IFluidTank i) { - inner = i; + public LimitedFluidTank(FluidTankG mStoredFluidInternal) { + inner = mStoredFluidInternal; } @Override @@ -1604,7 +1618,7 @@ public FluidStack getFluid() { @Override public int getFluidAmount() { - return inner.getFluidAmount(); + return (int) Math.min(inner.getFluidAmount(),Integer.MAX_VALUE); } @Override @@ -1990,11 +2004,11 @@ public void track(@Nonnull ItemStack recipe, @Nullable ItemStackG mStoredItemInt track(a, b, false); } - public void track(@Nonnull FluidTank recipe, @Nonnull FluidTank storage) { + public void track(@Nonnull FluidTank recipe, @Nonnull FluidTankG storage) { if (recipe.getFluid() .getFluid() != Optional.of(storage) - .map(FluidTank::getFluid) + .map(FluidTankG::getFluid) .map(FluidStack::getFluid) .orElse(null)) { broken = true; @@ -2003,7 +2017,7 @@ public void track(@Nonnull FluidTank recipe, @Nonnull FluidTank storage) { } int a = recipe.getFluidAmount(); - int b = storage.getFluidAmount(); + long b = storage.getFluidAmount(); track(a, b, false); } @@ -2858,7 +2872,15 @@ public static ItemStackG loadItemStackFromNBTG(NBTTagCompound tag) { } public static ItemStack[] flat(ItemStackG[] mStoredItemInternal2) { - return Arrays.asList(mStoredItemInternal2).stream().flatMap(s->Arrays.stream(s.flat())).toArray(ItemStack[]::new); + return Arrays.asList(mStoredItemInternal2).stream().filter(Objects::nonNull).flatMap(s->Arrays.stream(s.flat())).toArray(ItemStack[]::new); + + + + + } + public static FluidStack[] flat(FluidTankG[] mStoredItemInternal2) { + + return Arrays.asList(mStoredItemInternal2).stream().flatMap(s->Arrays.stream(s.flat())).toArray(FluidStack[]::new); diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/PatternDualInputHatch.java b/src/main/java/reobf/proghatches/gt/metatileentity/PatternDualInputHatch.java index 23d7a2e..5afaf49 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/PatternDualInputHatch.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/PatternDualInputHatch.java @@ -2,6 +2,7 @@ import static gregtech.api.objects.XSTR.XSTR_INSTANCE; +import java.util.Arrays; import java.util.EnumSet; import java.util.List; import java.util.Optional; @@ -319,7 +320,7 @@ abstract class Inv { abstract ItemStack[] geti(); - abstract FluidTank[] getf(); + abstract FluidStack[] getf(); } Consumer consumer = inv -> { try { @@ -336,19 +337,16 @@ abstract class Inv { } IMEMonitor fsg = getProxy().getStorage() .getFluidInventory(); - for (FluidTank fluidStack : inv.getf()) { - if (fluidStack == null || fluidStack.getFluidAmount() == 0) continue; + for (FluidStack fluidStack : inv.getf()) { + if (fluidStack == null || fluidStack.amount == 0) continue; IAEFluidStack rest = Platform.poweredInsert( getProxy().getEnergy(), fsg, AEApi.instance() .storage() - .createFluidStack(fluidStack.getFluid()), + .createFluidStack(fluidStack), src); - fluidStack.setFluid( - Optional.ofNullable(rest) - .map(IAEFluidStack::getFluidStack) - .orElse(null)); + fluidStack.amount=0; } ; } catch (Exception e) { throw new RuntimeException(e); @@ -364,8 +362,8 @@ ItemStack[] geti() { } @Override - FluidTank[] getf() { - return s.mStoredFluidInternal; + FluidStack[] getf() { + return flat(s.mStoredFluidInternal); } }) .forEach(consumer);; @@ -378,9 +376,9 @@ ItemStack[] geti() { } @Override - FluidTank[] getf() { + FluidStack[] getf() { - return mStoredFluid; + return Arrays.stream(mStoredFluid).map(s->s.getFluid()).toArray(FluidStack[]::new); } }); diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/StockingDualInputHatchME.java b/src/main/java/reobf/proghatches/gt/metatileentity/StockingDualInputHatchME.java index 8af0596..b68b548 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/StockingDualInputHatchME.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/StockingDualInputHatchME.java @@ -8,6 +8,9 @@ import static kubatech.api.Variables.numberFormatScientific; import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.nio.LongBuffer; +import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.ArrayList; import java.util.Arrays; @@ -55,6 +58,7 @@ import com.gtnewhorizons.modularui.common.widget.TextWidget; import com.gtnewhorizons.modularui.common.widget.textfield.NumericWidget; + import appeng.api.config.Actionable; import appeng.api.config.FuzzyMode; import appeng.api.implementations.IPowerChannelState; @@ -109,33 +113,37 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import reobf.proghatches.gt.metatileentity.bufferutil.FluidTankG; +import reobf.proghatches.gt.metatileentity.bufferutil.ItemStackG; +import reobf.proghatches.gt.metatileentity.util.IDoNotCacheThisPattern; import reobf.proghatches.gt.metatileentity.util.IRecipeProcessingAwareDualHatch; import reobf.proghatches.item.ItemProgrammingCircuit; import reobf.proghatches.main.MyMod; import reobf.proghatches.main.registration.Registration; public class StockingDualInputHatchME extends MTEHatchInputBus - implements IDualInputHatch, IRecipeProcessingAwareDualHatch, IPowerChannelState,IGridProxyable + implements IDualInputHatch, IRecipeProcessingAwareDualHatch, IPowerChannelState, IGridProxyable { - public StockingDualInputHatchME(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, boolean allowAuto2) { + public StockingDualInputHatchME(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, + boolean allowAuto2) { super(aName, aTier, 1, aDescription, aTextures); - allowAuto=allowAuto2; + allowAuto = allowAuto2; } - public StockingDualInputHatchME(int id, String name, String nameRegional, int tier,boolean a) { - super(id, name, nameRegional, tier, 1, reobf.proghatches.main.Config.get( - "SDIHME", ImmutableMap.of())); + public StockingDualInputHatchME(int id, String name, String nameRegional, int tier, boolean a) { + super(id, name, nameRegional, tier, 1, reobf.proghatches.main.Config.get("SDIHME", ImmutableMap.of())); Registration.items.add(new ItemStack(GregTechAPI.sBlockMachines, 1, id)); - allowAuto=a; + allowAuto = a; } + boolean allowAuto; @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new StockingDualInputHatchME(mName, mTier, mDescriptionArray, mTextures,allowAuto); + return new StockingDualInputHatchME(mName, mTier, mDescriptionArray, mTextures, allowAuto); } @Override @@ -158,7 +166,7 @@ public int getCircuitSlotY() { private boolean autoPullItemList; private long minAutoPullStackSize; - private int interval=1; + private int interval = 1; public ItemStack updateInformationSlot(int aIndex, ItemStack aStack) { @@ -173,9 +181,14 @@ public ItemStack updateInformationSlot(int aIndex, ItemStack aStack) { try { IMEMonitor sg = proxy.getStorage().getItemInventory(); IAEItemStack request = AEItemStack.create(i_mark[aIndex]); - request.setStackSize(Integer.MAX_VALUE); + request.setStackSize(Long.MAX_VALUE); IAEItemStack result = sg.extractItems(request, Actionable.SIMULATE, source); ItemStack s = (result != null) ? result.getItemStack() : null; + if(result!=null){ + ItemStackG g=ItemStackG.fromAE(result, intmaxs); + result.setStackSize(g.stackSize()); + } + i_client[aIndex] = result == null ? 0 : result.getStackSize(); // We want to track changes in any ItemStack to notify any // connected controllers to make a recipe // check early @@ -211,9 +224,14 @@ public void updateInformationSlotF(int index) { try { IMEMonitor sg = proxy.getStorage().getFluidInventory(); IAEFluidStack request = AEFluidStack.create(fluidStack); - request.setStackSize(Integer.MAX_VALUE); + request.setStackSize(Long.MAX_VALUE); IAEFluidStack result = sg.extractItems(request, Actionable.SIMULATE, source); + if(result!=null){ + FluidTankG g=new FluidTankG(); + g.fromAE(result, intmaxs); + result.setStackSize(g.getFluidAmount());} FluidStack resultFluid = (result != null) ? result.getFluidStack() : null; + f_client[index] = result == null ? 0 : result.getStackSize(); // We want to track if any FluidStack is modified to notify any // connected controllers to make a recipe check // early @@ -245,8 +263,8 @@ public void addUIWidgets(Builder builder, UIBuildContext buildContext) { IDrawable tab1 = new ItemDrawable(gregtech.api.enums.ItemList.Hatch_Input_Bus_ME_Advanced.get(1)) .withFixedSize(18, 18, 4, 4); - IDrawable tab2 = new ItemDrawable(gregtech.api.enums.ItemList.Hatch_Input_ME_Advanced.get(1)) - .withFixedSize(18, 18, 4, 4); + IDrawable tab2 = new ItemDrawable(gregtech.api.enums.ItemList.Hatch_Input_ME_Advanced.get(1)).withFixedSize(18, + 18, 4, 4); IDrawable tab3 = new ItemDrawable(GTOreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1)) .withFixedSize(18, 18, 4, 4); @@ -281,82 +299,76 @@ public void addUIWidgets(Builder builder, UIBuildContext buildContext) { 0, 1f, 1f), tab3) .setPos(getGUIWidth() - 4, 56)) - .addPage( - new MultiChildWidget() - .addChild( - SlotGroup.ofItemHandler(inventoryHandlerDisplay, 4).startFromSlot(0) - .endAtSlot(15).phantom(true).background(GTUITextures.SLOT_DARK_GRAY) - .widgetCreator(slot -> aeSlotWidgets[slot - .getSlotIndex()] = new AESlotWidget(slot).disableInteraction()) - .build().setPos(97, 9)) - - .addChild(SlotGroup.ofItemHandler(inventoryHandlerMark, 4).startFromSlot(0) - .endAtSlot(15).phantom(true) - .slotCreator(index -> new BaseSlot(inventoryHandlerMark, index, true) { - - @Override - public boolean isEnabled() { - return !autoPullItemList && super.isEnabled(); - } - }).widgetCreator(slot -> (SlotWidget) new SlotWidget(slot) { - - @Override - protected void phantomClick(ClickData clickData, ItemStack cursorStack) { - if (clickData.mouseButton != 0 || !getMcSlot().isEnabled()) - return; - final int aSlotIndex = getMcSlot().getSlotIndex(); - if (cursorStack == null) { - getMcSlot().putStack(null); - } else { - if (containsSuchStack(cursorStack)) - return; - getMcSlot().putStack(GTUtility.copyAmount(1, cursorStack)); - } - if (getBaseMetaTileEntity().isServerSide()) { - final ItemStack newInfo = updateInformationSlot(aSlotIndex, - cursorStack); - aeSlotWidgets[getMcSlot().getSlotIndex()].getMcSlot() - .putStack(newInfo); - } - } + .addPage(new MultiChildWidget().addChild(SlotGroup.ofItemHandler(inventoryHandlerDisplay, 4) + .startFromSlot(0).endAtSlot(15).phantom(true).background(GTUITextures.SLOT_DARK_GRAY) + .widgetCreator(slot -> aeSlotWidgets[slot.getSlotIndex()] = new AESlotWidget(slot) + .setOverwriteItemStackTooltip(s -> rewriteItem(slot, s)).disableInteraction()) + .build().setPos(97, 9)) - @Override - public IDrawable[] getBackground() { - IDrawable slot; - if (autoPullItemList) { - slot = GTUITextures.SLOT_DARK_GRAY; - } else { - slot = ModularUITextures.ITEM_SLOT; - } - return new IDrawable[] { slot, GTUITextures.OVERLAY_SLOT_ARROW_ME }; - } + .addChild(SlotGroup.ofItemHandler(inventoryHandlerMark, 4).startFromSlot(0).endAtSlot(15) + .phantom(true).slotCreator(index -> new BaseSlot(inventoryHandlerMark, index, true) { - @Override - public List getExtraTooltip() { - if (autoPullItemList) { - return Collections.singletonList(StatCollector.translateToLocal( - "GT5U.machines.stocking_bus.cannot_set_slot")); - } else { - return Collections.singletonList(StatCollector - .translateToLocal("modularui.phantom.single.clear")); - } - } + @Override + public boolean isEnabled() { + return !autoPullItemList && super.isEnabled(); + } + }).widgetCreator(slot -> (SlotWidget) new SlotWidget(slot) { - private boolean containsSuchStack(ItemStack tStack) { - for (int i = 0; i < 16; ++i) { - if (GTUtility.areStacksEqual(i_mark[i], tStack, false)) - return true; - } - return false; - } - }.dynamicTooltip(() -> { - if (autoPullItemList) { - return Collections.singletonList(StatCollector.translateToLocal( - "GT5U.machines.stocking_bus.cannot_set_slot")); - } else { - return Collections.emptyList(); - } - }).setUpdateTooltipEveryTick(true)).build().setPos(7, 9)) + @Override + protected void phantomClick(ClickData clickData, ItemStack cursorStack) { + if (clickData.mouseButton != 0 || !getMcSlot().isEnabled()) + return; + final int aSlotIndex = getMcSlot().getSlotIndex(); + if (cursorStack == null) { + getMcSlot().putStack(null); + } else { + if (containsSuchStack(cursorStack)) + return; + getMcSlot().putStack(GTUtility.copyAmount(1, cursorStack)); + } + if (getBaseMetaTileEntity().isServerSide()) { + final ItemStack newInfo = updateInformationSlot(aSlotIndex, cursorStack); + aeSlotWidgets[getMcSlot().getSlotIndex()].getMcSlot().putStack(newInfo); + } + } + + @Override + public IDrawable[] getBackground() { + IDrawable slot; + if (autoPullItemList) { + slot = GTUITextures.SLOT_DARK_GRAY; + } else { + slot = ModularUITextures.ITEM_SLOT; + } + return new IDrawable[] { slot, GTUITextures.OVERLAY_SLOT_ARROW_ME }; + } + + @Override + public List getExtraTooltip() { + if (autoPullItemList) { + return Collections.singletonList(StatCollector + .translateToLocal("GT5U.machines.stocking_bus.cannot_set_slot")); + } else { + return Collections.singletonList( + StatCollector.translateToLocal("modularui.phantom.single.clear")); + } + } + + private boolean containsSuchStack(ItemStack tStack) { + for (int i = 0; i < 16; ++i) { + if (GTUtility.areStacksEqual(i_mark[i], tStack, false)) + return true; + } + return false; + } + }.dynamicTooltip(() -> { + if (autoPullItemList) { + return Collections.singletonList(StatCollector + .translateToLocal("GT5U.machines.stocking_bus.cannot_set_slot")); + } else { + return Collections.emptyList(); + } + }).setUpdateTooltipEveryTick(true)).build().setPos(7, 9)) ).addPage(new MultiChildWidget().addChild( @@ -431,7 +443,7 @@ public void buildTooltip(List tooltip) { }.setUpdateTooltipEveryTick(true)).build().setPos(new Pos2d(7, 9)) ).addChild(SlotGroup.ofFluidTanks(IntStream.range(0, 16).mapToObj(index -> createTankForFluidStack(f_display, index, Integer.MAX_VALUE)).collect(Collectors.toList()), 4).phantom(true).widgetCreator((slotIndex, h) -> (FluidSlotWidget) new FluidSlotWidget(h) { - + @Override protected void tryClickPhantom(ClickData clickData, ItemStack cursorStack) { } @@ -445,7 +457,20 @@ public void buildTooltip(List tooltip) { FluidStack fluid = getContent(); if (fluid != null) { addFluidNameInfo(tooltip, fluid); - tooltip.add(Text.localised("modularui.fluid.phantom.amount", fluid.amount)); + + tooltip.add(Text.localised("modularui.fluid.phantom.amount", + /*df.format*/(f_client[slotIndex]))); + + + if(f_client[slotIndex]>Integer.MAX_VALUE){ + double cp = f_client[slotIndex]*1d/Integer.MAX_VALUE; + + tooltip.add(Text.localised("proghatch.stockingdual.exceedintmax")); + + tooltip.add(new Text(df2.format(cp)+"*int.max")); + } + + addAdditionalFluidInfo(tooltip, fluid); if (!Interactable.hasShiftDown()) { tooltip.add(Text.EMPTY); @@ -458,12 +483,19 @@ public void buildTooltip(List tooltip) { }.setUpdateTooltipEveryTick(true)).background(GTUITextures.SLOT_DARK_GRAY).controlsAmount(true).build() .setPos(new Pos2d(97, 9))) - ).addPage( - new MultiChildWidget().addChild(TextWidget.localised("GT5U.machines.stocking_bus.refresh_time").setPos(3, 42).setSize(74, 14)).addChild(new NumericWidget().setSetter(val -> interval = (int) val).setGetter(() -> interval).setBounds(1, Integer.MAX_VALUE).setScrollValues(1, 4, 64).setTextAlignment(Alignment.Center).setTextColor(Color.WHITE.normal).setSize(70, 18).setPos(3, 3).setBackground(GTUITextures.BACKGROUND_TEXT_FIELD)) - .addChild(new ButtonWidget().setOnClick((clickData, widget) -> { - if (clickData.mouseButton == 0) { - if(allowAuto) - setAutoPullItemList(!autoPullItemList); + ).addPage(new MultiChildWidget() + .addChild(TextWidget.localised("GT5U.machines.stocking_bus.refresh_time").setPos(3, 22).setSize(74, 14)) + .addChild(new NumericWidget().setSetter(val -> interval = (int) val).setGetter(() -> interval).setBounds(1, Integer.MAX_VALUE).setScrollValues(1, 4, 64).setTextAlignment(Alignment.Center).setTextColor(Color.WHITE.normal).setSize(70, 18).setPos(3, 3).setBackground(GTUITextures.BACKGROUND_TEXT_FIELD)) + .addChild(TextWidget.localised("proghatch.stockingdual.intmax").setPos(3, 64).setSize(74, 14).addTooltip( + StatCollector.translateToLocal("proghatch.stockingdual.intmax.tooltips") + )) + .addChild(new NumericWidget().setSetter(val -> intmaxs = (int) val).setGetter(() -> intmaxs).setBounds(1, 100).setScrollValues(1, 4, 64).setTextAlignment(Alignment.Center).setTextColor(Color.WHITE.normal).setSize(70, 18).setPos(3, 3+40).setBackground(GTUITextures.BACKGROUND_TEXT_FIELD)) + + .addChild(new ButtonWidget().setOnClick((clickData, widget) -> { + + if (clickData.mouseButton == 0) { + if (allowAuto) + setAutoPullItemList(!autoPullItemList); } else if (clickData.mouseButton == 1 && !widget.isClient()) { /* * widget.getContext() @@ -481,45 +513,80 @@ public void buildTooltip(List tooltip) { }).addTooltips( Arrays.asList(StatCollector.translateToLocal("GT5U.machines.stocking_bus.auto_pull.tooltip.1"), StatCollector.translateToLocal("GT5U.machines.stocking_bus.auto_pull.tooltip.2"))) - .setSize(16, 16).setPos(80, 3)) - .addChild(new ButtonWidget().setOnClick((clickData, widget) -> { - if (clickData.mouseButton == 0) { - - program=!program; - } else if (clickData.mouseButton == 1 && !widget.isClient()) { - /* - * widget.getContext() - * .openSyncedWindow(CONFIG_WINDOW_ID); - */ - } - }).setBackground(() -> { - if (program) { - return new IDrawable[] { GTUITextures.BUTTON_STANDARD_PRESSED, - new ItemDrawable(GTUtility.getIntegratedCircuit(0)) - /*GTUITextures.OVERLAY_BUTTON_AUTOPULL_ME*/ }; - } else { - return new IDrawable[] { GTUITextures.BUTTON_STANDARD, - new ItemDrawable(GTUtility.getIntegratedCircuit(0))}; - } - }).addTooltips( - Arrays.asList(StatCollector.translateToLocal("hatch.dualinput.stocking.autopull.program") - )) - .setSize(16, 16).setPos(80, 3+20)) - - - - - - )) + .setSize(16, 16).setPos(80, 3)).addChild(new ButtonWidget().setOnClick((clickData, widget) -> { + if (clickData.mouseButton == 0) { + + program = !program; + } else if (clickData.mouseButton == 1 && !widget.isClient()) { + /* + * widget.getContext() + * .openSyncedWindow(CONFIG_WINDOW_ID); + */ + } + }).setBackground(() -> { + if (program) { + return new IDrawable[] { GTUITextures.BUTTON_STANDARD_PRESSED, + new ItemDrawable(GTUtility.getIntegratedCircuit(0)) + /* + * GTUITextures. + * OVERLAY_BUTTON_AUTOPULL_ME + */ }; + } else { + return new IDrawable[] { GTUITextures.BUTTON_STANDARD, + new ItemDrawable(GTUtility.getIntegratedCircuit(0)) }; + } + }).addTooltips(Arrays + .asList(StatCollector.translateToLocal("hatch.dualinput.stocking.autopull.program"))) + .setSize(16, 16).setPos(80, 3 + 20)) + + )) ; - builder.widget(new FakeSyncWidget.BooleanSyncer(() -> program, - s->{program=s;})); + builder.widget(new FakeSyncWidget.BooleanSyncer(() -> program, s -> { + program = s; + }).setSynced(true, false)); builder.widget(new FakeSyncWidget.BooleanSyncer(() -> autoPullItemList, - StockingDualInputHatchME.this::setAutoPullItemList)); + StockingDualInputHatchME.this::setAutoPullItemList).setSynced(false, true)); + + for (int ii = 0; ii < 16; ii++) { + final int i = ii; + builder.widget(new FakeSyncWidget.LongSyncer(() -> { + // i_client[i]=i_saved[i]; + return i_client[i]; + }, s -> i_client[i] = s).setSynced(false, true) + + ); + } + + for (int ii = 0; ii < 16; ii++) { + final int i = ii; + builder.widget(new FakeSyncWidget.LongSyncer(() -> { + // f_client[i]=f_shadow[i].getFluidAmount(); + return f_client[i]; + }, s -> f_client[i] = s).setSynced(false, true)); + } + // return builder; } + long i_client[] = new long[16]; + + long f_client[] = new long[16]; + DecimalFormat df2 = new DecimalFormat("#,###.00"); + DecimalFormat df = new DecimalFormat("#,###"); + private List rewriteItem(BaseSlot slot, List s) { + + int i = slot.getSlotIndex(); + s.add("size:" + df.format(i_client[i])); + if(i_client[i]>Integer.MAX_VALUE){ + double cp = i_client[i]*1d/Integer.MAX_VALUE; + s.add(StatCollector.translateToLocal("proghatch.stockingdual.exceedintmax")); + s.add(df2.format(cp)+"*int.max"); + + } + return s; + } + protected void setAutoPullItemList(boolean pullItemList) { autoPullItemList = pullItemList; @@ -592,7 +659,8 @@ protected void refreshItemListF() { } public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - if (getBaseMetaTileEntity().isServerSide()) {program(); + if (getBaseMetaTileEntity().isServerSide()) { + program(); if (aTimer % interval == 0 && autoPullItemList) { refreshItemList(); refreshItemListF(); @@ -604,48 +672,49 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { super.onPostTick(aBaseMetaTileEntity, aTimer); }; + boolean program; -public void program(){ - - if(program) - try { - - - for(IAEItemStack s:getProxy().getStorage().getItemInventory().getStorageList()) - { - IAEItemStack ext = getProxy().getStorage().getItemInventory().extractItems(s, Actionable.MODULATE, source); - if(ext!=null&&ext.getStackSize()>0){ - ItemStack item = ext.getItemStack(); - item.stackSize=0; - - ItemStack circuit = ItemProgrammingCircuit.getCircuit(item).orElse(null); - this.setInventorySlotContents(getCircuitSlot(),circuit); - - this.getProxy().getNode().getGrid().getMachines(this.getClass()).forEach(m->{ - StockingDualInputHatchME thiz=(StockingDualInputHatchME) m.getMachine(); - if(thiz.program){ - thiz.setInventorySlotContents(thiz.getCircuitSlot(),circuit); - + + public void program() { + + if (program) + try { + + for (IAEItemStack s : getProxy().getStorage().getItemInventory().getStorageList()) { + IAEItemStack ext = getProxy().getStorage().getItemInventory().extractItems(s, Actionable.MODULATE, + source); + if (ext != null && ext.getStackSize() > 0) { + ItemStack item = ext.getItemStack(); + item.stackSize = 0; + + ItemStack circuit = ItemProgrammingCircuit.getCircuit(item).orElse(null); + this.setInventorySlotContents(getCircuitSlot(), circuit); + + this.getProxy().getNode().getGrid().getMachines(this.getClass()).forEach(m -> { + StockingDualInputHatchME thiz = (StockingDualInputHatchME) m.getMachine(); + if (thiz.program) { + thiz.setInventorySlotContents(thiz.getCircuitSlot(), circuit); + + } + + }); + ; + + } } - - - - });; - - } - } - - - } catch (GridAccessException e) { + } catch (GridAccessException e) { + } } -} + MachineSource source = new MachineSource(((IActionHost) getBaseMetaTileEntity())); boolean recipe; + int intmaxs = 3; @Override public void startRecipeProcessing() { - recipe = true;program(); + recipe = true; + program(); for (int i = 0; i < 16; i++) { i_shadow[i] = null; i_saved[i] = 0; @@ -653,27 +722,26 @@ public void startRecipeProcessing() { try { IAEItemStack possible = getProxy().getStorage().getItemInventory().extractItems( - AEItemStack.create(i_mark[i]).setStackSize(Integer.MAX_VALUE), Actionable.SIMULATE, source); - i_shadow[i] = possible == null ? null : possible.getItemStack(); + AEItemStack.create(i_mark[i]).setStackSize(Long.MAX_VALUE), Actionable.SIMULATE, source); + i_shadow[i] = possible == null ? null : ItemStackG.fromAE(possible, intmaxs); if (i_shadow[i] != null) - i_saved[i] = i_shadow[i].stackSize; + i_saved[i] = i_shadow[i].stackSize(); } catch (GridAccessException e) { } } } for (int i = 0; i < 16; i++) { - f_shadow[i] = null; + f_shadow[i] .setFluid(null); f_saved[i] = 0; if (f_mark[i] != null) { try { IAEFluidStack possible = getProxy().getStorage().getFluidInventory().extractItems( - AEFluidStack.create(f_mark[i]).setStackSize(Integer.MAX_VALUE), Actionable.SIMULATE, - source); - f_shadow[i] = possible == null ? null : possible.getFluidStack(); + AEFluidStack.create(f_mark[i]).setStackSize(Long.MAX_VALUE), Actionable.SIMULATE, source); + f_shadow[i].fromAE(possible, intmaxs); if (f_shadow[i] != null) - f_saved[i] = f_shadow[i].amount; + f_saved[i] = f_shadow[i].getFluidAmount(); } catch (GridAccessException e) { } @@ -685,8 +753,8 @@ public void startRecipeProcessing() { public CheckRecipeResult endRecipeProcessing(MTEMultiBlockBase controller) { recipe = false; for (int i = 0; i < 16; i++) { - int current = i_shadow[i] == null ? 0 : i_shadow[i].stackSize; - int original = i_saved[i]; + long current = i_shadow[i] == null ? 0 : i_shadow[i].stackSize(); + long original = i_saved[i]; if (current > original) { throw new AssertionError("?"); } @@ -694,7 +762,7 @@ public CheckRecipeResult endRecipeProcessing(MTEMultiBlockBase controller) { throw new AssertionError("??"); } if (current < original) { - int delta = original - current; + long delta = original - current; if (i_mark[i] == null) { MyMod.LOG.fatal("marked item missing!"); controller.stopMachine(ShutDownReasonRegistry.CRITICAL_NONE); @@ -720,8 +788,8 @@ public CheckRecipeResult endRecipeProcessing(MTEMultiBlockBase controller) { } for (int i = 0; i < 16; i++) { - int current = f_shadow[i] == null ? 0 : f_shadow[i].amount; - int original = f_saved[i]; + long current = f_shadow[i] == null ? 0 : f_shadow[i].getFluidAmount(); + long original = f_saved[i]; if (current > original) { throw new AssertionError("?"); } @@ -729,7 +797,7 @@ public CheckRecipeResult endRecipeProcessing(MTEMultiBlockBase controller) { throw new AssertionError("??"); } if (current < original) { - int delta = original - current; + long delta = original - current; if (f_mark[i] == null) { MyMod.LOG.fatal("marked fluid missing!"); controller.stopMachine(ShutDownReasonRegistry.CRITICAL_NONE); @@ -770,13 +838,20 @@ protected void updateAllInformationSlots() { } ItemStack[] i_mark = new ItemStack[16]; - ItemStack[] i_shadow = new ItemStack[16]; + ItemStackG[] i_shadow = new ItemStackG[16]; ItemStack[] i_display = new ItemStack[16]; - int[] i_saved = new int[16]; + long[] i_saved = new long[16]; FluidStack[] f_mark = new FluidStack[16]; - FluidStack[] f_shadow = new FluidStack[16]; + FluidTankG[] f_shadow = new FluidTankG[16]; + { + + for(int i=0;i<16;i++){ + + f_shadow[i]=new FluidTankG(); + } + } FluidStack[] f_display = new FluidStack[16]; - int[] f_saved = new int[16]; + long[] f_saved = new long[16]; @Override public boolean justUpdated() { @@ -801,20 +876,26 @@ public Iterator inventories() { } public boolean isEmpty() { - for (ItemStack i : i_shadow) { - if (i != null && i.stackSize > 0) + for (ItemStackG i : i_shadow) { + if (i != null && i.stackSize() > 0) return false; } - for (FluidStack i : f_shadow) { - if (i != null && i.amount > 0) + for (FluidTankG i : f_shadow) { + if (i != null && i.getFluidAmount() > 0) return false; } return true; } + + private interface x extends IDualInputInventory,IDoNotCacheThisPattern{@Override + default boolean areYouSerious() { + return true; + }} + private Iterator getItr() { - IDualInputInventory xx = new IDualInputInventory() { + IDualInputInventory xx = new x() { @Override public boolean isEmpty() { @@ -823,12 +904,13 @@ public boolean isEmpty() { @Override public ItemStack[] getItemInputs() { - return DualInputHatch.filterStack.apply(i_shadow, new ItemStack[] { getStackInSlot(0) }); + return DualInputHatch.filterStack.apply(BufferedDualInputHatch.flat(i_shadow), + new ItemStack[] { getStackInSlot(0) }); } @Override public FluidStack[] getFluidInputs() { - return DualInputHatch.asFluidStack.apply(f_shadow); + return DualInputHatch.asFluidStack.apply(BufferedDualInputHatch.flat(f_shadow)); } @Override @@ -915,7 +997,8 @@ protected void updateValidGridProxySides() { } @Override - public void saveNBTData(NBTTagCompound aNBT) {aNBT.setBoolean("allowAuto",allowAuto); + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setBoolean("allowAuto", allowAuto); getProxy().writeToNBT(aNBT); super.saveNBTData(aNBT); NBTTagList nbtTagList = new NBTTagList(); @@ -944,23 +1027,46 @@ protected void updateValidGridProxySides() { } aNBT.setTag("storedItems", nbtTagList); - int[] sizesf = new int[16]; - for (int i = 0; i < 16; ++i) - sizesf[i] = f_display[i] == null ? 0 : f_display[i].amount; - aNBT.setIntArray("sizesF", sizesf); - int[] sizes = new int[16]; - for (int i = 0; i < 16; ++i) - sizes[i] = i_display[i] == null ? 0 : i_display[i].stackSize; - aNBT.setIntArray("sizes", sizes); + { + int[] sizesf = new int[16]; + for (int i = 0; i < 16; ++i) + sizesf[i] = f_display[i] == null ? 0 : f_display[i].amount; + aNBT.setIntArray("sizesF", sizesf); + int[] sizes = new int[16]; + for (int i = 0; i < 16; ++i) + sizes[i] = i_display[i] == null ? 0 : i_display[i].stackSize; + aNBT.setIntArray("sizes", sizes); + } + + + + { + ByteBuffer b = ByteBuffer.allocate(Long.SIZE / Byte.SIZE*16); + for (long l : i_client) { + b.putLong(l); + } + aNBT.setByteArray("clientDisplayValue", b.array()); + + b = ByteBuffer.allocate(Long.SIZE / Byte.SIZE*16); + for (long l : f_client) { + b.putLong(l); + } + aNBT.setByteArray("clientDisplayValueF", b.array()); + + } + aNBT.setBoolean("program", program); aNBT.setBoolean("autoPull", autoPullItemList); + + aNBT.setInteger("intmaxs", intmaxs); aNBT.setInteger("interval", interval); getProxy().writeToNBT(aNBT); } @Override - public void loadNBTData(NBTTagCompound aNBT) {allowAuto=aNBT.getBoolean("allowAuto" ); + public void loadNBTData(NBTTagCompound aNBT) { + allowAuto = aNBT.getBoolean("allowAuto"); getProxy().readFromNBT(aNBT); super.loadNBTData(aNBT); if (aNBT.hasKey("storedFluids")) { @@ -1011,13 +1117,36 @@ protected void updateValidGridProxySides() { if (i_mark[i] != null) { i_display[i] = i_mark[i].copy(); i_display[i].stackSize = size[i]; - + /* + * if(i_display[i].hasTagCompound()==false){ + * i_display[i].setTagCompound(new NBTTagCompound()); + * + * } i_display[i].getTagCompound().setLong("", value); + */ } } } - program=aNBT.getBoolean("program"); + if(aNBT.hasKey("clientDisplayValue")) + { + ByteBuffer b = ByteBuffer.allocate(8 * 16); + b.put(aNBT.getByteArray("clientDisplayValue")); + b.flip(); + LongBuffer l = b.asLongBuffer(); + for(int i=0;i<16;i++) + i_client[i] = l.get(); + + + b = ByteBuffer.allocate(8 * 16); + b.put(aNBT.getByteArray("clientDisplayValueF")); + b.flip(); + l = b.asLongBuffer(); + for(int i=0;i<16;i++) + f_client[i] = l.get(); + } + program = aNBT.getBoolean("program"); interval = aNBT.getInteger("interval"); + intmaxs = aNBT.getInteger("intmaxs"); autoPullItemList = aNBT.getBoolean("autoPull"); } @@ -1026,31 +1155,29 @@ protected void updateValidGridProxySides() { @Override public IGridNode getGridNode(ForgeDirection dir) { - + return getProxy().getNode(); } @Override public void securityBreak() { - - + } @Override public DimensionalCoord getLocation() { - - return new DimensionalCoord((TileEntity)this.getBaseMetaTileEntity()); - }; + + return new DimensionalCoord((TileEntity) this.getBaseMetaTileEntity()); + }; + @Override - public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] { aBaseTexture, - TextureFactory.of(MyMod.iohub ,MyMod.iohub.magicNO_overlay_dual_active) }; - } - - @Override - public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[] { aBaseTexture, - TextureFactory.of( MyMod.iohub,MyMod.iohub.magicNO_overlay_dual) }; - } + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, TextureFactory.of(MyMod.iohub, MyMod.iohub.magicNO_overlay_dual_active) }; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, TextureFactory.of(MyMod.iohub, MyMod.iohub.magicNO_overlay_dual) }; + } } diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/bufferutil/FluidTankG.java b/src/main/java/reobf/proghatches/gt/metatileentity/bufferutil/FluidTankG.java new file mode 100644 index 0000000..97fea3b --- /dev/null +++ b/src/main/java/reobf/proghatches/gt/metatileentity/bufferutil/FluidTankG.java @@ -0,0 +1,206 @@ +package reobf.proghatches.gt.metatileentity.bufferutil; + +import java.util.ArrayList; +import java.util.Iterator; + +import javax.annotation.Nonnull; + +import appeng.api.storage.data.IAEFluidStack; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; + +public class FluidTankG { + + ArrayList arr = new ArrayList(); + + public long getFluidAmount() { + + return arr.stream().mapToLong(s -> s.amount).sum(); + } + + public FluidStack getFluid() { + if (arr.size() > 0) { + FluidStack f = arr.get(0).copy(); + f.amount = (int) Math.min(getFluidAmount(), Integer.MAX_VALUE); + if (f.amount <= 0) + return null; + return f; + } + return null; + } + + public void setFluid(FluidStack object) { + arr.clear(); + if(object!=null) + arr.add(object); + + } + + public NBTBase writeToNBT(NBTTagCompound nbtTagCompound) { + if (arr.size() > 0) { + FluidTank tk = new FluidTank(0); + tk.setFluid(arr.get(0)); + tk.writeToNBT(nbtTagCompound); + } + NBTTagList lst = new NBTTagList(); + for (int i = 1; i < arr.size(); i++) { + + NBTTagCompound t = new NBTTagCompound(); + arr.get(i).writeToNBT(t); + //t.setInteger("ICount", arr.get(i).stackSize); + lst.appendTag(t); + + } + + nbtTagCompound.setTag("therest", lst); + + return nbtTagCompound; + } + + public void readFromNBT(NBTTagCompound compoundTag) { + + FluidTank tk = new FluidTank(0); + tk.readFromNBT(compoundTag); + if (tk.getFluidAmount() > 0) + arr.add(tk.getFluid()); + if (compoundTag.hasKey("therest")) { + + NBTTagList lst = (NBTTagList) compoundTag.getTag("therest"); + for (int ix = 0; ix < lst.tagCount(); ix++) { + NBTTagCompound TAG = lst.getCompoundTagAt(ix); + + FluidStack isX = FluidStack.loadFluidStackFromNBT(TAG); + if (isX != null) { + arr.add(isX); + } + + } + + } + } + + public int fill(FluidStack resource, boolean doFill) { + if (resource == null) { + return 0; + } + if (!doFill) { + return resource.amount; + } + + if (arr.size() > 0 && arr.get(0).getFluid() != resource.getFluid()) { + return 0; + } + int todo = resource.amount; + for (FluidStack is : arr) { + int cando = Math.min( + + Integer.MAX_VALUE + // 64 + + - is.amount, + todo); + todo -= cando; + is.amount += cando; + if (todo <= 0) + return resource.amount; + } + FluidStack i = resource.copy(); + i.amount = todo; + arr.add(i); + + return resource.amount; + } + + public FluidStack drain(int maxDrain, boolean doDrain) { + if (getFluidAmount() == 0) { + return null; + } + FluidStack cp = arr.get(0).copy(); + if (!doDrain) { + cp.amount = (int) Math.min(getFluidAmount(), Integer.MAX_VALUE); + return cp; + } + cp.amount = maxDrain; + for (FluidStack fs : arr) { + + int todo = Math.min(fs.amount, maxDrain); + fs.amount -= todo; + maxDrain -= todo; + if (maxDrain <= 0) + break; + } + + cp.amount = cp.amount - maxDrain; + + adjust(); + return cp; + } + + public FluidTankInfo getInfo() { + + return new FluidTankInfo(getFluid(), Integer.MAX_VALUE); + } + + public FluidStack[] flat() { + adjust(); + return arr.toArray(new FluidStack[arr.size()]); + } + + public void adjust() { + boolean dirty = false; + for (int i = 0; i < arr.size() - 1; i++) { + if (arr.get(i).amount < Integer.MAX_VALUE) { + if (arr.get(i + 1).amount > 0) { + int todo = Math.min(Integer.MAX_VALUE - arr.get(i).amount, arr.get(i + 1).amount); + arr.get(i).amount += todo; + arr.get(i + 1).amount -= todo; + dirty = true; + + } + } + + } + + if (dirty) { + Iterator it = arr.iterator(); + while (it.hasNext()) { + if (it.next().amount <= 0) { + it.remove(); + } + + } + + } + } + + public void fromAE(@Nonnull IAEFluidStack possible, int intmaxs) { + + + long all=possible.getStackSize(); + all=Math.min(all, intmaxs*1L*Integer.MAX_VALUE); + + long maxs=all/(1L*Integer.MAX_VALUE); + long remain=all-maxs*Integer.MAX_VALUE; + for(int i=0;i0){ + FluidStack is = possible.getFluidStack(); + is.amount=(int) Math.min(remain,Integer.MAX_VALUE); + arr.add(is); + } + + + + + + } + +} diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/bufferutil/ItemStackG.java b/src/main/java/reobf/proghatches/gt/metatileentity/bufferutil/ItemStackG.java index d53ff69..7b3d7a5 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/bufferutil/ItemStackG.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/bufferutil/ItemStackG.java @@ -3,6 +3,9 @@ import java.util.ArrayList; import java.util.Iterator; +import javax.annotation.Nonnull; + +import appeng.api.storage.data.IAEItemStack; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -18,7 +21,7 @@ public static ItemStackG neo(ItemStack is) { return null; return new ItemStackG(is); } - + private ItemStackG() {} private ItemStackG(ItemStack is) { arr.add(is); } @@ -170,4 +173,28 @@ public static ItemStackG setZero(ItemStackG itemStackG, ItemStack copyStackWithS } } + public static ItemStackG fromAE(@Nonnull IAEItemStack possible, int intmaxs) { + ItemStackG ret=new ItemStackG(); + + long all=possible.getStackSize(); + all=Math.min(all, intmaxs*1L*Integer.MAX_VALUE); + + long maxs=all/(1L*Integer.MAX_VALUE); + long remain=all-maxs*Integer.MAX_VALUE; + for(int i=0;i0){ + ItemStack is = possible.getItemStack(); + is.stackSize=(int) Math.min(remain,Integer.MAX_VALUE); + ret.arr.add(is); + } + + + + return ret; + } + } diff --git a/src/main/resources/assets/proghatches/lang/en_US.lang b/src/main/resources/assets/proghatches/lang/en_US.lang index b4766c6..74c75e0 100644 --- a/src/main/resources/assets/proghatches/lang/en_US.lang +++ b/src/main/resources/assets/proghatches/lang/en_US.lang @@ -766,3 +766,7 @@ proghatches.amountmaintainer.interval.0=Update interval in tick(s) hatch.dualinput.stocking.me.name=Stocking Dual Input Hatch (ME) hatch.dualinput.stocking.autopull.me.name=Advanced Stocking Dual Input Hatch (ME) hatch.dualinput.stocking.autopull.program=Auto consume Programming Circuit and set the virtual circuit slot +proghatch.stockingdual.exceedintmax=Actual pulled amount exceeds 2.1G, check tooltips for real amount! +proghatch.stockingdual.intmax=Max pull amount (in int.max) +proghatch.stockingdual.intmax.tooltips=Maximum amount allowed to pull in multiples of int.max(2.1G). Do not set to a large number especially when you has 9.2E item/fluid in storage. + diff --git a/src/main/resources/assets/proghatches/lang/zh_CN.lang b/src/main/resources/assets/proghatches/lang/zh_CN.lang index 4f98917..315bec9 100644 --- a/src/main/resources/assets/proghatches/lang/zh_CN.lang +++ b/src/main/resources/assets/proghatches/lang/zh_CN.lang @@ -764,3 +764,7 @@ proghatches.amountmaintainer.interval.0=更新间隔(单位tick) hatch.dualinput.stocking.me.name=库存二合一输入仓(ME) hatch.dualinput.stocking.autopull.me.name=进阶库存二合一输入仓(ME) hatch.dualinput.stocking.autopull.program=自动消耗编程器电路设置虚拟电路槽 +proghatch.stockingdual.exceedintmax=拉取数量超过2.1G, 查看tooltips获取真实数量! +proghatch.stockingdual.intmax=最大拉取数量 (单位:int.max) +proghatch.stockingdual.intmax.tooltips=最多能拉取int.max(2.1G)的几倍 不要设太大,尤其是当存储中有9.2E个物品时(比如无限水元件),否则可能会非常卡甚至损坏你的存档 +