Program: 41963
Project: 41963
Buggy source:
@SuppressWarnings("String_Node_Str") public Schematic createCompiledSchematic(IWorld world,com.worldcretornica.plotme_core.api.Vector loc1,com.worldcretornica.plotme_core.api.Vector loc2){
  Schematic schem;
  int minX=Math.min(loc1.getBlockX(),loc2.getBlockX());
  int maxX=Math.max(loc1.getBlockX(),loc2.getBlockX());
  int minY=Math.min(loc1.getBlockY(),loc2.getBlockY());
  int maxY=Math.max(loc1.getBlockY(),loc2.getBlockY());
  int minZ=Math.min(loc1.getBlockZ(),loc2.getBlockZ());
  int maxZ=Math.max(loc1.getBlockZ(),loc2.getBlockZ());
  short length=(short)(maxZ - minZ + 1);
  short width=(short)(maxX - minX + 1);
  short height=(short)(maxY - minY + 1);
  int[] blocks=new int[length * width * height];
  byte[] blockData=new byte[length * width * height];
  List<Entity> entities=new ArrayList<>();
  List<TileEntity> tileentities=new ArrayList<>();
  for (int x=0; x < width; ++x) {
    for (int z=0; z < length; ++z) {
      for (int y=0; y < height; ++y) {
        int index=y * width * length + z * width + x;
        IBlock block=world.getBlockAt(x + minX,y + minY,z + minZ);
        blocks[index]=block.getTypeId();
        blockData[index]=block.getData();
        boolean isTileEntity=false;
        BlockState bs=block.getState();
        byte rot=0;
        byte skulltype=0;
        byte note=0;
        int record=0;
        int outputsignal=0;
        int transfercooldown=0;
        int levels=0;
        int primary=0;
        int secondary=0;
        int base=0;
        RecordItem recorditem=null;
        short delay=0;
        short maxnearbyentities=0;
        short maxspawndelay=0;
        short minspawndelay=0;
        short requiredplayerrange=0;
        short spawncount=0;
        short spawnrange=0;
        short burntime=0;
        short cooktime=0;
        short brewtime=0;
        String entityid=null;
        String customname=null;
        String id=null;
        String text1=null;
        String text2=null;
        String text3=null;
        String text4=null;
        String command=null;
        List<Item> items=null;
        List<Pattern> patterns=null;
        if (bs instanceof Skull) {
          Skull skull=(Skull)bs;
switch (skull.getRotation()) {
case NORTH:
            rot=0;
          break;
case NORTH_NORTH_EAST:
        rot=1;
      break;
case UP:
    break;
case DOWN:
  break;
case NORTH_EAST:
rot=2;
break;
case EAST_NORTH_EAST:
rot=3;
break;
case EAST:
rot=4;
break;
case EAST_SOUTH_EAST:
rot=5;
break;
case SOUTH_EAST:
rot=6;
break;
case SOUTH_SOUTH_EAST:
rot=7;
break;
case SOUTH:
rot=8;
break;
case SOUTH_SOUTH_WEST:
rot=9;
break;
case SOUTH_WEST:
rot=10;
break;
case WEST_SOUTH_WEST:
rot=11;
break;
case WEST:
rot=12;
break;
case WEST_NORTH_WEST:
rot=13;
break;
case NORTH_WEST:
rot=14;
break;
case NORTH_NORTH_WEST:
rot=15;
break;
case SELF:
break;
default :
rot=0;
break;
}
skulltype=(byte)skull.getSkullType().ordinal();
isTileEntity=true;
}
if (bs instanceof CreatureSpawner) {
CreatureSpawner spawner=(CreatureSpawner)bs;
entityid=spawner.getCreatureTypeName();
delay=(short)spawner.getDelay();
isTileEntity=true;
}
if (bs instanceof Furnace) {
Furnace furnace=(Furnace)bs;
burntime=furnace.getBurnTime();
cooktime=furnace.getCookTime();
isTileEntity=true;
}
if (bs instanceof Sign) {
Sign sign=(Sign)bs;
text1=sign.getLine(0);
text2=sign.getLine(1);
text3=sign.getLine(2);
text4=sign.getLine(3);
isTileEntity=true;
}
if (bs instanceof CommandBlock) {
CommandBlock cb=(CommandBlock)bs;
command=cb.getCommand();
isTileEntity=true;
}
if (bs instanceof BrewingStand) {
BrewingStand brew=(BrewingStand)bs;
brewtime=(short)brew.getBrewingTime();
isTileEntity=true;
}
if (bs instanceof Jukebox) {
Jukebox jb=(Jukebox)bs;
record=jb.getPlaying().getId();
isTileEntity=true;
}
if (bs instanceof NoteBlock) {
NoteBlock nb=(NoteBlock)bs;
note=nb.getRawNote();
isTileEntity=true;
}
if (bs instanceof InventoryHolder) {
InventoryHolder ih=(InventoryHolder)bs;
Inventory inventory=ih.getInventory();
if (inventory.getSize() > 0) {
items=new ArrayList<>();
for (byte slot=0; slot < inventory.getSize(); slot++) {
ItemStack is=inventory.getItem(slot);
if (is != null) {
Item item=getItem(is,slot);
items.add(item);
}
}
}
isTileEntity=true;
}
if (bs instanceof Banner) {
Banner banner=(Banner)bs;
patterns=new ArrayList<>();
base=(int)banner.getBaseColor().getDyeData();
for (org.bukkit.block.banner.Pattern pattern : banner.getPatterns()) {
patterns.add(new Pattern((int)pattern.getColor().getDyeData(),pattern.getPattern().getIdentifier()));
}
isTileEntity=true;
}
if (isTileEntity) {
TileEntity te=new TileEntity(x,y,z,customname,id,items,rot,skulltype,delay,maxnearbyentities,maxspawndelay,minspawndelay,requiredplayerrange,spawncount,spawnrange,entityid,burntime,cooktime,text1,text2,text3,text4,note,record,recorditem,brewtime,command,outputsignal,transfercooldown,levels,primary,secondary,patterns,base);
tileentities.add(te);
}
}
}
}
for (IEntity bukkitentity : world.getEntities()) {
ILocation entloc=bukkitentity.getLocation();
if (entloc.getX() >= minX && entloc.getX() <= maxX && entloc.getY() >= minY && entloc.getY() <= maxY && entloc.getZ() >= minZ && entloc.getZ() <= maxZ && !(bukkitentity instanceof Player)) {
entities.add(getEntity(bukkitentity,minX,minY,minZ));
}
}
schem=new Schematic(blocks,blockData,"String_Node_Str",width,length,height,entities,tileentities,0,0,0);
return schem;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Schematic createCompiledSchematic(IWorld world,com.worldcretornica.plotme_core.api.Vector loc1,com.worldcretornica.plotme_core.api.Vector loc2){
  Schematic schem;
  int minX=Math.min(loc1.getBlockX(),loc2.getBlockX());
  int maxX=Math.max(loc1.getBlockX(),loc2.getBlockX());
  int minY=Math.min(loc1.getBlockY(),loc2.getBlockY());
  int maxY=Math.max(loc1.getBlockY(),loc2.getBlockY());
  int minZ=Math.min(loc1.getBlockZ(),loc2.getBlockZ());
  int maxZ=Math.max(loc1.getBlockZ(),loc2.getBlockZ());
  short length=(short)(maxZ - minZ + 1);
  short width=(short)(maxX - minX + 1);
  short height=(short)(maxY - minY + 1);
  int[] blocks=new int[length * width * height];
  byte[] blockData=new byte[length * width * height];
  List<Entity> entities=new ArrayList<>();
  List<TileEntity> tileentities=new ArrayList<>();
  for (int x=0; x < width; ++x) {
    for (int z=0; z < length; ++z) {
      for (int y=0; y < height; ++y) {
        int index=y * width * length + z * width + x;
        IBlock block=world.getBlockAt(x + minX,y + minY,z + minZ);
        blocks[index]=block.getTypeId();
        blockData[index]=block.getData();
        boolean isTileEntity=false;
        BlockState bs=block.getState();
        byte rot=0;
        byte skulltype=0;
        byte note=0;
        int record=0;
        int outputsignal=0;
        int transfercooldown=0;
        int levels=0;
        int primary=0;
        int secondary=0;
        int base=0;
        RecordItem recorditem=null;
        short delay=0;
        short maxnearbyentities=0;
        short maxspawndelay=0;
        short minspawndelay=0;
        short requiredplayerrange=0;
        short spawncount=0;
        short spawnrange=0;
        short burntime=0;
        short cooktime=0;
        short brewtime=0;
        String entityid=null;
        String customname=null;
        String id=null;
        String text1=null;
        String text2=null;
        String text3=null;
        String text4=null;
        String command=null;
        List<Item> items=null;
        List<Pattern> patterns=null;
        if (bs instanceof Skull) {
          Skull skull=(Skull)bs;
switch (skull.getRotation()) {
case NORTH:
            rot=0;
          break;
case NORTH_NORTH_EAST:
        rot=1;
      break;
case UP:
    break;
case DOWN:
  break;
case NORTH_EAST:
rot=2;
break;
case EAST_NORTH_EAST:
rot=3;
break;
case EAST:
rot=4;
break;
case EAST_SOUTH_EAST:
rot=5;
break;
case SOUTH_EAST:
rot=6;
break;
case SOUTH_SOUTH_EAST:
rot=7;
break;
case SOUTH:
rot=8;
break;
case SOUTH_SOUTH_WEST:
rot=9;
break;
case SOUTH_WEST:
rot=10;
break;
case WEST_SOUTH_WEST:
rot=11;
break;
case WEST:
rot=12;
break;
case WEST_NORTH_WEST:
rot=13;
break;
case NORTH_WEST:
rot=14;
break;
case NORTH_NORTH_WEST:
rot=15;
break;
case SELF:
break;
default :
rot=0;
break;
}
skulltype=(byte)skull.getSkullType().ordinal();
isTileEntity=true;
}
if (bs instanceof CreatureSpawner) {
CreatureSpawner spawner=(CreatureSpawner)bs;
entityid=spawner.getCreatureTypeName();
delay=(short)spawner.getDelay();
isTileEntity=true;
}
if (bs instanceof Furnace) {
Furnace furnace=(Furnace)bs;
burntime=furnace.getBurnTime();
cooktime=furnace.getCookTime();
isTileEntity=true;
}
if (bs instanceof Sign) {
Sign sign=(Sign)bs;
text1=sign.getLine(0);
text2=sign.getLine(1);
text3=sign.getLine(2);
text4=sign.getLine(3);
isTileEntity=true;
}
if (bs instanceof CommandBlock) {
CommandBlock cb=(CommandBlock)bs;
command=cb.getCommand();
isTileEntity=true;
}
if (bs instanceof BrewingStand) {
BrewingStand brew=(BrewingStand)bs;
brewtime=(short)brew.getBrewingTime();
isTileEntity=true;
}
if (bs instanceof Jukebox) {
Jukebox jb=(Jukebox)bs;
record=jb.getPlaying().getId();
isTileEntity=true;
}
if (bs instanceof NoteBlock) {
NoteBlock nb=(NoteBlock)bs;
note=nb.getRawNote();
isTileEntity=true;
}
if (bs instanceof InventoryHolder) {
InventoryHolder ih=(InventoryHolder)bs;
Inventory inventory=ih.getInventory();
if (inventory.getSize() > 0) {
items=new ArrayList<>();
for (byte slot=0; slot < inventory.getSize(); slot++) {
ItemStack is=inventory.getItem(slot);
if (is != null) {
Item item=getItem(is,slot);
items.add(item);
}
}
}
isTileEntity=true;
}
if (bs instanceof Banner) {
Banner banner=(Banner)bs;
patterns=new ArrayList<>();
base=(int)banner.getBaseColor().getDyeData();
for (org.bukkit.block.banner.Pattern pattern : banner.getPatterns()) {
patterns.add(new Pattern((int)pattern.getColor().getDyeData(),pattern.getPattern().getIdentifier()));
}
isTileEntity=true;
}
if (isTileEntity) {
TileEntity te=new TileEntity(x,y,z,customname,id,items,rot,skulltype,delay,maxnearbyentities,maxspawndelay,minspawndelay,requiredplayerrange,spawncount,spawnrange,entityid,burntime,cooktime,text1,text2,text3,text4,note,record,recorditem,brewtime,command,outputsignal,transfercooldown,levels,primary,secondary,patterns,base);
tileentities.add(te);
}
}
}
}
for (IEntity bukkitentity : world.getEntities()) {
Location entloc=bukkitentity.getLocation();
if (entloc.getX() >= minX && entloc.getX() <= maxX && entloc.getY() >= minY && entloc.getY() <= maxY && entloc.getZ() >= minZ && entloc.getZ() <= maxZ && !(bukkitentity instanceof Player)) {
entities.add(getEntity(bukkitentity,minX,minY,minZ));
}
}
schem=new Schematic(blocks,blockData,"String_Node_Str",width,length,height,entities,tileentities,0,0,0);
return schem;
}