backport potential bugfix from 7.2.x branch

This commit is contained in:
Adrian Siekierka 2017-11-11 13:08:03 +01:00
parent b429080afc
commit e853ceb5d6
2 changed files with 8 additions and 2 deletions

View file

@ -1,4 +1,5 @@
Bugs fixed:
* [#3839] Attempt to work around potential world corruption?
* [#3837] Oil spawn in mid-air on superflat, f
* [#3837] Oil spawn in mid-air on superflat
* Potential direction statement parameter crash in gate GUI

View file

@ -50,7 +50,12 @@ public class StatementParameterDirection implements IStatementParameter {
public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse) {
if (source.getTile() instanceof IPipeTile) {
for (int i = 0; i < 6; i++) {
direction = ForgeDirection.getOrientation((direction.ordinal() + (mouse.getButton() > 0 ? -1 : 1)) % 6);
int dir = (direction.ordinal() + (mouse.getButton() > 0 ? -1 : 1)) % 6;
if (dir < 0) {
dir += 6;
}
direction = ForgeDirection.getOrientation(dir);
if (((IPipeTile) source.getTile()).isPipeConnected(direction)) {
return;
}