Basic reformat, hit once, hope never again
This commit is contained in:
@@ -93,11 +93,11 @@ public final class PartWailaDataProvider implements IWailaDataProvider
|
||||
|
||||
final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop );
|
||||
|
||||
if ( maybePart.isPresent() )
|
||||
if( maybePart.isPresent() )
|
||||
{
|
||||
final IPart part = maybePart.get();
|
||||
|
||||
for ( IPartWailaDataProvider provider : this.providers )
|
||||
for( IPartWailaDataProvider provider : this.providers )
|
||||
{
|
||||
provider.getWailaHead( part, currentToolTip, accessor, config );
|
||||
}
|
||||
@@ -114,11 +114,11 @@ public final class PartWailaDataProvider implements IWailaDataProvider
|
||||
|
||||
final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop );
|
||||
|
||||
if ( maybePart.isPresent() )
|
||||
if( maybePart.isPresent() )
|
||||
{
|
||||
final IPart part = maybePart.get();
|
||||
|
||||
for ( IPartWailaDataProvider provider : this.providers )
|
||||
for( IPartWailaDataProvider provider : this.providers )
|
||||
{
|
||||
provider.getWailaBody( part, currentToolTip, accessor, config );
|
||||
}
|
||||
@@ -135,11 +135,11 @@ public final class PartWailaDataProvider implements IWailaDataProvider
|
||||
|
||||
final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop );
|
||||
|
||||
if ( maybePart.isPresent() )
|
||||
if( maybePart.isPresent() )
|
||||
{
|
||||
final IPart part = maybePart.get();
|
||||
|
||||
for ( IPartWailaDataProvider provider : this.providers )
|
||||
for( IPartWailaDataProvider provider : this.providers )
|
||||
{
|
||||
provider.getWailaTail( part, currentToolTip, accessor, config );
|
||||
}
|
||||
@@ -153,15 +153,15 @@ public final class PartWailaDataProvider implements IWailaDataProvider
|
||||
{
|
||||
final MovingObjectPosition mop = this.tracer.retraceBlock( world, player, x, y, z );
|
||||
|
||||
if ( mop != null )
|
||||
if( mop != null )
|
||||
{
|
||||
final Optional<IPart> maybePart = this.accessor.getMaybePart( te, mop );
|
||||
|
||||
if ( maybePart.isPresent() )
|
||||
if( maybePart.isPresent() )
|
||||
{
|
||||
final IPart part = maybePart.get();
|
||||
|
||||
for ( IPartWailaDataProvider provider : this.providers )
|
||||
for( IPartWailaDataProvider provider : this.providers )
|
||||
{
|
||||
provider.getNBTData( player, part, te, tag, world, x, y, z );
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public final class TileWailaDataProvider implements IWailaDataProvider
|
||||
@Override
|
||||
public List<String> getWailaHead( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
|
||||
{
|
||||
for ( IWailaDataProvider provider : this.providers )
|
||||
for( IWailaDataProvider provider : this.providers )
|
||||
{
|
||||
provider.getWailaHead( itemStack, currentToolTip, accessor, config );
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public final class TileWailaDataProvider implements IWailaDataProvider
|
||||
@Override
|
||||
public List<String> getWailaBody( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
|
||||
{
|
||||
for ( IWailaDataProvider provider : this.providers )
|
||||
for( IWailaDataProvider provider : this.providers )
|
||||
{
|
||||
provider.getWailaBody( itemStack, currentToolTip, accessor, config );
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public final class TileWailaDataProvider implements IWailaDataProvider
|
||||
@Override
|
||||
public List<String> getWailaTail( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
|
||||
{
|
||||
for ( IWailaDataProvider provider : this.providers )
|
||||
for( IWailaDataProvider provider : this.providers )
|
||||
{
|
||||
provider.getWailaTail( itemStack, currentToolTip, accessor, config );
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public final class TileWailaDataProvider implements IWailaDataProvider
|
||||
@Override
|
||||
public NBTTagCompound getNBTData( EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z )
|
||||
{
|
||||
for ( IWailaDataProvider provider : this.providers )
|
||||
for( IWailaDataProvider provider : this.providers )
|
||||
{
|
||||
provider.getNBTData( player, te, tag, world, x, y, z );
|
||||
}
|
||||
|
||||
@@ -75,12 +75,12 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider
|
||||
@Override
|
||||
public List<String> getWailaBody( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
|
||||
{
|
||||
if ( part instanceof PartCableSmart || part instanceof PartDenseCable )
|
||||
if( part instanceof PartCableSmart || part instanceof PartDenseCable )
|
||||
{
|
||||
final NBTTagCompound tag = accessor.getNBTData();
|
||||
|
||||
final byte usedChannels = this.getUsedChannels( part, tag, this.cache );
|
||||
final byte maxChannels = ( byte ) ( ( part instanceof PartDenseCable ) ? 32 : 8 );
|
||||
final byte maxChannels = (byte) ( ( part instanceof PartDenseCable ) ? 32 : 8 );
|
||||
|
||||
currentToolTip.add( usedChannels + " " + GuiText.Of.getLocal() + ' ' + maxChannels + ' ' + WailaText.Channels.getLocal() );
|
||||
}
|
||||
@@ -105,12 +105,12 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider
|
||||
{
|
||||
final byte usedChannels;
|
||||
|
||||
if ( tag.hasKey( ID_USED_CHANNELS ) )
|
||||
if( tag.hasKey( ID_USED_CHANNELS ) )
|
||||
{
|
||||
usedChannels = tag.getByte( ID_USED_CHANNELS );
|
||||
this.cache.put( part, usedChannels );
|
||||
}
|
||||
else if ( this.cache.containsKey( part ) )
|
||||
else if( this.cache.containsKey( part ) )
|
||||
{
|
||||
usedChannels = this.cache.get( part );
|
||||
}
|
||||
@@ -143,13 +143,13 @@ public final class ChannelWailaDataProvider extends BasePartWailaDataProvider
|
||||
@Override
|
||||
public NBTTagCompound getNBTData( EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z )
|
||||
{
|
||||
if ( part instanceof PartCableSmart || part instanceof PartDenseCable )
|
||||
if( part instanceof PartCableSmart || part instanceof PartDenseCable )
|
||||
{
|
||||
final NBTTagCompound tempTag = new NBTTagCompound();
|
||||
|
||||
part.writeToNBT( tempTag );
|
||||
|
||||
if ( tempTag.hasKey( ID_USED_CHANNELS ) )
|
||||
if( tempTag.hasKey( ID_USED_CHANNELS ) )
|
||||
{
|
||||
final byte usedChannels = tempTag.getByte( ID_USED_CHANNELS );
|
||||
|
||||
|
||||
@@ -47,5 +47,5 @@ public interface IPartWailaDataProvider
|
||||
|
||||
List<String> getWailaTail( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config );
|
||||
|
||||
NBTTagCompound getNBTData(EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z);
|
||||
NBTTagCompound getNBTData( EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z );
|
||||
}
|
||||
|
||||
@@ -52,13 +52,13 @@ public final class PartAccessor
|
||||
*/
|
||||
public Optional<IPart> getMaybePart( TileEntity te, MovingObjectPosition mop )
|
||||
{
|
||||
if ( te instanceof IPartHost )
|
||||
if( te instanceof IPartHost )
|
||||
{
|
||||
final Vec3 position = mop.hitVec.addVector( -mop.blockX, -mop.blockY, -mop.blockZ );
|
||||
final IPartHost host = ( IPartHost ) te;
|
||||
final IPartHost host = (IPartHost) te;
|
||||
final SelectedPart sp = host.selectPart( position );
|
||||
|
||||
if ( sp.part != null )
|
||||
if( sp.part != null )
|
||||
{
|
||||
return Optional.of( sp.part );
|
||||
}
|
||||
|
||||
+4
-4
@@ -51,9 +51,9 @@ public final class PowerStateWailaDataProvider extends BasePartWailaDataProvider
|
||||
@Override
|
||||
public List<String> getWailaBody( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
|
||||
{
|
||||
if ( part instanceof IPowerChannelState )
|
||||
if( part instanceof IPowerChannelState )
|
||||
{
|
||||
final IPowerChannelState state = ( IPowerChannelState ) part;
|
||||
final IPowerChannelState state = (IPowerChannelState) part;
|
||||
|
||||
currentToolTip.add( this.getToolTip( state.isActive(), state.isPowered() ) );
|
||||
}
|
||||
@@ -73,11 +73,11 @@ public final class PowerStateWailaDataProvider extends BasePartWailaDataProvider
|
||||
{
|
||||
final String result;
|
||||
|
||||
if ( isActive && isPowered )
|
||||
if( isActive && isPowered )
|
||||
{
|
||||
result = WailaText.DeviceOnline.getLocal();
|
||||
}
|
||||
else if ( isPowered )
|
||||
else if( isPowered )
|
||||
{
|
||||
result = WailaText.DeviceMissingChannel.getLocal();
|
||||
}
|
||||
|
||||
+6
-6
@@ -55,21 +55,21 @@ public final class StorageMonitorWailaDataProvider extends BasePartWailaDataProv
|
||||
@Override
|
||||
public List<String> getWailaBody( IPart part, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
|
||||
{
|
||||
if ( part instanceof IPartStorageMonitor )
|
||||
if( part instanceof IPartStorageMonitor )
|
||||
{
|
||||
final IPartStorageMonitor monitor = ( IPartStorageMonitor ) part;
|
||||
final IPartStorageMonitor monitor = (IPartStorageMonitor) part;
|
||||
|
||||
final IAEStack<?> displayed = monitor.getDisplayed();
|
||||
final boolean isLocked = monitor.isLocked();
|
||||
|
||||
if ( displayed instanceof IAEItemStack )
|
||||
if( displayed instanceof IAEItemStack )
|
||||
{
|
||||
IAEItemStack ais = ( IAEItemStack ) displayed;
|
||||
IAEItemStack ais = (IAEItemStack) displayed;
|
||||
currentToolTip.add( WailaText.Showing.getLocal() + ": " + ais.getItemStack().getDisplayName() );
|
||||
}
|
||||
else if ( displayed instanceof IAEFluidStack )
|
||||
else if( displayed instanceof IAEFluidStack )
|
||||
{
|
||||
IAEFluidStack ais = ( IAEFluidStack ) displayed;
|
||||
IAEFluidStack ais = (IAEFluidStack) displayed;
|
||||
currentToolTip.add( WailaText.Showing.getLocal() + ": " + ais.getFluid().getLocalizedName( ais.getFluidStack() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ public final class Tracer
|
||||
* Trace view of players to blocks.
|
||||
* Ignore all which are out of reach.
|
||||
*
|
||||
* @param world word of block
|
||||
* @param world word of block
|
||||
* @param player player viewing block
|
||||
* @param x x pos of block
|
||||
* @param y y pos of block
|
||||
* @param z z pos of block
|
||||
* @param x x pos of block
|
||||
* @param y y pos of block
|
||||
* @param z z pos of block
|
||||
*
|
||||
* @return trace movement. Can be null
|
||||
*/
|
||||
@@ -70,7 +70,7 @@ public final class Tracer
|
||||
private Vec3 getCorrectedHeadVec( EntityPlayer player )
|
||||
{
|
||||
Vec3 v = Vec3.createVectorHelper( player.posX, player.posY, player.posZ );
|
||||
if ( player.worldObj.isRemote )
|
||||
if( player.worldObj.isRemote )
|
||||
{
|
||||
//compatibility with eye height changing mods
|
||||
v.yCoord += player.getEyeHeight() - player.getDefaultEyeHeight();
|
||||
@@ -78,7 +78,7 @@ public final class Tracer
|
||||
else
|
||||
{
|
||||
v.yCoord += player.getEyeHeight();
|
||||
if ( player instanceof EntityPlayerMP && player.isSneaking() )
|
||||
if( player instanceof EntityPlayerMP && player.isSneaking() )
|
||||
v.yCoord -= 0.08;
|
||||
}
|
||||
return v;
|
||||
|
||||
@@ -57,13 +57,13 @@ public final class ChargerWailaDataProvider extends BaseWailaDataProvider
|
||||
public List<String> getWailaBody( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
|
||||
{
|
||||
final TileEntity te = accessor.getTileEntity();
|
||||
if ( te instanceof TileCharger )
|
||||
if( te instanceof TileCharger )
|
||||
{
|
||||
final TileCharger charger = ( TileCharger ) te;
|
||||
final TileCharger charger = (TileCharger) te;
|
||||
final IInventory chargerInventory = charger.getInternalInventory();
|
||||
final ItemStack chargingItem = chargerInventory.getStackInSlot( 0 );
|
||||
|
||||
if ( chargingItem != null )
|
||||
if( chargingItem != null )
|
||||
{
|
||||
final String currentInventory = chargingItem.getDisplayName();
|
||||
final EntityPlayer player = accessor.getPlayer();
|
||||
|
||||
+3
-3
@@ -56,12 +56,12 @@ public final class CraftingMonitorWailaDataProvider extends BaseWailaDataProvide
|
||||
public List<String> getWailaBody( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
|
||||
{
|
||||
final TileEntity te = accessor.getTileEntity();
|
||||
if ( te instanceof TileCraftingMonitorTile )
|
||||
if( te instanceof TileCraftingMonitorTile )
|
||||
{
|
||||
final TileCraftingMonitorTile monitor = ( TileCraftingMonitorTile ) te;
|
||||
final TileCraftingMonitorTile monitor = (TileCraftingMonitorTile) te;
|
||||
final IAEItemStack displayStack = monitor.getJobProgress();
|
||||
|
||||
if ( displayStack != null )
|
||||
if( displayStack != null )
|
||||
{
|
||||
final String currentCrafting = displayStack.getItemStack().getDisplayName();
|
||||
|
||||
|
||||
+4
-4
@@ -56,18 +56,18 @@ public final class PowerStateWailaDataProvider extends BaseWailaDataProvider
|
||||
{
|
||||
final TileEntity te = accessor.getTileEntity();
|
||||
|
||||
if ( te instanceof IPowerChannelState )
|
||||
if( te instanceof IPowerChannelState )
|
||||
{
|
||||
final IPowerChannelState state = ( IPowerChannelState ) te;
|
||||
final IPowerChannelState state = (IPowerChannelState) te;
|
||||
|
||||
final boolean isActive = state.isActive();
|
||||
final boolean isPowered = state.isPowered();
|
||||
|
||||
if ( isActive && isPowered )
|
||||
if( isActive && isPowered )
|
||||
{
|
||||
currentToolTip.add( WailaText.DeviceOnline.getLocal() );
|
||||
}
|
||||
else if ( isPowered )
|
||||
else if( isPowered )
|
||||
{
|
||||
currentToolTip.add( WailaText.DeviceMissingChannel.getLocal() );
|
||||
}
|
||||
|
||||
+10
-10
@@ -77,17 +77,17 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider
|
||||
public List<String> getWailaBody( ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor accessor, IWailaConfigHandler config )
|
||||
{
|
||||
final TileEntity te = accessor.getTileEntity();
|
||||
if ( te instanceof IAEPowerStorage )
|
||||
if( te instanceof IAEPowerStorage )
|
||||
{
|
||||
final IAEPowerStorage storage = ( IAEPowerStorage ) te;
|
||||
final IAEPowerStorage storage = (IAEPowerStorage) te;
|
||||
|
||||
final double maxPower = storage.getAEMaxPower();
|
||||
if ( maxPower > 0 )
|
||||
if( maxPower > 0 )
|
||||
{
|
||||
final NBTTagCompound tag = accessor.getNBTData();
|
||||
|
||||
final long internalCurrentPower = this.getInternalCurrentPower( tag, te );
|
||||
final long internalMaxPower = ( long ) ( 100 * maxPower );
|
||||
final long internalMaxPower = (long) ( 100 * maxPower );
|
||||
|
||||
final String formatCurrentPower = Platform.formatPowerLong( internalCurrentPower, false );
|
||||
final String formatMaxPower = Platform.formatPowerLong( internalMaxPower, false );
|
||||
@@ -119,13 +119,13 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider
|
||||
@Override
|
||||
public NBTTagCompound getNBTData( EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z )
|
||||
{
|
||||
if ( te instanceof IAEPowerStorage )
|
||||
if( te instanceof IAEPowerStorage )
|
||||
{
|
||||
final IAEPowerStorage storage = ( IAEPowerStorage ) te;
|
||||
final IAEPowerStorage storage = (IAEPowerStorage) te;
|
||||
|
||||
if ( storage.getAEMaxPower() > 0 )
|
||||
if( storage.getAEMaxPower() > 0 )
|
||||
{
|
||||
final long internalCurrentPower = ( long ) ( 100 * storage.getAECurrentPower() );
|
||||
final long internalCurrentPower = (long) ( 100 * storage.getAECurrentPower() );
|
||||
|
||||
tag.setLong( ID_CURRENT_POWER, internalCurrentPower );
|
||||
}
|
||||
@@ -150,12 +150,12 @@ public final class PowerStorageWailaDataProvider extends BaseWailaDataProvider
|
||||
{
|
||||
final long internalCurrentPower;
|
||||
|
||||
if ( tag.hasKey( ID_CURRENT_POWER ) )
|
||||
if( tag.hasKey( ID_CURRENT_POWER ) )
|
||||
{
|
||||
internalCurrentPower = tag.getLong( ID_CURRENT_POWER );
|
||||
this.cache.put( te, internalCurrentPower );
|
||||
}
|
||||
else if ( this.cache.containsKey( te ) )
|
||||
else if( this.cache.containsKey( te ) )
|
||||
{
|
||||
internalCurrentPower = this.cache.get( te );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user