Extract ++ and -- from expressions
This commit is contained in:
@@ -688,7 +688,8 @@ public class RenderBlocksWorkaround extends RenderBlocks
|
||||
for (int k = -1; k <= 1; k++)
|
||||
{
|
||||
|
||||
this.lightHashTmp[o++] = blk.getMixedBrightnessForBlock( this.blockAccess, x + i, y + j, z + k );
|
||||
this.lightHashTmp[o] = blk.getMixedBrightnessForBlock( this.blockAccess, x + i, y + j, z + k );
|
||||
o++;
|
||||
}
|
||||
|
||||
return Arrays.hashCode( this.lightHashTmp );
|
||||
|
||||
@@ -91,11 +91,13 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU
|
||||
int spin = 0;
|
||||
|
||||
int max = 5;
|
||||
while (walrus != cmt.getUp() && max-- > 0)
|
||||
while (walrus != cmt.getUp() && max > 0)
|
||||
{
|
||||
max--;
|
||||
spin++;
|
||||
walrus = Platform.rotateAround( walrus, side );
|
||||
}
|
||||
max--;
|
||||
|
||||
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
||||
GL11.glTranslated( side.offsetX * 0.69, side.offsetY * 0.69, side.offsetZ * 0.69 );
|
||||
|
||||
@@ -68,9 +68,10 @@ public class VibrantFX extends EntityFX
|
||||
// this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.particleScale *= 0.95;
|
||||
|
||||
if ( this.particleMaxAge-- <= 0 || this.particleScale < 0.1 )
|
||||
if ( this.particleMaxAge <= 0 || this.particleScale < 0.1 )
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
this.particleMaxAge--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +172,8 @@ public abstract class AEBaseContainer extends Container
|
||||
int page = 0;
|
||||
for (byte[] packet : miniPackets)
|
||||
{
|
||||
PacketPartialItem ppi = new PacketPartialItem( page++, miniPackets.size(), packet );
|
||||
PacketPartialItem ppi = new PacketPartialItem( page, miniPackets.size(), packet );
|
||||
page++;
|
||||
NetworkHandler.instance.sendToServer( ppi );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,7 +223,10 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
|
||||
|
||||
for (int w = 0; w < 7; w++)
|
||||
for (int z = 0; z < 9; z++)
|
||||
this.addSlotToContainer( new SlotFakeTypeOnly( inv, offset++, x + z * 18, y + w * 18 ) );
|
||||
{
|
||||
this.addSlotToContainer( new SlotFakeTypeOnly( inv, offset, x + z * 18, y + w * 18 ) );
|
||||
offset++;
|
||||
}
|
||||
|
||||
for (int zz = 0; zz < 3; zz++)
|
||||
for (int z = 0; z < 8; z++)
|
||||
|
||||
@@ -32,9 +32,6 @@ import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -44,6 +41,9 @@ import net.minecraftforge.common.config.ConfigCategory;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketNewStorageDimension;
|
||||
@@ -402,7 +402,8 @@ public class WorldSettings extends Configuration
|
||||
|
||||
private long nextGridStorage()
|
||||
{
|
||||
long r = this.lastGridStorage++;
|
||||
long r = this.lastGridStorage;
|
||||
this.lastGridStorage++;
|
||||
this.get( "Counters", "lastGridStorage", this.lastGridStorage ).set( Long.toString( this.lastGridStorage ) );
|
||||
return r;
|
||||
}
|
||||
@@ -444,7 +445,8 @@ public class WorldSettings extends Configuration
|
||||
|
||||
private long nextPlayer()
|
||||
{
|
||||
long r = this.lastPlayer++;
|
||||
long r = this.lastPlayer;
|
||||
this.lastPlayer++;
|
||||
this.get( "Counters", "lastPlayer", this.lastPlayer ).set( this.lastPlayer );
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ public class CraftingJob implements Runnable, ICraftingJob
|
||||
|
||||
public void handlePausing() throws InterruptedException
|
||||
{
|
||||
if ( this.incTime++ > 100 )
|
||||
if ( this.incTime > 100 )
|
||||
{
|
||||
this.incTime = 0;
|
||||
|
||||
@@ -354,6 +354,7 @@ public class CraftingJob implements Runnable, ICraftingJob
|
||||
if ( Thread.interrupted() )
|
||||
throw new InterruptedException();
|
||||
}
|
||||
this.incTime++;
|
||||
}
|
||||
|
||||
private void log(String string)
|
||||
|
||||
@@ -60,11 +60,12 @@ final public class EntityChargedQuartz extends AEBaseEntityItem
|
||||
if ( !AEConfig.instance.isFeatureEnabled( AEFeature.inWorldFluix ) )
|
||||
return;
|
||||
|
||||
if ( Platform.isClient() && this.delay++ > 30 && AEConfig.instance.enableEffects )
|
||||
if ( Platform.isClient() && this.delay > 30 && AEConfig.instance.enableEffects )
|
||||
{
|
||||
CommonHelper.proxy.spawnEffect( EffectType.Lightning, this.worldObj, this.posX, this.posY, this.posZ, null );
|
||||
this.delay = 0;
|
||||
}
|
||||
this.delay++;
|
||||
|
||||
int j = MathHelper.floor_double( this.posX );
|
||||
int i = MathHelper.floor_double( this.posY );
|
||||
|
||||
@@ -48,8 +48,9 @@ final public class EntityFloatingItem extends EntityItem
|
||||
if ( !this.isDead && this.parent.isDead )
|
||||
this.setDead();
|
||||
|
||||
if ( this.superDeath++ > 100 )
|
||||
if ( this.superDeath > 100 )
|
||||
this.setDead();
|
||||
this.superDeath++;
|
||||
|
||||
this.age = ageStatic;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,8 @@ final public class EntitySingularity extends AEBaseEntityItem
|
||||
|
||||
ItemStack Output = AEApi.instance().materials().materialQESingularity.stack( 2 );
|
||||
NBTTagCompound cmp = Platform.openNbtData( Output );
|
||||
cmp.setLong( "freq", ( new Date() ).getTime() * 100 + ( randTickSeed++ ) % 100 );
|
||||
cmp.setLong( "freq", ( new Date() ).getTime() * 100 + ( randTickSeed ) % 100 );
|
||||
randTickSeed++;
|
||||
item.stackSize--;
|
||||
|
||||
this.worldObj.spawnEntityInWorld( new EntitySingularity( this.worldObj, this.posX, this.posY, this.posZ, Output ) );
|
||||
|
||||
@@ -91,7 +91,7 @@ final public class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
if ( this.fuse-- <= 0 )
|
||||
if ( this.fuse <= 0 )
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
@@ -104,6 +104,7 @@ final public class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
|
||||
{
|
||||
this.worldObj.spawnParticle( "smoke", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D );
|
||||
}
|
||||
this.fuse--;
|
||||
}
|
||||
|
||||
// override :P
|
||||
|
||||
@@ -232,12 +232,18 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
|
||||
int offset = 0;
|
||||
this.condensedInputs = new IAEItemStack[tmpInputs.size()];
|
||||
for (IAEItemStack io : tmpInputs.values())
|
||||
this.condensedInputs[offset++] = io;
|
||||
{
|
||||
this.condensedInputs[offset] = io;
|
||||
offset++;
|
||||
}
|
||||
|
||||
offset = 0;
|
||||
this.condensedOutputs = new IAEItemStack[tmpOutputs.size()];
|
||||
for (IAEItemStack io : tmpOutputs.values())
|
||||
this.condensedOutputs[offset++] = io;
|
||||
{
|
||||
this.condensedOutputs[offset] = io;
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.hooks;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
@@ -27,10 +28,6 @@ import java.util.WeakHashMap;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
import com.google.common.collect.LinkedListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.world.ChunkEvent;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
@@ -41,6 +38,10 @@ import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Type;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
import com.google.common.collect.LinkedListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.parts.CableRenderMode;
|
||||
@@ -118,8 +119,9 @@ public class TickHandler
|
||||
while (i.hasNext())
|
||||
{
|
||||
PlayerColor pc = i.next();
|
||||
if ( pc.ticksLeft-- <= 0 )
|
||||
if ( pc.ticksLeft <= 0 )
|
||||
i.remove();
|
||||
pc.ticksLeft--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if ( errCount++ >= 5 )
|
||||
if ( errCount >= 5 )
|
||||
{
|
||||
CraftGuideLog
|
||||
.log( "CraftGuide DefaultRecipeProvider: Stack trace limit reached, further stack traces from this invocation will not be logged to the console. They will still be logged to (.minecraft)/config/CraftGuide/CraftGuide.log",
|
||||
@@ -167,6 +167,7 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
errCount++;
|
||||
|
||||
CraftGuideLog.log( e );
|
||||
}
|
||||
|
||||
@@ -89,7 +89,8 @@ public class QuantumCalculator extends MBCalculator
|
||||
flags = (byte) (this.tqb.corner | num);
|
||||
else
|
||||
flags = num;
|
||||
c.Ring[ringNum++] = te;
|
||||
c.Ring[ringNum] = te;
|
||||
ringNum++;
|
||||
}
|
||||
|
||||
te.updateStatus( c, flags, true );
|
||||
|
||||
@@ -44,7 +44,9 @@ public class NonNullArrayIterator<E> implements Iterator<E>
|
||||
@Override
|
||||
public E next()
|
||||
{
|
||||
return this.g[this.offset++];
|
||||
E result = this.g[this.offset];
|
||||
this.offset++;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -103,7 +103,9 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
|
||||
for (int cSlot = 0; cSlot < slotCount; cSlot++)
|
||||
{
|
||||
cSidesList[cSlot] = offsetForLayer;
|
||||
slots.set( offsetForLayer++, new InvSot( sides, offsetForPart++ ) );
|
||||
slots.set( offsetForLayer, new InvSot( sides, offsetForPart ) );
|
||||
offsetForLayer++;
|
||||
offsetForPart++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,8 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
|
||||
if ( recipe[idx] instanceof String[] )
|
||||
{
|
||||
String[] parts = ((String[]) recipe[idx++]);
|
||||
String[] parts = ((String[]) recipe[idx]);
|
||||
idx++;
|
||||
|
||||
for (String s : parts)
|
||||
{
|
||||
@@ -86,7 +87,8 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
{
|
||||
while (recipe[idx] instanceof String)
|
||||
{
|
||||
String s = (String) recipe[idx++];
|
||||
String s = (String) recipe[idx];
|
||||
idx++;
|
||||
shape.append( s );
|
||||
this.width = s.length();
|
||||
this.height++;
|
||||
@@ -131,7 +133,8 @@ public class ShapedRecipe implements IRecipe, IRecipeBakeable
|
||||
int x = 0;
|
||||
for (char chr : shape.toString().toCharArray())
|
||||
{
|
||||
this.input[x++] = itemMap.get( chr );
|
||||
this.input[x] = itemMap.get( chr );
|
||||
x++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +176,8 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
|
||||
{
|
||||
NBTTagCompound it = new NBTTagCompound();
|
||||
ais.getItemStack().writeToNBT( it );
|
||||
storedItems.setTag( String.valueOf( offset++ ), it );
|
||||
storedItems.setTag( String.valueOf( offset ), it );
|
||||
offset++;
|
||||
}
|
||||
|
||||
data.setTag( "storedItems", storedItems );
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user