I guess people need to be yelled at for bad schematics
This commit is contained in:
@@ -511,6 +511,8 @@ public class Schematics implements Loadable{
|
|||||||
try(DataInputStream stream = new DataInputStream(new InflaterInputStream(input))){
|
try(DataInputStream stream = new DataInputStream(new InflaterInputStream(input))){
|
||||||
short width = stream.readShort(), height = stream.readShort();
|
short width = stream.readShort(), height = stream.readShort();
|
||||||
|
|
||||||
|
if(width > 128 || height > 128) throw new IOException("Invalid schematic: Too large (max possible size is 128x128)");
|
||||||
|
|
||||||
StringMap map = new StringMap();
|
StringMap map = new StringMap();
|
||||||
int tags = stream.readUnsignedByte();
|
int tags = stream.readUnsignedByte();
|
||||||
for(int i = 0; i < tags; i++){
|
for(int i = 0; i < tags; i++){
|
||||||
@@ -534,6 +536,9 @@ public class Schematics implements Loadable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
int total = stream.readInt();
|
int total = stream.readInt();
|
||||||
|
|
||||||
|
if(total > 128 * 128) throw new IOException("Invalid schematic: Too many blocks.");
|
||||||
|
|
||||||
Seq<Stile> tiles = new Seq<>(total);
|
Seq<Stile> tiles = new Seq<>(total);
|
||||||
for(int i = 0; i < total; i++){
|
for(int i = 0; i < total; i++){
|
||||||
Block block = blocks.get(stream.readByte());
|
Block block = blocks.get(stream.readByte());
|
||||||
|
|||||||
Reference in New Issue
Block a user