Skip to content

Commit d8a3e9d

Browse files
ApeironTsukaApeiron
andauthored
Fix MC1243 (Distributor) off-by-one error (#1183)
* Would distribute right+1 to the right before Co-authored-by: Apeiron <apeiron@none>
1 parent b53bc8b commit d8a3e9d

File tree

1 file changed

+3
-3
lines changed
  • src/main/java/com/sk89q/craftbook/mechanics/ic/gates/world/items

1 file changed

+3
-3
lines changed

src/main/java/com/sk89q/craftbook/mechanics/ic/gates/world/items/Distributer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ public boolean goRight() {
112112

113113
currentIndex++;
114114
getSign().setLine(3, String.valueOf(currentIndex));
115-
if (currentIndex >= left && currentIndex <= left+right)
115+
if (currentIndex >= left && currentIndex < left+right)
116116
return true;
117-
else if (currentIndex <= left)
117+
else if (currentIndex < left)
118118
return false;
119119
else {
120120
currentIndex = 0;
@@ -173,4 +173,4 @@ public void onPipeTransfer(PipePutEvent event) {
173173

174174
event.setItems(leftovers);
175175
}
176-
}
176+
}

0 commit comments

Comments
 (0)