Use weaker collection types

This commit is contained in:
thatsIch 2015-05-09 00:04:44 +02:00
parent b8f22202d4
commit 16c0fbe3c1
18 changed files with 31 additions and 26 deletions

View file

@ -24,7 +24,7 @@
package appeng.api.util;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@ -43,5 +43,5 @@ public interface ICommonTile
* @param z z pos of tile entity
* @param drops drops of tile entity
*/
void getDrops( World world, int x, int y, int z, ArrayList<ItemStack> drops );
void getDrops( World world, int x, int y, int z, List<ItemStack> drops );
}

View file

@ -21,6 +21,7 @@ package appeng.crafting;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import net.minecraft.nbt.NBTTagCompound;
@ -47,7 +48,7 @@ public class CraftingJob implements Runnable, ICraftingJob
{
final IItemList<IAEItemStack> storage;
final HashSet<IAEItemStack> prophecies;
final Set<IAEItemStack> prophecies;
final MECraftingInventory original;
final World world;
final IItemList<IAEItemStack> crafting = AEApi.instance().storage().createItemList();

View file

@ -21,6 +21,7 @@ package appeng.helpers;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import appeng.api.config.SecurityPermissions;
import appeng.api.networking.security.ISecurityRegistry;
@ -29,7 +30,7 @@ import appeng.api.networking.security.ISecurityRegistry;
public class PlayerSecurityWrapper implements ISecurityRegistry
{
final HashMap<Integer, EnumSet<SecurityPermissions>> target;
final Map<Integer, EnumSet<SecurityPermissions>> target;
public PlayerSecurityWrapper( HashMap<Integer, EnumSet<SecurityPermissions>> playerPerms )
{

View file

@ -198,7 +198,7 @@ public class NEIAEShapedRecipeHandler extends TemplateRecipeHandler
public class CachedShapedRecipe extends TemplateRecipeHandler.CachedRecipe
{
public final ArrayList<PositionedStack> ingredients;
public final List<PositionedStack> ingredients;
public final PositionedStack result;
public CachedShapedRecipe( ShapedRecipe recipe )

View file

@ -198,7 +198,7 @@ public class NEIAEShapelessRecipeHandler extends TemplateRecipeHandler
public class CachedShapelessRecipe extends TemplateRecipeHandler.CachedRecipe
{
public final ArrayList<PositionedStack> ingredients;
public final List<PositionedStack> ingredients;
public final PositionedStack result;
public CachedShapelessRecipe( ShapelessRecipe recipe )

View file

@ -196,7 +196,7 @@ public class NEIFacadeRecipeHandler extends TemplateRecipeHandler
private final class CachedShapedRecipe extends TemplateRecipeHandler.CachedRecipe
{
public final ArrayList<PositionedStack> ingredients;
public final List<PositionedStack> ingredients;
public final PositionedStack result;
public CachedShapedRecipe( IFacadeItem facade, ItemStack anchor, ItemStack output )

View file

@ -163,7 +163,7 @@ public class NEIInscriberRecipeHandler extends TemplateRecipeHandler
public class CachedInscriberRecipe extends TemplateRecipeHandler.CachedRecipe
{
public final ArrayList<PositionedStack> ingredients;
public final List<PositionedStack> ingredients;
public final PositionedStack result;
public CachedInscriberRecipe( IInscriberRecipe recipe )

View file

@ -175,7 +175,7 @@ public class GridNode implements IGridNode, IPathItem
gcv.visitConnection( nextConn.poll() );
}
LinkedList<GridNode> thisRun = nextRun;
Iterable<GridNode> thisRun = nextRun;
nextRun = new LinkedList<GridNode>();
for( GridNode n : thisRun )
@ -188,7 +188,7 @@ public class GridNode implements IGridNode, IPathItem
{
while( !nextRun.isEmpty() )
{
LinkedList<GridNode> thisRun = nextRun;
Iterable<GridNode> thisRun = nextRun;
nextRun = new LinkedList<GridNode>();
for( GridNode n : thisRun )

View file

@ -479,7 +479,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
* @param drops drops of tile entity
*/
@Override
public void getDrops( World w, int x, int y, int z, ArrayList<ItemStack> drops )
public void getDrops( World w, int x, int y, int z, List<ItemStack> drops )
{
if( this instanceof IInventory )
{
@ -496,7 +496,7 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
}
}
public void getNoDrops( World w, int x, int y, int z, ArrayList<ItemStack> drops )
public void getNoDrops( World w, int x, int y, int z, List<ItemStack> drops )
{
}

View file

@ -20,7 +20,7 @@ package appeng.tile.crafting;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import io.netty.buffer.ByteBuf;
@ -398,7 +398,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
}
@Override
public void getDrops( World w, int x, int y, int z, ArrayList<ItemStack> drops )
public void getDrops( World w, int x, int y, int z, List<ItemStack> drops )
{
super.getDrops( w, x, y, z, drops );

View file

@ -19,7 +19,7 @@
package appeng.tile.misc;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@ -235,7 +235,7 @@ public class TileCellWorkbench extends AEBaseTile implements IUpgradeableHost, I
}
@Override
public void getDrops( World w, int x, int y, int z, ArrayList<ItemStack> drops )
public void getDrops( World w, int x, int y, int z, List<ItemStack> drops )
{
super.getDrops( w, x, y, z, drops );

View file

@ -20,7 +20,6 @@ package appeng.tile.misc;
import java.io.IOException;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import javax.annotation.Nullable;
@ -194,7 +193,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
@Override
public void getDrops( World w, int x, int y, int z, ArrayList<ItemStack> drops )
public void getDrops( World w, int x, int y, int z, List<ItemStack> drops )
{
super.getDrops( w, x, y, z, drops );

View file

@ -21,6 +21,7 @@ package appeng.tile.misc;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import com.google.common.collect.ImmutableSet;
@ -127,7 +128,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IT
}
@Override
public void getDrops( World w, int x, int y, int z, ArrayList<ItemStack> drops )
public void getDrops( World w, int x, int y, int z, List<ItemStack> drops )
{
this.duality.addDrops( drops );
}

View file

@ -22,6 +22,7 @@ package appeng.tile.misc;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
@ -50,7 +51,7 @@ public class TilePaint extends AEBaseTile
static final int LIGHT_PER_DOT = 12;
int isLit = 0;
ArrayList<Splotch> dots = null;
List<Splotch> dots = null;
@TileEvent( TileEventType.WORLD_NBT_WRITE )
public void writeToNBT_TilePaint( NBTTagCompound data )

View file

@ -22,6 +22,7 @@ package appeng.tile.misc;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import io.netty.buffer.ByteBuf;
@ -114,7 +115,7 @@ public class TileSecurity extends AENetworkTile implements ITerminalHost, IAEApp
}
@Override
public void getDrops( World w, int x, int y, int z, ArrayList<ItemStack> drops )
public void getDrops( World w, int x, int y, int z, List<ItemStack> drops )
{
if( !this.configSlot.isEmpty() )
{

View file

@ -194,13 +194,13 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
}
@Override
public void getDrops( World w, int x, int y, int z, ArrayList drops )
public void getDrops( World w, int x, int y, int z, List drops )
{
this.cb.getDrops( drops );
}
@Override
public void getNoDrops( World w, int x, int y, int z, ArrayList<ItemStack> drops )
public void getNoDrops( World w, int x, int y, int z, List<ItemStack> drops )
{
this.cb.getNoDrops( drops );
}

View file

@ -19,7 +19,7 @@
package appeng.tile.storage;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.inventory.IInventory;
@ -562,7 +562,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
* @param drops drops of tile entity
*/
@Override
public void getDrops( World w, int x, int y, int z, ArrayList<ItemStack> drops )
public void getDrops( World w, int x, int y, int z, List<ItemStack> drops )
{
super.getDrops( w, x, y, z, drops );

View file

@ -22,6 +22,7 @@ package appeng.util.inv;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@ -35,7 +36,7 @@ public class WrapperChainedInventory implements IInventory
int fullSize = 0;
private List<IInventory> l;
private HashMap<Integer, InvOffset> offsets;
private Map<Integer, InvOffset> offsets;
public WrapperChainedInventory( IInventory... inventories )
{