Fix outposts to not break if the clan has blank banner pattern layers

This commit is contained in:
AlexTheCoder 2017-04-23 22:22:34 -04:00
parent 8ea90eb914
commit b14ecdbe4f

View File

@ -4,6 +4,7 @@ import java.io.File;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Objects;
import org.bukkit.Location;
import org.bukkit.Material;
@ -327,7 +328,7 @@ public enum OutpostType
{
continue;
}
build.put(UtilWorld.locToStr(loc), new OutpostBlockBanner(build, loc, schematic.getBlock(x, y, z), schematic.getData(x, y, z), cb.getBaseColor(), (Pattern[]) cb.getPatterns().stream().map(BannerPattern::getBukkitPattern).toArray()));
build.put(UtilWorld.locToStr(loc), new OutpostBlockBanner(build, loc, schematic.getBlock(x, y, z), schematic.getData(x, y, z), cb.getBaseColor(), cb.getPatterns().stream().map(BannerPattern::getBukkitPattern).filter(Objects::nonNull).toArray(size -> new Pattern[size])));
}
else
{