Extract ++ and -- from expressions

This commit is contained in:
thatsIch
2015-03-26 11:07:26 +01:00
parent b31f2df58d
commit 9bf8b4388f
26 changed files with 89 additions and 40 deletions
+11 -4
View File
@@ -245,8 +245,9 @@ public class Platform
int pos = 0;
for (Object g : valList)
{
if ( pos++ == pLoc )
if ( pos == pLoc )
return (T) g;
pos++;
}
return null;
@@ -297,8 +298,9 @@ public class Platform
int pos = 0;
for (Object g : valList)
{
if ( pos++ == pLoc )
if ( pos == pLoc )
return (T) g;
pos++;
}
return null;
@@ -992,8 +994,12 @@ public class Platform
{
int index = RANDOM_GENERATOR.nextInt( outs.size() );
Iterator<T> i = outs.iterator();
while (i.hasNext() && index-- > 0)
while (i.hasNext() && index > 0)
{
index--;
i.next();
}
index--;
if ( i.hasNext() )
return i.next();
return null; // wtf?
@@ -1524,7 +1530,8 @@ public class Platform
for (Integer Side : sides)
{
int c = (Side << (offset++ % 8)) ^ (1 << dir.ordinal());
int c = (Side << ( offset % 8)) ^ (1 << dir.ordinal());
offset++;
hash = c + (hash << 6) + (hash << 16) - hash;
}
}
@@ -326,7 +326,8 @@ public class AdaptorIInventory extends InventoryAdaptor
this.is.isExtractable = AdaptorIInventory.this.canRemoveStackFromSlot( this.x, iss );
this.is.setItemStack( iss );
this.is.slot = this.x++;
this.is.slot = this.x;
this.x++;
return this.is;
}
@@ -50,7 +50,8 @@ public class IMEAdaptorIterator implements Iterator<ItemSlot>
@Override
public ItemSlot next()
{
this.slot.slot = this.offset++;
this.slot.slot = this.offset;
this.offset++;
this.slot.isExtractable=true;
if ( this.parent.maxSlots < this.offset )
@@ -45,7 +45,9 @@ public class AEInvIterator implements Iterator<IAEItemStack>
@Override
public IAEItemStack next()
{
return this.inv.getAEStackInSlot( this.x++ );
IAEItemStack result = this.inv.getAEStackInSlot( this.x );
this.x++;
return result;
}
@Override
@@ -39,7 +39,9 @@ public class ChainedIterator<T> implements Iterator<T>
@Override
public T next()
{
return this.list[this.offset++];
T result = this.list[this.offset];
this.offset++;
return result;
}
@Override
@@ -45,7 +45,9 @@ public class InvIterator implements Iterator<ItemStack>
@Override
public ItemStack next()
{
return this.inv.getStackInSlot( this.x++ );
ItemStack result = this.inv.getStackInSlot( this.x );
this.x++;
return result;
}
@Override
@@ -44,7 +44,8 @@ public class StackToSlotIterator implements Iterator<ItemSlot>
@Override
public ItemSlot next()
{
this.iss.slot = this.x++;
this.iss.slot = this.x;
this.x++;
this.iss.setItemStack( this.is.next() );
return this.iss;
}