Finally use Java7 <>
This commit is contained in:
@@ -57,7 +57,7 @@ public class IMCHandler
|
||||
*/
|
||||
public IMCHandler()
|
||||
{
|
||||
this.processors = new HashMap<String, IIMCProcessor>( INITIAL_PROCESSORS_CAPACITY );
|
||||
this.processors = new HashMap<>( INITIAL_PROCESSORS_CAPACITY );
|
||||
|
||||
this.processors.put( "blacklist-block-spatial", new IMCBlackListSpatial() );
|
||||
this.processors.put( "whitelist-spatial", new IMCSpatial() );
|
||||
|
||||
@@ -124,9 +124,9 @@ public final class Registration
|
||||
private Biome storageBiome;
|
||||
|
||||
// TODO : 1.12 Improve
|
||||
private static List<Block> blocksToRegister = new ArrayList<Block>();
|
||||
private static List<Item> itemsToRegister = new ArrayList<Item>();
|
||||
private static List<IRecipe> recipesToRegister = new ArrayList<IRecipe>();
|
||||
private static List<Block> blocksToRegister = new ArrayList<>();
|
||||
private static List<Item> itemsToRegister = new ArrayList<>();
|
||||
private static List<IRecipe> recipesToRegister = new ArrayList<>();
|
||||
private File recipeDirectory;
|
||||
private CustomRecipeConfig customRecipeConfig;
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ public class ApiPart implements IPartHelper
|
||||
} );
|
||||
|
||||
private final Map<Class<?>, String> interfaces2Layer = new HashMap<>();
|
||||
private final List<String> desc = new LinkedList<String>();
|
||||
private final List<String> desc = new LinkedList<>();
|
||||
|
||||
/**
|
||||
* Conceptually this method will build a new class hierarchy that is rooted at the given base class, and includes a
|
||||
|
||||
@@ -32,7 +32,7 @@ import appeng.core.AELog;
|
||||
|
||||
public final class GridCacheRegistry implements IGridCacheRegistry
|
||||
{
|
||||
private final Map<Class<? extends IGridCache>, Class<? extends IGridCache>> caches = new HashMap<Class<? extends IGridCache>, Class<? extends IGridCache>>();
|
||||
private final Map<Class<? extends IGridCache>, Class<? extends IGridCache>> caches = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void registerGridCache( final Class<? extends IGridCache> iface, final Class<? extends IGridCache> implementation )
|
||||
@@ -50,7 +50,7 @@ public final class GridCacheRegistry implements IGridCacheRegistry
|
||||
@Override
|
||||
public HashMap<Class<? extends IGridCache>, IGridCache> createCacheInstance( final IGrid g )
|
||||
{
|
||||
final HashMap<Class<? extends IGridCache>, IGridCache> map = new HashMap<Class<? extends IGridCache>, IGridCache>();
|
||||
final HashMap<Class<? extends IGridCache>, IGridCache> map = new HashMap<>();
|
||||
|
||||
for( final Class<? extends IGridCache> iface : this.caches.keySet() )
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ public final class LocatableRegistry implements ILocatableRegistry
|
||||
|
||||
public LocatableRegistry()
|
||||
{
|
||||
this.set = new HashMap<Long, ILocatable>();
|
||||
this.set = new HashMap<>();
|
||||
MinecraftForge.EVENT_BUS.register( this );
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import appeng.util.Platform;
|
||||
public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmoRegistry
|
||||
{
|
||||
|
||||
private final HashMap<ItemStack, Double> DamageModifiers = new HashMap<ItemStack, Double>();
|
||||
private final HashMap<ItemStack, Double> DamageModifiers = new HashMap<>();
|
||||
|
||||
public MatterCannonAmmoRegistry()
|
||||
{
|
||||
|
||||
@@ -36,11 +36,11 @@ import appeng.spatial.DefaultSpatialHandler;
|
||||
public class MovableTileRegistry implements IMovableRegistry
|
||||
{
|
||||
|
||||
private final HashSet<Block> blacklisted = new HashSet<Block>();
|
||||
private final HashSet<Block> blacklisted = new HashSet<>();
|
||||
|
||||
private final HashMap<Class<? extends TileEntity>, IMovableHandler> Valid = new HashMap<Class<? extends TileEntity>, IMovableHandler>();
|
||||
private final LinkedList<Class<? extends TileEntity>> test = new LinkedList<Class<? extends TileEntity>>();
|
||||
private final LinkedList<IMovableHandler> handlers = new LinkedList<IMovableHandler>();
|
||||
private final HashMap<Class<? extends TileEntity>, IMovableHandler> Valid = new HashMap<>();
|
||||
private final LinkedList<Class<? extends TileEntity>> test = new LinkedList<>();
|
||||
private final LinkedList<IMovableHandler> handlers = new LinkedList<>();
|
||||
private final DefaultSpatialHandler dsh = new DefaultSpatialHandler();
|
||||
|
||||
private final IMovableHandler nullHandler = new DefaultSpatialHandler();
|
||||
|
||||
@@ -48,7 +48,7 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||
{
|
||||
private static final int INITIAL_CAPACITY = 40;
|
||||
|
||||
private final Map<ItemStack, TunnelType> tunnels = new HashMap<ItemStack, TunnelType>( INITIAL_CAPACITY );
|
||||
private final Map<ItemStack, TunnelType> tunnels = new HashMap<>( INITIAL_CAPACITY );
|
||||
private final Map<String, TunnelType> modIdTunnels = new HashMap<>( INITIAL_CAPACITY );
|
||||
|
||||
public void configure()
|
||||
|
||||
@@ -43,8 +43,8 @@ import appeng.recipes.RecipeHandler;
|
||||
*/
|
||||
public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
|
||||
{
|
||||
private final Map<String, Class<? extends ICraftHandler>> handlers = new HashMap<String, Class<? extends ICraftHandler>>( 20 );
|
||||
private final Collection<ISubItemResolver> resolvers = new LinkedList<ISubItemResolver>();
|
||||
private final Map<String, Class<? extends ICraftHandler>> handlers = new HashMap<>( 20 );
|
||||
private final Collection<ISubItemResolver> resolvers = new LinkedList<>();
|
||||
|
||||
@Override
|
||||
public void addNewCraftHandler( final String name, final Class<? extends ICraftHandler> handler )
|
||||
|
||||
@@ -36,7 +36,7 @@ public class SpecialComparisonRegistry implements ISpecialComparisonRegistry
|
||||
|
||||
public SpecialComparisonRegistry()
|
||||
{
|
||||
this.CompRegistry = new ArrayList<IItemComparisonProvider>();
|
||||
this.CompRegistry = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,7 +41,7 @@ public final class WirelessRegistry implements IWirelessTermRegistry
|
||||
|
||||
public WirelessRegistry()
|
||||
{
|
||||
this.handlers = new ArrayList<IWirelessTermHandler>();
|
||||
this.handlers = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -115,8 +115,8 @@ public final class WorldGenRegistry implements IWorldGen
|
||||
private static class TypeSet
|
||||
{
|
||||
|
||||
final HashSet<Class<? extends WorldProvider>> badProviders = new HashSet<Class<? extends WorldProvider>>();
|
||||
final HashSet<Integer> badDimensions = new HashSet<Integer>();
|
||||
final HashSet<Integer> enabledDimensions = new HashSet<Integer>();
|
||||
final HashSet<Class<? extends WorldProvider>> badProviders = new HashSet<>();
|
||||
final HashSet<Integer> badDimensions = new HashSet<>();
|
||||
final HashSet<Integer> enabledDimensions = new HashSet<>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class CellRegistry implements ICellRegistry
|
||||
|
||||
public CellRegistry()
|
||||
{
|
||||
this.handlers = new ArrayList<ICellHandler>();
|
||||
this.handlers = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -59,7 +59,7 @@ public class InscriberRecipe implements IInscriberRecipe
|
||||
|
||||
InscriberRecipe( @Nonnull final Collection<ItemStack> inputs, @Nonnull final ItemStack output, @Nullable final ItemStack top, @Nullable final ItemStack bot, @Nonnull final InscriberProcessType type )
|
||||
{
|
||||
this.inputs = new ArrayList<ItemStack>( inputs.size() );
|
||||
this.inputs = new ArrayList<>( inputs.size() );
|
||||
this.inputs.addAll( inputs );
|
||||
|
||||
this.output = output;
|
||||
|
||||
@@ -50,9 +50,9 @@ public final class InscriberRegistry implements IInscriberRegistry
|
||||
|
||||
public InscriberRegistry()
|
||||
{
|
||||
this.inputs = new HashSet<ItemStack>();
|
||||
this.optionals = new HashSet<ItemStack>();
|
||||
this.recipes = new HashSet<IInscriberRecipe>();
|
||||
this.inputs = new HashSet<>();
|
||||
this.optionals = new HashSet<>();
|
||||
this.recipes = new HashSet<>();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -128,7 +128,7 @@ public final class InscriberRegistry implements IInscriberRegistry
|
||||
@Override
|
||||
public Builder withInputs( @Nonnull final Collection<ItemStack> inputs )
|
||||
{
|
||||
this.inputs = new ArrayList<ItemStack>( inputs.size() );
|
||||
this.inputs = new ArrayList<>( inputs.size() );
|
||||
this.inputs.addAll( inputs );
|
||||
|
||||
return this;
|
||||
|
||||
@@ -53,7 +53,7 @@ import appeng.core.sync.packets.PacketValueConfig;
|
||||
|
||||
public class AppEngPacketHandlerBase
|
||||
{
|
||||
private static final Map<Class<? extends AppEngPacket>, PacketTypes> REVERSE_LOOKUP = new HashMap<Class<? extends AppEngPacket>, AppEngPacketHandlerBase.PacketTypes>();
|
||||
private static final Map<Class<? extends AppEngPacket>, PacketTypes> REVERSE_LOOKUP = new HashMap<>();
|
||||
|
||||
public enum PacketTypes
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket
|
||||
{
|
||||
this.data = null;
|
||||
this.compressFrame = null;
|
||||
this.list = new LinkedList<IAEItemStack>();
|
||||
this.list = new LinkedList<>();
|
||||
this.ref = stream.readByte();
|
||||
|
||||
// int originalBytes = stream.readableBytes();
|
||||
|
||||
@@ -101,7 +101,7 @@ final class SpawnData implements IWorldSpawnData
|
||||
@Override
|
||||
public Collection<NBTTagCompound> getNearByMeteorites( final int dim, final int chunkX, final int chunkZ )
|
||||
{
|
||||
final Collection<NBTTagCompound> ll = new LinkedList<NBTTagCompound>();
|
||||
final Collection<NBTTagCompound> ll = new LinkedList<>();
|
||||
|
||||
synchronized( SpawnData.class )
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn
|
||||
|
||||
private static final String GRID_STORAGE_CATEGORY = "gridstorage";
|
||||
|
||||
private final Map<GridStorageSearch, WeakReference<GridStorageSearch>> loadedStorage = new WeakHashMap<GridStorageSearch, WeakReference<GridStorageSearch>>( 10 );
|
||||
private final Map<GridStorageSearch, WeakReference<GridStorageSearch>> loadedStorage = new WeakHashMap<>( 10 );
|
||||
private final Configuration config;
|
||||
|
||||
private long lastGridStorage;
|
||||
@@ -80,8 +80,8 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn
|
||||
final String id = String.valueOf( storageID );
|
||||
final String data = this.config.get( "gridstorage", id, "" ).getString();
|
||||
final GridStorage thisStorage = new GridStorage( data, storageID, gss );
|
||||
gss.setGridStorage( new WeakReference<GridStorage>( thisStorage ) );
|
||||
this.loadedStorage.put( gss, new WeakReference<GridStorageSearch>( gss ) );
|
||||
gss.setGridStorage( new WeakReference<>( thisStorage ) );
|
||||
this.loadedStorage.put( gss, new WeakReference<>( gss ) );
|
||||
return thisStorage;
|
||||
}
|
||||
|
||||
@@ -98,8 +98,8 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn
|
||||
final long storageID = this.nextGridStorage();
|
||||
final GridStorageSearch gss = new GridStorageSearch( storageID );
|
||||
final GridStorage newStorage = new GridStorage( storageID, gss );
|
||||
gss.setGridStorage( new WeakReference<GridStorage>( newStorage ) );
|
||||
this.loadedStorage.put( gss, new WeakReference<GridStorageSearch>( gss ) );
|
||||
gss.setGridStorage( new WeakReference<>( newStorage ) );
|
||||
this.loadedStorage.put( gss, new WeakReference<>( gss ) );
|
||||
|
||||
return newStorage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user