switch all methods to list

This commit is contained in:
Bella 2020-03-31 17:20:43 -04:00
parent 3f0139a870
commit d3ff6c38a0
No known key found for this signature in database
GPG Key ID: 815562EA23BFE344
1 changed files with 4 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import java.util.ArrayList;
import java.util.List;
/**
* Utilities for managing and transforming blockPos positions
@ -65,7 +66,7 @@ public class VectorUtil {
* @param pos2 Ending vector
* @return rounded block positions inside a 3d area between pos1 and pos2
*/
public static ArrayList<BlockPos> getBlockPositionsInArea(Vec3d pos1, Vec3d pos2) {
public static List<BlockPos> getBlockPositionsInArea(Vec3d pos1, Vec3d pos2) {
int minX = (int) Math.round(Math.min(pos1.x, pos2.x));
int maxX = (int) Math.round(Math.max(pos1.x, pos2.x));
@ -85,7 +86,7 @@ public class VectorUtil {
* @param pos2 Ending blockPos
* @return block positions inside a 3d area between pos1 and pos2
*/
public static ArrayList<BlockPos> getBlockPositionsInArea(BlockPos pos1, BlockPos pos2) {
public static List<BlockPos> getBlockPositionsInArea(BlockPos pos1, BlockPos pos2) {
int minX = Math.min(pos1.x, pos2.x);
int maxX = Math.max(pos1.x, pos2.x);
@ -98,7 +99,7 @@ public class VectorUtil {
return getBlockPos(minX, maxX, minY, maxY, minZ, maxZ);
}
private static ArrayList<BlockPos> getBlockPos(int minX, int maxX, int minY, int maxY, int minZ, int maxZ) {
private static List<BlockPos> getBlockPos(int minX, int maxX, int minY, int maxY, int minZ, int maxZ) {
ArrayList<BlockPos> returnList = new ArrayList<>((maxX - minX) * (maxY - minY) * (maxZ - minZ));
for (int x = minX; x < maxX; x++) {