From 7595876bb85f787f6ef6291f37edc585466539e6 Mon Sep 17 00:00:00 2001 From: reobf <2215595288@qq.com> Date: Fri, 24 Jan 2025 12:46:42 +0800 Subject: [PATCH] update --- dependencies.gradle | 2 +- .../proghatches/ae/TileRequestTunnel.java | 38 +++++++++++++++++-- .../gt/metatileentity/SuperChestME.java | 26 +++++++++++-- .../gt/metatileentity/SuperTankME.java | 19 +++++++++- .../assets/proghatches/lang/en_US.lang | 2 +- 5 files changed, 77 insertions(+), 10 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 74fcab9..dcabfe3 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -84,7 +84,7 @@ dependencies { api rfg.deobf("curse.maven:cofh-core-69162:2388751") api("com.github.GTNewHorizons:Nuclear-Control:2.6.7:dev") { transitive = false } api("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") { transitive = false } - implementation("com.github.GTNewHorizons:Hodgepodge:2.6.0:dev") + //implementation("com.github.GTNewHorizons:Hodgepodge:2.6.0:dev") api('com.github.GTNewHorizons:Botania:1.12.1-GTNH:dev') { transitive = false } api('com.github.GTNewHorizons:HoloInventory:2.4.13-GTNH:dev') { transitive = false } api rfg.deobf("curse.maven:extra-utilities-225561:2264384") diff --git a/src/main/java/reobf/proghatches/ae/TileRequestTunnel.java b/src/main/java/reobf/proghatches/ae/TileRequestTunnel.java index c74b5c4..4392431 100644 --- a/src/main/java/reobf/proghatches/ae/TileRequestTunnel.java +++ b/src/main/java/reobf/proghatches/ae/TileRequestTunnel.java @@ -392,13 +392,43 @@ public IAEItemStack injectCraftedItems(ICraftingLink link, IAEItemStack items, A }*/ + AEItemStack left=null; + + Long get = waiting.get((items)); + if(get!=null){ + long tmp; + waiting.put((AEItemStack) items,tmp=Math.max(0,get-items.getStackSize())); + if(tmp<=0)waiting.remove(items); + + if((this.mode&1)!=0){ + if(get inv=new HashMap(); @@ -507,7 +537,7 @@ public void jobStateChange(ICraftingLink link) { - + if((mode&2)==0||last==null) useExisting(); } if(this.tick%40==2){ @@ -626,11 +656,13 @@ protected void fillStacksIntoFirstSlots( ArrayList mInventory) { } } + + int mode; private void useExisting() { for(Iterator> itr = waiting.entrySet().iterator();itr.hasNext();){ Entry e=itr.next(); - + if(e.getValue()<=0){itr.remove();continue;} IAEItemStack val = e.getKey().copy().setStackSize(e.getValue()); diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/SuperChestME.java b/src/main/java/reobf/proghatches/gt/metatileentity/SuperChestME.java index e329188..645974e 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/SuperChestME.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/SuperChestME.java @@ -195,8 +195,25 @@ private void post(){ //this.getProxy().getGrid().postEvent(new MENetworkCellArrayUpdate()); //this.getProxy().getGrid().postEvent(new MENetworkStorageEvent(handler0, StorageChannel.ITEMS)); try { - + if(last!=null){ + if(mInventory[0]!=null){ + if(last.equals(mInventory[0])){ + if(last.getStackSize()==mInventory[0].stackSize) + {return;}else{ + + this.getProxy().getStorage() + .postAlterationOfStoredItems(StorageChannel.ITEMS, + ImmutableList.of(last.copy().setStackSize(mInventory[0].stackSize-last.getStackSize())) + ,new MachineSource(this)); + last=AEItemStack.create(mInventory[0]); + return; + } + } + + }; + + this.getProxy().getStorage() .postAlterationOfStoredItems(StorageChannel.ITEMS, ImmutableList.of(last.copy().setStackSize(-last.getStackSize())) @@ -214,7 +231,7 @@ private void post(){ } catch (final GridAccessException ignore) {} } catch (Exception e) { // TODO Auto-generated catch block - //e.printStackTrace(); + e.printStackTrace(); } }/* @@ -426,7 +443,10 @@ public IAEItemStack injectItems(IAEItemStack input, Actionable type, BaseActionS @Override public IAEItemStack extractItems(IAEItemStack input, Actionable type, BaseActionSource src) { - try{post(); + try{ + + if(type!=Actionable.SIMULATE)post(); + ItemStack in=input.getItemStack(); ItemStack thiz=mInventory[0]; if(thiz!=null&&!Platform.isSameItem(in, thiz))return null; diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/SuperTankME.java b/src/main/java/reobf/proghatches/gt/metatileentity/SuperTankME.java index 859d141..7f5bca6 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/SuperTankME.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/SuperTankME.java @@ -174,6 +174,21 @@ private void post(){ try { if(last!=null){ + if(content.getFluid()!=null){ + if(last.equals(content.getFluid())){ + if(last.getStackSize()==content.getFluid().amount) + {return;}else{ + + this.getProxy().getStorage() + .postAlterationOfStoredItems(StorageChannel.FLUIDS, + ImmutableList.of(last.copy().setStackSize(content.getFluid().amount-last.getStackSize())) + ,new MachineSource(this)); + last=AEFluidStack.create(content.getFluid()); + return; + } + } + + }; this.getProxy().getStorage() .postAlterationOfStoredItems(StorageChannel.FLUIDS, ImmutableList.of(last.copy().setStackSize(-last.getStackSize())) @@ -195,7 +210,7 @@ private void post(){ } catch (Exception e) { // TODO Auto-generated catch block - //e.printStackTrace(); + e.printStackTrace(); } }/* @@ -401,7 +416,7 @@ public IAEFluidStack injectItems(IAEFluidStack input, Actionable type, BaseActio @Override public IAEFluidStack extractItems(IAEFluidStack input, Actionable type, BaseActionSource src) { - post(); + if(type!=Actionable.SIMULATE)post(); try{ if(content.getFluid()!=null&&content.getFluid().getFluid()!=input.getFluid() ){return null;} diff --git a/src/main/resources/assets/proghatches/lang/en_US.lang b/src/main/resources/assets/proghatches/lang/en_US.lang index 43c2a66..cde513d 100644 --- a/src/main/resources/assets/proghatches/lang/en_US.lang +++ b/src/main/resources/assets/proghatches/lang/en_US.lang @@ -734,7 +734,7 @@ item.emitterpattern.name.tooltip.0=A special pattern without inputs. Click RMB w item.emitterpattern.name.tooltip.1=It's like an ME Level Emitter with Crafting Card, but pushes pattern instead of sending RS signal. item.emitterpattern.name.tooltip.2=This pattern will not send materials when being pushed, but Crafting CPU will add outputs to waiting list. item.emitterpattern.name.tooltip.3=Especially, Crafting Request Tunnel will capture the outputs when accepting this pattern. -proghatch.request_tunnel.tooltip.0=§7This is an §cMA§7 device, it's like a §cM§7olecular §cA§7ssembler, accepts patterns rather than materials from patterns. +proghatch.request_tunnel.tooltip.0=§7This is an §cMA§7 device, it's like a §cM§7olecular §cA§7ssembler, but accepts patterns rather than materials from patterns. proghatch.request_tunnel.tooltip.1=When accepting patterns, it stores inputs into storage and records outputs. Then craft or extract materials to satisfy those outputs. proghatch.request_tunnel.tooltip.2=Outputs will be cached in inventory, use pipes to send them back, or use wrench to specify the auto-output direction. proghatch.request_tunnel.tooltip.3=Please use ME Interface (even if pattern contains fluids), ME Dual Interface does not work fine!