Formatted code

This commit is contained in:
yueh
2015-12-24 02:03:16 +01:00
parent e94a0cfccf
commit c9e8a6e939
216 changed files with 1196 additions and 1187 deletions
+6 -6
View File
@@ -108,10 +108,10 @@ public abstract class AEBaseItem extends Item implements IAEFeature
super.addInformation( stack, player, lines, displayMoreInfo );
}
@SideOnly(Side.CLIENT)
@SideOnly( Side.CLIENT )
protected IAESprite myIcon = null;
@SideOnly(Side.CLIENT)
@SideOnly( Side.CLIENT )
public void registerIcons(
final ClientHelper proxy, final String name )
{
@@ -124,11 +124,11 @@ public abstract class AEBaseItem extends Item implements IAEFeature
return this.myIcon;
}
@SideOnly(Side.CLIENT)
public void registerCustomIcon(
@SideOnly( Side.CLIENT )
public void registerCustomIcon(
final TextureMap map )
{
}
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List<ItemStack> itemStacks )
@@ -109,15 +109,15 @@ public class NetworkToolViewer implements INetworkTool
}
@Override
public void openInventory( final EntityPlayer player)
public void openInventory( final EntityPlayer player )
{
this.inv.openInventory(player);
this.inv.openInventory( player );
}
@Override
public void closeInventory( final EntityPlayer player)
public void closeInventory( final EntityPlayer player )
{
this.inv.closeInventory(player);
this.inv.closeInventory( player );
}
@Override
@@ -49,27 +49,26 @@ public class ItemPaintBall extends AEBaseItem
}
@Override
@SideOnly(Side.CLIENT)
@SideOnly( Side.CLIENT )
public void registerIcons( final ClientHelper ir, final String name )
{
final ModelResourceLocation sloc = ir.setIcon( this, name + "Shimmer" );
final ModelResourceLocation loc = ir.setIcon( this, name );
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( this, new ItemMeshDefinition(){
@Override
public ModelResourceLocation getModelLocation(
final ItemStack stack )
{
if ( ItemPaintBall.this.isLumen(stack) )
if( ItemPaintBall.this.isLumen( stack ) )
return sloc;
return loc;
}
});
} );
}
@Override
public String getItemStackDisplayName( final ItemStack is )
{
@@ -80,14 +79,14 @@ public class ItemPaintBall extends AEBaseItem
{
return ( is.getItemDamage() >= DAMAGE_THRESHOLD ? GuiText.Lumen.getLocal() + ' ' : "" ) + this.getColor( is );
}
@Override
public int getColorFromItemStack(
final ItemStack stack,
final int renderPass )
{
final AEColor col = this.getColor(stack);
final AEColor col = this.getColor( stack );
final int colorValue = stack.getItemDamage() >= 20 ? col.mediumVariant : col.mediumVariant;
final int r = ( colorValue >> 16 ) & 0xff;
final int g = ( colorValue >> 8 ) & 0xff;
@@ -97,11 +96,11 @@ public class ItemPaintBall extends AEBaseItem
{
final float fail = 0.7f;
final int full = (int) ( 255 * 0.3 );
return (int)( full + r * fail ) << 16 | (int)( full + g * fail ) << 8 | (int)( full + b * fail ) | 0xff << 24;
return (int) ( full + r * fail ) << 16 | (int) ( full + g * fail ) << 8 | (int) ( full + b * fail ) | 0xff << 24;
}
else
{
return r << 16 | g << 8 | b | 0xff << 24 ;
return r << 16 | g << 8 | b | 0xff << 24;
}
}
@@ -229,9 +229,9 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
{
if( data.hasKey( "modid" ) && data.hasKey( "itemname" ) )
{
if ( data.getString( "modid" ).equals( "minecraft" ) )
if( data.getString( "modid" ).equals( "minecraft" ) )
return Block.getBlockFromName( data.getString( "itemname" ) );
return GameRegistry.findBlock( data.getString( "modid" ), data.getString( "itemname" ) );
}
else
@@ -294,11 +294,11 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
return false;
}
@Override
public void registerCustomIcon(
public void registerCustomIcon(
final TextureMap map )
{
this.myIcon = new BaseIcon( map.registerSprite( new ResourceLocation( AppEng.MOD_ID, "blocks/ItemFacade" ) ));
this.myIcon = new BaseIcon( map.registerSprite( new ResourceLocation( AppEng.MOD_ID, "blocks/ItemFacade" ) ) );
}
}
@@ -182,7 +182,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
{
return false;
}
return AEApi.instance().partHelper().placeBus( is, pos, side, player, w );
}
@@ -192,15 +192,14 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
return "item.appliedenergistics2." + this.getName( is );
}
@Override
@SideOnly(Side.CLIENT)
@SideOnly( Side.CLIENT )
public void registerCustomIcon(
final TextureMap map )
{
for( final Entry<Integer, PartTypeWithVariant> part : this.registered.entrySet() )
{
part.getValue().texture= new BaseIcon( map.registerSprite( new ResourceLocation( AppEng.MOD_ID, "blocks/" + this.getName( new ItemStack( this, 1, part.getKey() ) ) )) );
part.getValue().texture = new BaseIcon( map.registerSprite( new ResourceLocation( AppEng.MOD_ID, "blocks/" + this.getName( new ItemStack( this, 1, part.getKey() ) ) ) ) );
}
}
@@ -213,10 +212,10 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
{
return registeredType.texture;
}
return new MissingIcon( this );
}
@Override
public String getItemStackDisplayName( final ItemStack is )
{
@@ -376,9 +375,9 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
private final PartType part;
private final int variant;
@SideOnly(Side.CLIENT)
@SideOnly( Side.CLIENT )
public IAESprite texture = null;
private PartTypeWithVariant( final PartType part, final int variant )
{
assert part != null;
@@ -148,15 +148,19 @@ public enum PartType
P2PTunnelLiquids( 463, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelLiquids ), EnumSet.noneOf( IntegrationType.class ), PartP2PLiquids.class, GuiText.FluidTunnel ),
//P2PTunnelEU( 465, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelEU ), EnumSet.of( IntegrationType.IC2 ), PartP2PIC2Power.class, GuiText.EUTunnel ),
// P2PTunnelEU( 465, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelEU ), EnumSet.of( IntegrationType.IC2 ),
// PartP2PIC2Power.class, GuiText.EUTunnel ),
//P2PTunnelRF( 466, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelRF ), EnumSet.of( IntegrationType.RF ), PartP2PRFPower.class, GuiText.RFTunnel ),
// P2PTunnelRF( 466, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelRF ), EnumSet.of( IntegrationType.RF ),
// PartP2PRFPower.class, GuiText.RFTunnel ),
P2PTunnelLight( 467, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelLight ), EnumSet.noneOf( IntegrationType.class ), PartP2PLight.class, GuiText.LightTunnel ),
// P2PTunnelOpenComputers( 468, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelOpenComputers ), EnumSet.of( IntegrationType.OpenComputers ), PartP2POpenComputers.class, GuiText.OCTunnel ),
// P2PTunnelOpenComputers( 468, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelOpenComputers ), EnumSet.of(
// IntegrationType.OpenComputers ), PartP2POpenComputers.class, GuiText.OCTunnel ),
// P2PTunnelPressure( 469, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelPressure ), EnumSet.of( IntegrationType.PneumaticCraft ), PartP2PPressure.class, GuiText.PressureTunnel ),
// P2PTunnelPressure( 469, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelPressure ), EnumSet.of(
// IntegrationType.PneumaticCraft ), PartP2PPressure.class, GuiText.PressureTunnel ),
InterfaceTerminal( 480, EnumSet.of( AEFeature.InterfaceTerminal ), EnumSet.noneOf( IntegrationType.class ), PartInterfaceTerminal.class );
@@ -161,7 +161,7 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
return super.onItemUse( is, player, w, pos, side, hx, hy, hz );
}
}
@Override
public boolean doesSneakBypassUse(
final World world,
@@ -53,9 +53,10 @@ import appeng.util.Platform;
import com.google.common.base.Optional;
// TODO BC Integration
//@Interface( iface = "buildcraft.api.tools.IToolWrench", iname = IntegrationType.BuildCraftCore )
public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench /*, IToolWrench */
public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench /* , IToolWrench */
{
public ToolNetworkTool()
@@ -83,20 +84,20 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench /
if( mop == null )
{
this.onItemUseFirst( it, p, w, new BlockPos(0,0,0), null, 0,0,0 ); // eh?
this.onItemUseFirst( it, p, w, new BlockPos( 0, 0, 0 ), null, 0, 0, 0 ); // eh?
}
else
{
if( w.getBlockState( mop.getBlockPos() ).getBlock().isAir( w, mop.getBlockPos() ) )
{
this.onItemUseFirst( it, p, w, new BlockPos(0,0,0), null, 0,0,0 ); // eh?
this.onItemUseFirst( it, p, w, new BlockPos( 0, 0, 0 ), null, 0, 0, 0 ); // eh?
}
}
}
return it;
}
@Override
public boolean onItemUseFirst(
final ItemStack stack,
@@ -209,5 +210,5 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench /
}
// TODO: BC WRENCH INTEGRATION
}
@@ -175,7 +175,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
}
// clean paint balls..
final Block testBlk = w.getBlockState( pos.offset( side ) ).getBlock();
final Block testBlk = w.getBlockState( pos.offset( side ) ).getBlock();
final TileEntity painted = w.getTileEntity( pos.offset( side ) );
if( this.getAECurrentPower( is ) > powerPerUse && testBlk instanceof BlockPaint && painted instanceof TilePaint )
{
@@ -368,50 +368,50 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
private boolean recolourBlock( final Block blk, final EnumFacing side, final World w, final BlockPos pos, final EnumFacing orientation, final AEColor newColor, final EntityPlayer p )
{
final IBlockState state = w.getBlockState( pos );
if( blk instanceof BlockColored )
{
final EnumDyeColor color = ( EnumDyeColor ) state.getValue( BlockColored.COLOR );
final EnumDyeColor color = (EnumDyeColor) state.getValue( BlockColored.COLOR );
if( newColor.dye == color )
{
return false;
}
return w.setBlockState( pos, state.withProperty( BlockColored.COLOR, newColor.dye ) );
}
if( blk == Blocks.glass )
{
return w.setBlockState( pos, Blocks.stained_glass.getDefaultState().withProperty( BlockStainedGlass.COLOR, newColor.dye) );
return w.setBlockState( pos, Blocks.stained_glass.getDefaultState().withProperty( BlockStainedGlass.COLOR, newColor.dye ) );
}
if( blk == Blocks.stained_glass )
{
final EnumDyeColor color = ( EnumDyeColor ) state.getValue( BlockStainedGlass.COLOR );
final EnumDyeColor color = (EnumDyeColor) state.getValue( BlockStainedGlass.COLOR );
if( newColor.dye == color )
{
return false;
}
return w.setBlockState( pos, state.withProperty( BlockStainedGlass.COLOR, newColor.dye ) );
}
if( blk == Blocks.glass_pane )
{
return w.setBlockState( pos, Blocks.stained_glass_pane.getDefaultState().withProperty( BlockStainedGlassPane.COLOR, newColor.dye) );
return w.setBlockState( pos, Blocks.stained_glass_pane.getDefaultState().withProperty( BlockStainedGlassPane.COLOR, newColor.dye ) );
}
if( blk == Blocks.stained_glass_pane )
{
final EnumDyeColor color = ( EnumDyeColor ) state.getValue( BlockStainedGlassPane.COLOR );
final EnumDyeColor color = (EnumDyeColor) state.getValue( BlockStainedGlassPane.COLOR );
if( newColor.dye == color )
{
return false;
}
return w.setBlockState( pos, state.withProperty( BlockStainedGlassPane.COLOR, newColor.dye ) );
}
@@ -303,8 +303,8 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
final TileEntity te = w.getTileEntity( hitPos );
if( te instanceof TilePaint )
{
final Vec3 hp = pos.hitVec.subtract( hitPos.getX(), hitPos.getY(), hitPos.getZ() );
( (TilePaint) te ).addBlot( type, side.getOpposite(), hp );
final Vec3 hp = pos.hitVec.subtract( hitPos.getX(), hitPos.getY(), hitPos.getZ() );
( (TilePaint) te ).addBlot( type, side.getOpposite(), hp );
}
}
}
@@ -141,4 +141,4 @@ package appeng.items.tools.powered.powersink;
// {
// return this;
// }
//}
// }
@@ -61,4 +61,4 @@ package appeng.items.tools.powered.powersink;
// {
// return (int) PowerUnits.AE.convertTo( PowerUnits.RF, this.getAEMaxPower( is ) );
// }
//}
// }
@@ -18,6 +18,7 @@
package appeng.items.tools.powered.powersink;
/*
@Interface(iface = "universalelectricity.core.item.IItemElectric", modid = "IC2")
public class UniversalElectricity extends ThermalExpansion implements IItemElectric
@@ -36,9 +36,10 @@ import appeng.util.Platform;
import com.google.common.base.Optional;
// TODO BC Integration
//@Interface( iface = "buildcraft.api.tools.IToolWrench", iname = IntegrationType.BuildCraftCore )
public class ToolQuartzWrench extends AEBaseItem implements IAEWrench /*, IToolWrench */
public class ToolQuartzWrench extends AEBaseItem implements IAEWrench /* , IToolWrench */
{
public ToolQuartzWrench( final AEFeature type )
@@ -99,16 +100,15 @@ public class ToolQuartzWrench extends AEBaseItem implements IAEWrench /*, IToolW
// TODO: BC Wrench Integration
/*
@Override
public boolean canWrench( EntityPlayer player, int x, int y, int z )
{
return true;
}
@Override
public void wrenchUsed( EntityPlayer player, int x, int y, int z )
{
player.swingItem();
}
*/
* @Override
* public boolean canWrench( EntityPlayer player, int x, int y, int z )
* {
* return true;
* }
* @Override
* public void wrenchUsed( EntityPlayer player, int x, int y, int z )
* {
* player.swingItem();
* }
*/
}