Finally use Java7 <>
This commit is contained in:
@@ -105,7 +105,7 @@ public final class ItemMaterial extends AEBaseItem implements IStorageComponent,
|
||||
final Upgrades u = this.getType( stack );
|
||||
if( u != null )
|
||||
{
|
||||
final List<String> textList = new LinkedList<String>();
|
||||
final List<String> textList = new LinkedList<>();
|
||||
for( final Entry<ItemStack, Integer> j : u.getSupported().entrySet() )
|
||||
{
|
||||
String name = null;
|
||||
|
||||
@@ -51,7 +51,7 @@ import appeng.util.Platform;
|
||||
public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternItem
|
||||
{
|
||||
// rather simple client side caching.
|
||||
private static final Map<ItemStack, ItemStack> SIMPLE_CACHE = new WeakHashMap<ItemStack, ItemStack>();
|
||||
private static final Map<ItemStack, ItemStack> SIMPLE_CACHE = new WeakHashMap<>();
|
||||
|
||||
public ItemEncodedPattern()
|
||||
{
|
||||
@@ -63,7 +63,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
{
|
||||
this.clearPattern( player.getHeldItem( hand ), player );
|
||||
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -105,7 +105,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
{
|
||||
if( this.subTypes == null )
|
||||
{
|
||||
this.subTypes = new ArrayList<ItemStack>( 1000 );
|
||||
this.subTypes = new ArrayList<>( 1000 );
|
||||
for( final Object blk : Block.REGISTRY )
|
||||
{
|
||||
final Block b = (Block) blk;
|
||||
|
||||
@@ -197,7 +197,7 @@ public final class ItemPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
@Override
|
||||
protected void getCheckedSubItems( final CreativeTabs creativeTab, final NonNullList<ItemStack> itemStacks )
|
||||
{
|
||||
final List<Entry<Integer, PartTypeWithVariant>> types = new ArrayList<Entry<Integer, PartTypeWithVariant>>( this.registered.entrySet() );
|
||||
final List<Entry<Integer, PartTypeWithVariant>> types = new ArrayList<>( this.registered.entrySet() );
|
||||
Collections.sort( types, REGISTERED_COMPARATOR );
|
||||
|
||||
for( final Entry<Integer, PartTypeWithVariant> part : types )
|
||||
|
||||
@@ -223,7 +223,7 @@ public final class ItemBasicStorageCell extends AEBaseItem implements IStorageCe
|
||||
public ActionResult<ItemStack> onItemRightClick( final World world, final EntityPlayer player, final EnumHand hand )
|
||||
{
|
||||
this.disassembleDrive( player.getHeldItem( hand ), world, player );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
private boolean disassembleDrive( final ItemStack stack, final World world, final EntityPlayer player )
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem
|
||||
{
|
||||
IPartitionList<IAEItemStack> myPartitionList = null;
|
||||
|
||||
final MergedPriorityList<IAEItemStack> myMergedList = new MergedPriorityList<IAEItemStack>();
|
||||
final MergedPriorityList<IAEItemStack> myMergedList = new MergedPriorityList<>();
|
||||
|
||||
for( final ItemStack currentViewCell : list )
|
||||
{
|
||||
@@ -107,11 +107,11 @@ public class ItemViewCell extends AEBaseItem implements ICellWorkbenchItem
|
||||
{
|
||||
if( hasFuzzy )
|
||||
{
|
||||
myMergedList.addNewList( new FuzzyPriorityList<IAEItemStack>( priorityList, fzMode ), !hasInverter );
|
||||
myMergedList.addNewList( new FuzzyPriorityList<>( priorityList, fzMode ), !hasInverter );
|
||||
}
|
||||
else
|
||||
{
|
||||
myMergedList.addNewList( new PrecisePriorityList<IAEItemStack>( priorityList ), !hasInverter );
|
||||
myMergedList.addNewList( new PrecisePriorityList<>( priorityList ), !hasInverter );
|
||||
}
|
||||
|
||||
myPartitionList = myMergedList;
|
||||
|
||||
@@ -60,10 +60,10 @@ public class ToolBiometricCard extends AEBaseItem implements IBiometricCard
|
||||
{
|
||||
this.encode( p.getHeldItem( hand ), p );
|
||||
p.swingArm( hand );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
return new ActionResult<ItemStack>( EnumActionResult.PASS, p.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.PASS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -90,7 +90,7 @@ public class ToolNetworkTool extends AEBaseItem implements IGuiItem, IAEWrench /
|
||||
}
|
||||
}
|
||||
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -87,7 +87,7 @@ import appeng.util.item.AEItemStack;
|
||||
public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCell, IItemGroup, IBlockTool, IMouseWheelItem
|
||||
{
|
||||
|
||||
private static final Map<Integer, AEColor> ORE_TO_COLOR = new HashMap<Integer, AEColor>();
|
||||
private static final Map<Integer, AEColor> ORE_TO_COLOR = new HashMap<>();
|
||||
|
||||
static
|
||||
{
|
||||
@@ -279,7 +279,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
else
|
||||
{
|
||||
final LinkedList<IAEItemStack> list = new LinkedList<IAEItemStack>();
|
||||
final LinkedList<IAEItemStack> list = new LinkedList<>();
|
||||
|
||||
for( final IAEItemStack i : itemList )
|
||||
{
|
||||
|
||||
@@ -63,8 +63,8 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
{
|
||||
super( AEConfig.instance().getEntropyManipulatorBattery() );
|
||||
|
||||
this.heatUp = new HashMap<InWorldToolOperationIngredient, InWorldToolOperationResult>();
|
||||
this.coolDown = new HashMap<InWorldToolOperationIngredient, InWorldToolOperationResult>();
|
||||
this.heatUp = new HashMap<>();
|
||||
this.coolDown = new HashMap<>();
|
||||
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.STONE.getDefaultState() ),
|
||||
new InWorldToolOperationResult( new ItemStack( Blocks.COBBLESTONE ) ) );
|
||||
@@ -75,7 +75,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
new InWorldToolOperationResult( new ItemStack( Blocks.OBSIDIAN ) ) );
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.GRASS, true ), new InWorldToolOperationResult( new ItemStack( Blocks.DIRT ) ) );
|
||||
|
||||
final List<ItemStack> snowBalls = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> snowBalls = new ArrayList<>();
|
||||
snowBalls.add( new ItemStack( Items.SNOWBALL ) );
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.FLOWING_WATER, true ), new InWorldToolOperationResult( ItemStack.EMPTY, snowBalls ) );
|
||||
this.coolDown.put( new InWorldToolOperationIngredient( Blocks.WATER, true ), new InWorldToolOperationResult( new ItemStack( Blocks.ICE ) ) );
|
||||
@@ -218,7 +218,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
|
||||
if( target == null )
|
||||
{
|
||||
return new ActionResult<ItemStack>( EnumActionResult.FAIL, p.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.FAIL, p.getHeldItem( hand ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -235,7 +235,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
}
|
||||
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -290,7 +290,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
|
||||
final ItemStack[] stack = Platform.getBlockDrops( w, pos );
|
||||
final List<ItemStack> out = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> out = new ArrayList<>();
|
||||
boolean hasFurnaceable = false;
|
||||
boolean canFurnaceable = true;
|
||||
|
||||
|
||||
@@ -136,21 +136,21 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
aeAmmo.setStackSize( 1 );
|
||||
final ItemStack ammo = ( (IAEItemStack) aeAmmo ).getItemStack();
|
||||
if( ammo == null )
|
||||
{
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
ammo.setCount( 1 );
|
||||
aeAmmo = inv.extractItems( aeAmmo, Actionable.MODULATE, new PlayerSource( p, null ) );
|
||||
if( aeAmmo == null )
|
||||
{
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
final LookDirection dir = Platform.getPlayerRay( p, p.getEyeHeight() );
|
||||
@@ -172,7 +172,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
{
|
||||
this.shootPaintBalls( type, w, p, Vec3d, Vec3d1, direction, d0, d1, d2 );
|
||||
}
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -186,11 +186,11 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell
|
||||
{
|
||||
p.sendMessage( PlayerMessages.AmmoDepleted.get() );
|
||||
}
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ActionResult<ItemStack>( EnumActionResult.FAIL, p.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.FAIL, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
private void shootPaintBalls( final ItemStack type, final World w, final EntityPlayer p, final Vec3d Vec3d, final Vec3d Vec3d1, final Vec3d direction, final double d0, final double d1, final double d2 )
|
||||
|
||||
@@ -68,7 +68,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer player, final EnumHand hand )
|
||||
{
|
||||
Platform.openGUI( player, null, AEPartLocation.INTERNAL, GuiBridge.GUI_PORTABLE_CELL );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer player, final EnumHand hand )
|
||||
{
|
||||
AEApi.instance().registries().wireless().openWirelessTerminalGui( player.getHeldItem( hand ), w, player );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
|
||||
Platform.openGUI( p, null, AEPartLocation.INTERNAL, GuiBridge.GUI_QUARTZ_KNIFE );
|
||||
}
|
||||
p.swingArm( hand );
|
||||
return new ActionResult<ItemStack>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user