Basic schematic based generation

This commit is contained in:
Anuken
2020-06-05 10:45:57 -04:00
parent 17b1eaf1b6
commit d9e05907af
16 changed files with 272 additions and 71 deletions

View File

@@ -94,12 +94,12 @@ public abstract class SaveFileReader{
return length;
}
public void skipRegion(DataInput input) throws IOException{
skipRegion(input, false);
public void skipChunk(DataInput input) throws IOException{
skipChunk(input, false);
}
/** Skip a region completely. */
public void skipRegion(DataInput input, boolean isByte) throws IOException{
/** Skip a chunk completely, discarding the bytes. */
public void skipChunk(DataInput input, boolean isByte) throws IOException{
int length = readChunk(input, isByte, t -> {});
int skipped = input.skipBytes(length);
if(length != skipped){

View File

@@ -245,7 +245,7 @@ public abstract class SaveVersion extends SaveFileReader{
}
}else{
//skip the entity region, as the entity and its IO code are now gone
skipRegion(stream, true);
skipChunk(stream, true);
}
}
}else{

View File

@@ -110,7 +110,7 @@ public abstract class LegacySaveVersion extends SaveVersion{
int amount = stream.readInt();
for(int j = 0; j < amount; j++){
//simply skip all the entities
skipRegion(stream, true);
skipChunk(stream, true);
}
}
}