Assignment replaceable with operator assignment

This commit is contained in:
thatsIch 2015-03-26 10:41:45 +01:00
parent 8ef286b9d6
commit bd2ee1c5ea
15 changed files with 34 additions and 33 deletions

View file

@ -173,7 +173,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
int viewStart = 0;// myScrollBar.getCurrentScroll() * 5; int viewStart = 0;// myScrollBar.getCurrentScroll() * 5;
int viewEnd = viewStart + 5 * 4; int viewEnd = viewStart + 5 * 4;
String ToolTip = ""; String toolTip = "";
int toolPosX = 0; int toolPosX = 0;
int toolPosY = 0; int toolPosY = 0;
@ -199,11 +199,11 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
if ( this.tooltip == z - viewStart ) if ( this.tooltip == z - viewStart )
{ {
ToolTip = Platform.getItemDisplayName( this.repo.getItem( z ) ); toolTip = Platform.getItemDisplayName( this.repo.getItem( z ) );
ToolTip = ToolTip + ( '\n' + GuiText.Installed.getLocal() + ": " + (refStack.getStackSize())); toolTip += ( '\n' + GuiText.Installed.getLocal() + ": " + ( refStack.getStackSize() ) );
if ( refStack.getCountRequestable() > 0 ) if ( refStack.getCountRequestable() > 0 )
ToolTip = ToolTip + ( '\n' + GuiText.EnergyDrain.getLocal() + ": " + Platform.formatPowerLong( refStack.getCountRequestable(), true )); toolTip += ( '\n' + GuiText.EnergyDrain.getLocal() + ": " + Platform.formatPowerLong( refStack.getCountRequestable(), true ) );
toolPosX = x * sectionLength + xo + sectionLength - 8; toolPosX = x * sectionLength + xo + sectionLength - 8;
toolPosY = y * 18 + yo; toolPosY = y * 18 + yo;
@ -222,10 +222,10 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
} }
if ( this.tooltip >= 0 && ToolTip.length() > 0 ) if ( this.tooltip >= 0 && toolTip.length() > 0 )
{ {
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
this.drawTooltip( toolPosX, toolPosY + 10, 0, ToolTip ); this.drawTooltip( toolPosX, toolPosY + 10, 0, toolTip );
GL11.glPopAttrib(); GL11.glPopAttrib();
} }

View file

@ -118,7 +118,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender
{ {
if ( cr.spin ) if ( cr.spin )
{ {
now = now % 100000; now %= 100000;
this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f ); this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f );
} }
else else
@ -139,14 +139,14 @@ public class RenderBlockSkyCompass extends BaseBlockRender
} }
else else
{ {
now = now % 1000000; now %= 1000000;
this.model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f ); this.model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f );
} }
} }
else else
{ {
now = now % 100000; now %= 100000;
this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f ); this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f );
} }
@ -195,7 +195,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender
{ {
if ( cr.spin ) if ( cr.spin )
{ {
now = now % 100000; now %= 100000;
this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f ); this.model.renderAll( (now / 50000.0f) * (float) Math.PI * 500.0f );
} }
else else
@ -204,7 +204,7 @@ public class RenderBlockSkyCompass extends BaseBlockRender
} }
else else
{ {
now = now % 1000000; now %= 1000000;
this.model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f ); this.model.renderAll( (now / 500000.0f) * (float) Math.PI * 500.0f );
} }

View file

@ -114,7 +114,7 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
IBiometricCard bc = (IBiometricCard) a.getItem(); IBiometricCard bc = (IBiometricCard) a.getItem();
for (SecurityPermissions sp : bc.getPermissions( a )) for (SecurityPermissions sp : bc.getPermissions( a ))
this.security = this.security | (1 << sp.ordinal()); this.security |= ( 1 << sp.ordinal() );
} }
this.updatePowerStatus(); this.updatePowerStatus();

View file

@ -88,7 +88,7 @@ public class AETrading implements IVillageTradeHandler
ItemStack reverseTo = From.copy(); ItemStack reverseTo = From.copy();
ItemStack reverseFrom = To.copy(); ItemStack reverseFrom = To.copy();
reverseFrom.stackSize = (int) (reverseFrom.stackSize * (rand.nextFloat() * 3.0f + 1.0f)); reverseFrom.stackSize *= rand.nextFloat() * 3.0f + 1.0f;
this.addToList( list, reverseFrom, reverseTo ); this.addToList( list, reverseFrom, reverseTo );
} }

View file

@ -240,7 +240,7 @@ public class GridConnection implements IGridConnection, IPathItem
{ {
if ( this.getUsedChannels() != this.getLastUsedChannels() ) if ( this.getUsedChannels() != this.getLastUsedChannels() )
{ {
this.channelData = ( this.channelData & 0xff ); this.channelData &= 0xff;
this.channelData |= this.channelData << 8; this.channelData |= this.channelData << 8;
if ( this.sideA.getInternalGrid() != null ) if ( this.sideA.getInternalGrid() != null )

View file

@ -147,7 +147,7 @@ public class TickManagerCache implements ITickManager
this.awake.put( node, tt ); this.awake.put( node, tt );
// configure sort. // configure sort.
tt.lastTick = tt.lastTick - tt.request.maxTickRate; tt.lastTick -= tt.request.maxTickRate;
tt.current_rate = tt.request.minTickRate; tt.current_rate = tt.request.minTickRate;
// prevent dupes and tick build up. // prevent dupes and tick build up.

View file

@ -338,7 +338,8 @@ public class CellInventory implements ICellInventory
private void updateItemCount(long delta) private void updateItemCount(long delta)
{ {
this.tagCompound.setInteger( ITEM_COUNT_TAG, this.storedItemCount = (int) (this.storedItemCount + delta) ); this.storedItemCount += delta;
this.tagCompound.setInteger( ITEM_COUNT_TAG, this.storedItemCount );
} }
@Override @Override

View file

@ -584,7 +584,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
IPart p = this.getPart( ForgeDirection.getOrientation( x ) ); IPart p = this.getPart( ForgeDirection.getOrientation( x ) );
if ( p != null ) if ( p != null )
{ {
sides = sides | (1 << x); sides |= ( 1 << x );
} }
} }

View file

@ -465,12 +465,12 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
if ( !Worked ) if ( !Worked )
i.onItemUse( is, player, w, x, y, z, side.getOpposite().ordinal(), side.offsetX, side.offsetY, side.offsetZ ); i.onItemUse( is, player, w, x, y, z, side.getOpposite().ordinal(), side.offsetX, side.offsetY, side.offsetZ );
maxStorage = maxStorage - is.stackSize; maxStorage -= is.stackSize;
} }
else else
{ {
i.onItemUse( is, player, w, x, y, z, side.getOpposite().ordinal(), side.offsetX, side.offsetY, side.offsetZ ); i.onItemUse( is, player, w, x, y, z, side.getOpposite().ordinal(), side.offsetX, side.offsetY, side.offsetZ );
maxStorage = maxStorage - is.stackSize; maxStorage -= is.stackSize;
} }
} }
else else

View file

@ -161,13 +161,13 @@ public class PartMonitor extends AEBasePart implements IPartMonitor, IPowerChann
try try
{ {
if ( this.proxy.getEnergy().isNetworkPowered() ) if ( this.proxy.getEnergy().isNetworkPowered() )
this.clientFlags = this.clientFlags | this.POWERED_FLAG; this.clientFlags |= this.POWERED_FLAG;
if ( this.proxy.getPath().isNetworkBooting() ) if ( this.proxy.getPath().isNetworkBooting() )
this.clientFlags = this.clientFlags | this.BOOTING_FLAG; this.clientFlags |= this.BOOTING_FLAG;
if ( this.proxy.getNode().meetsChannelRequirements() ) if ( this.proxy.getNode().meetsChannelRequirements() )
this.clientFlags = this.clientFlags | this.CHANNEL_FLAG; this.clientFlags |= this.CHANNEL_FLAG;
} }
catch (GridAccessException e) catch (GridAccessException e)
{ {

View file

@ -30,14 +30,14 @@ import java.util.Map.Entry;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
import com.google.common.collect.HashMultimap;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.LoaderState; import cpw.mods.fml.common.LoaderState;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
import com.google.common.collect.HashMultimap;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.exceptions.MissingIngredientError; import appeng.api.exceptions.MissingIngredientError;
import appeng.api.exceptions.RecipeError; import appeng.api.exceptions.RecipeError;
@ -392,7 +392,7 @@ public class RecipeHandler implements IRecipeHandler
inQuote = !inQuote; inQuote = !inQuote;
break; break;
default: default:
token = token + c; token += c;
} }
} }
else else
@ -437,7 +437,7 @@ public class RecipeHandler implements IRecipeHandler
break; break;
default: default:
token = token + c; token += c;
} }
} }

View file

@ -59,8 +59,8 @@ public class CompassReader
private CompassRegion getRegion(int cx, int cz) private CompassRegion getRegion(int cx, int cz)
{ {
long pos = cx >> 10; long pos = cx >> 10;
pos = pos << 32; pos <<= 32;
pos = pos | (cz >> 10); pos |= ( cz >> 10 );
CompassRegion cr = this.regions.get( pos ); CompassRegion cr = this.regions.get( pos );
if ( cr == null ) if ( cr == null )

View file

@ -81,8 +81,8 @@ public class CompassRegion
{ {
if ( this.hasFile ) if ( this.hasFile )
{ {
cx = cx & 0x3FF; cx &= 0x3FF;
cz = cz & 0x3FF; cz &= 0x3FF;
int val = this.read( cx, cz ); int val = this.read( cx, cz );
if ( val != 0 ) if ( val != 0 )

View file

@ -361,7 +361,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
public void markForUpdate() public void markForUpdate()
{ {
if ( this.renderFragment > 0 ) if ( this.renderFragment > 0 )
this.renderFragment = this.renderFragment | 1; this.renderFragment |= 1;
else else
{ {
// TODO: Optimize Network Load // TODO: Optimize Network Load

View file

@ -137,7 +137,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
for (int num = 0; num < this.inv.getSizeInventory(); num++) for (int num = 0; num < this.inv.getSizeInventory(); num++)
{ {
if ( this.inv.getStackInSlot( num ) != null ) if ( this.inv.getStackInSlot( num ) != null )
slot = slot | (1 << num); slot |= ( 1 << num );
} }
data.writeByte( slot ); data.writeByte( slot );
@ -408,7 +408,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
src.extractAEPower( powerConsumption, Actionable.MODULATE, PowerMultiplier.CONFIG ); src.extractAEPower( powerConsumption, Actionable.MODULATE, PowerMultiplier.CONFIG );
if ( this.processingTime == 0 ) if ( this.processingTime == 0 )
this.processingTime = this.processingTime + speedFactor; this.processingTime += speedFactor;
else else
this.processingTime += TicksSinceLastCall * speedFactor; this.processingTime += TicksSinceLastCall * speedFactor;
} }