convert several files to Java 8
There may be additional files that require changing
This commit is contained in:
@@ -59,22 +59,41 @@ public class McObjectConverter
|
||||
ELodDirection[] lodDirs = ELodDirection.values();
|
||||
directions = new Direction[lodDirs.length];
|
||||
lodDirections = new ELodDirection[lodDirs.length];
|
||||
for (ELodDirection lodDir : lodDirs) {
|
||||
Direction dir = switch (lodDir.name().toUpperCase()) {
|
||||
case "DOWN" -> Direction.DOWN;
|
||||
case "UP" -> Direction.UP;
|
||||
case "NORTH" -> Direction.NORTH;
|
||||
case "SOUTH" -> Direction.SOUTH;
|
||||
case "WEST" -> Direction.WEST;
|
||||
case "EAST" -> Direction.EAST;
|
||||
default -> null;
|
||||
};
|
||||
if (dir == null) {
|
||||
throw new IllegalArgumentException("Invalid direction on init mapping: " + lodDir);
|
||||
}
|
||||
directions[lodDir.ordinal()] = dir;
|
||||
lodDirections[dir.ordinal()] = lodDir;
|
||||
}
|
||||
for (ELodDirection lodDir : lodDirs)
|
||||
{
|
||||
Direction dir;
|
||||
switch (lodDir.name().toUpperCase())
|
||||
{
|
||||
case "DOWN":
|
||||
dir = Direction.DOWN;
|
||||
break;
|
||||
case "UP":
|
||||
dir = Direction.UP;
|
||||
break;
|
||||
case "NORTH":
|
||||
dir = Direction.NORTH;
|
||||
break;
|
||||
case "SOUTH":
|
||||
dir = Direction.SOUTH;
|
||||
break;
|
||||
case "WEST":
|
||||
dir = Direction.WEST;
|
||||
break;
|
||||
case "EAST":
|
||||
dir = Direction.EAST;
|
||||
break;
|
||||
default:
|
||||
dir = null;
|
||||
break;
|
||||
}
|
||||
|
||||
if (dir == null)
|
||||
{
|
||||
throw new IllegalArgumentException("Invalid direction on init mapping: " + lodDir);
|
||||
}
|
||||
directions[lodDir.ordinal()] = dir;
|
||||
lodDirections[dir.ordinal()] = lodDir;
|
||||
}
|
||||
}
|
||||
|
||||
public static BlockPos Convert(DhBlockPos wrappedPos) {
|
||||
|
||||
@@ -97,16 +97,18 @@ public class WrapperFactory implements IWrapperFactory
|
||||
else if (objectArray.length == 2)
|
||||
{
|
||||
// chunk
|
||||
if (!(objectArray[0] instanceof ChunkAccess chunk))
|
||||
if (!(objectArray[0] instanceof ChunkAccess))
|
||||
{
|
||||
throw new ClassCastException(createChunkWrapperErrorMessage(objectArray));
|
||||
}
|
||||
ChunkAccess chunk = (ChunkAccess) objectArray[0];
|
||||
|
||||
// light source
|
||||
if (!(objectArray[1] instanceof LevelReader lightSource))
|
||||
if (!(objectArray[1] instanceof LevelReader))
|
||||
{
|
||||
throw new ClassCastException(createChunkWrapperErrorMessage(objectArray));
|
||||
}
|
||||
LevelReader lightSource = (LevelReader) objectArray[1];
|
||||
|
||||
|
||||
return new ChunkWrapper(chunk, lightSource, /*A DH wrapped level isn't necessary*/null);
|
||||
|
||||
+1
-1
Submodule coreSubProjects updated: 924465a788...5174c71363
Reference in New Issue
Block a user