Skip to content

Commit 8b31dbe

Browse files
committed
make precise bus only perform output once in redstone pulse mode
1 parent 5680742 commit 8b31dbe

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/main/java/com/glodblock/github/extendedae/common/parts/PartPreciseExportBus.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import appeng.api.behaviors.StackTransferContext;
44
import appeng.api.config.Actionable;
5+
import appeng.api.config.RedstoneMode;
56
import appeng.api.config.Settings;
67
import appeng.api.config.YesNo;
78
import appeng.api.networking.IGrid;
@@ -150,7 +151,7 @@ protected boolean doBusWork(IGrid grid) {
150151
break;
151152
}
152153

153-
long ceil = simulateExtract(context, what, before * transferFactor) / amount * amount;
154+
long ceil = this.checkPulseRS() ? simulateExtract(context, what, amount) : (simulateExtract(context, what, before * transferFactor) / amount * amount);
154155
long canHold = getExportStrategy().push(what, ceil, Actionable.SIMULATE) / amount * amount;
155156
if (canHold > 0) {
156157
var realSend = getExportStrategy().transfer(context, what, canHold);
@@ -172,6 +173,13 @@ protected boolean doBusWork(IGrid grid) {
172173
return context.hasDoneWork();
173174
}
174175

176+
private boolean checkPulseRS() {
177+
if (this.getUpgrades().isInstalled(AEItems.REDSTONE_CARD)) {
178+
return this.getRSMode() == RedstoneMode.SIGNAL_PULSE;
179+
}
180+
return false;
181+
}
182+
175183
@Override
176184
public IPartModel getStaticModels() {
177185
if (this.isActive() && this.isPowered()) {

0 commit comments

Comments
 (0)