Replace ArrayList type fields with List

This commit is contained in:
Brady 2018-08-25 18:35:41 -05:00
parent 32a0f4eaac
commit 72c2a58ef2
No known key found for this signature in database
GPG Key ID: 73A788379A197567
4 changed files with 4 additions and 4 deletions

View File

@ -310,7 +310,7 @@ public class Settings {
@SuppressWarnings("unchecked")
public <T> List<Setting<T>> getByValueType(Class<T> klass) {
ArrayList<Setting<T>> result = new ArrayList<>();
List<Setting<T>> result = new ArrayList<>();
for (Setting<?> setting : allSettings) {
if (setting.klass.equals(klass)) {
result.add((Setting<T>) setting);

View File

@ -235,7 +235,7 @@ public final class CachedRegion implements IBlockTypeAccess {
short numSpecialBlockTypes = in.readShort();
for (int i = 0; i < numSpecialBlockTypes; i++) {
String blockName = in.readUTF();
ArrayList<BlockPos> locs = new ArrayList<>();
List<BlockPos> locs = new ArrayList<>();
location[x][z].put(blockName, locs);
short numLocations = in.readShort();
for (int j = 0; j < numLocations; j++) {

View File

@ -145,7 +145,7 @@ public class MovementDiagonal extends Movement {
if (toBreakCached != null) {
return toBreakCached;
}
ArrayList<BlockPos> result = new ArrayList<>();
List<BlockPos> result = new ArrayList<>();
for (int i = 4; i < 6; i++) {
if (!MovementHelper.canWalkThrough(positionsToBreak[i])) {
result.add(positionsToBreak[i]);

View File

@ -272,7 +272,7 @@ public class ExampleBaritoneControl extends Behavior {
}
if (msg.toLowerCase().equals("costs")) {
Movement[] movements = AStarPathFinder.getConnectedPositions(new BetterBlockPos(playerFeet()), new CalculationContext());
ArrayList<Movement> moves = new ArrayList<>(Arrays.asList(movements));
List<Movement> moves = new ArrayList<>(Arrays.asList(movements));
moves.sort(Comparator.comparingDouble(movement -> movement.getCost(new CalculationContext())));
for (Movement move : moves) {
String[] parts = move.getClass().toString().split("\\.");