Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
reobf committed Feb 14, 2025
1 parent 6e6eedb commit 4ad703e
Show file tree
Hide file tree
Showing 8 changed files with 461 additions and 442 deletions.
40 changes: 40 additions & 0 deletions src/main/java/reobf/proghatches/ae/PartAmountMaintainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ public boolean shouldProceed(boolean red, boolean lastredstone) {

Future<ICraftingJob> job;
ICraftingLink link;
int interval=1;
int interval_count=0;
int reqcooldown;


public void requestForMissing(IAEStack primitive) {
if (upgrade[1] == null) return;
Expand Down Expand Up @@ -260,6 +263,17 @@ public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall)
inv.clear();
return TickRateModulation.SAME;
}

interval_count++;
if(interval_count>=interval){
interval_count=0;
} else{
return TickRateModulation.SAME;
}




if (getProxy().isActive() == false) return TickRateModulation.SAME;
for (StorageChannel ch : new StorageChannel[] { StorageChannel.FLUIDS, StorageChannel.ITEMS }) {
IMEInventory inv = getInv(ch);
Expand Down Expand Up @@ -329,6 +343,7 @@ public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall)
Actionable.SIMULATE,
source);
long missing = -amount + expected - (take == null ? 0 : take.getStackSize());

if (missing > 0) requestForMissing(
is.copy()
.setStackSize(missing));
Expand Down Expand Up @@ -712,6 +727,23 @@ public int getSlotLimit(int slot) {
}.setPos(60 + 40, 3 + 20)
.addTooltip(StatCollector.translateToLocal("proghatches.amountmaintainer.craftcard")));


builder.widget(
new NumericWidget().setSetter(val -> interval = (int) val)
.setGetter(() -> interval)
.setBounds(1, 400)
.setScrollValues(1, 4, 64)
.setTextAlignment(Alignment.Center)
.setTextColor(Color.WHITE.normal)
.setSize(40, 18)
.setPos(60 + 18+40, 3+20)
.setBackground(GTUITextures.BACKGROUND_TEXT_FIELD)
.addTooltips(
Arrays.asList(
StatCollector.translateToLocal("proghatches.amountmaintainer.interval.0")
)

));
return builder.build();
}

Expand Down Expand Up @@ -765,6 +797,10 @@ public void readFromNBT(NBTTagCompound data) {
mode = data.getInteger("mode");
rsmode = data.getInteger("rsmode");
redstone = data.getInteger("redstone");
interval=data.getInteger("interval");
if(interval<1){interval=1;}
interval_count=data.getInteger("interval_count");

amount = data.getLong("amount");
lastredstone = data.getBoolean("lastredstone");
mark[0] = ItemStack.loadItemStackFromNBT(data.getCompoundTag("mark"));
Expand Down Expand Up @@ -806,6 +842,10 @@ public void writeToNBT(NBTTagCompound data) {
data.setInteger("mode", mode);
data.setInteger("rsmode", rsmode);
data.setInteger("redstone", redstone);
data.setInteger("interval", interval);
data.setInteger("interval_count", interval_count);


data.setLong("amount", amount);
data.setBoolean("lastredstone", lastredstone);
if (mark[0] != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,8 @@ public String getName() {
StringBuilder name = new StringBuilder();

name.append(
m.getMachineCraftingIcon()
.getDisplayName());
Optional.ofNullable(m.getMachineCraftingIcon()).map(s->s.getDisplayName()+"(Mapped)")
.orElse(m.getLocalName()==null?"":m.getLocalName()+"(Mapped)"));
if (m.mInventory[m.getCircuitSlot()] != null) {
name.append(" - ");
ItemStack is = m.mInventory[m.getCircuitSlot()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot;
import com.gtnewhorizons.modularui.common.widget.SlotGroup;

import appeng.api.util.DimensionalCoord;
import appeng.util.Platform;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTechAPI;
Expand Down Expand Up @@ -159,10 +161,24 @@ public void saveNBTData(NBTTagCompound compound) {

public boolean dump(ItemStack aStack) {
boolean b = filterPredicate.test(aStack);
if (b && fx) MyMod.net.sendToDimension(
if (b && fx)
MyMod.net.sendToAllAround(



new VoidFXMessage(this.getBaseMetaTileEntity(), aStack),
this.getBaseMetaTileEntity()
.getWorld().provider.dimensionId);
new TargetPoint( this.getBaseMetaTileEntity().getWorld().provider.dimensionId,
this.getBaseMetaTileEntity().getXCoord(),
this.getBaseMetaTileEntity().getYCoord(),
this.getBaseMetaTileEntity().getZCoord(),
64
)
);





return b;
}

Expand Down
Loading

0 comments on commit 4ad703e

Please sign in to comment.