Program: 33856
Project: 33856
Buggy source:
@SuppressWarnings("String_Node_Str") public Schematic(ASkyBlock plugin,File file) throws IOException {
  this.plugin=plugin;
  short[] blocks;
  byte[] data;
  name=file.getName();
  heading="String_Node_Str";
  description="String_Node_Str";
  perm="String_Node_Str";
  icon=Material.MAP;
  rating=50;
  useDefaultChest=true;
  biome=Settings.defaultBiome;
  usePhysics=Settings.usePhysics;
  islandCompanion=new ArrayList<EntityType>();
  islandCompanion.add(Settings.islandCompanion);
  companionNames=Settings.companionNames;
  defaultChestItems=Settings.chestItems;
  pasteEntities=false;
  visible=true;
  order=0;
  bedrock=null;
  chest=null;
  welcomeSign=null;
  topGrass=null;
  playerSpawn=null;
  partnerName="String_Node_Str";
  attachable.add(Material.STONE_BUTTON.getId());
  attachable.add(Material.WOOD_BUTTON.getId());
  attachable.add(Material.COCOA.getId());
  attachable.add(Material.LADDER.getId());
  attachable.add(Material.LEVER.getId());
  attachable.add(Material.PISTON_EXTENSION.getId());
  attachable.add(Material.REDSTONE_TORCH_OFF.getId());
  attachable.add(Material.REDSTONE_TORCH_ON.getId());
  attachable.add(Material.WALL_SIGN.getId());
  attachable.add(Material.TORCH.getId());
  attachable.add(Material.TRAP_DOOR.getId());
  attachable.add(Material.TRIPWIRE_HOOK.getId());
  attachable.add(Material.VINE.getId());
  attachable.add(Material.WOODEN_DOOR.getId());
  attachable.add(Material.IRON_DOOR.getId());
  attachable.add(Material.RED_MUSHROOM.getId());
  attachable.add(Material.BROWN_MUSHROOM.getId());
  attachable.add(Material.PORTAL.getId());
  paintingList.put("String_Node_Str",Art.KEBAB);
  paintingList.put("String_Node_Str",Art.AZTEC);
  paintingList.put("String_Node_Str",Art.ALBAN);
  paintingList.put("String_Node_Str",Art.AZTEC2);
  paintingList.put("String_Node_Str",Art.BOMB);
  paintingList.put("String_Node_Str",Art.PLANT);
  paintingList.put("String_Node_Str",Art.WASTELAND);
  paintingList.put("String_Node_Str",Art.WANDERER);
  paintingList.put("String_Node_Str",Art.GRAHAM);
  paintingList.put("String_Node_Str",Art.POOL);
  paintingList.put("String_Node_Str",Art.COURBET);
  paintingList.put("String_Node_Str",Art.SUNSET);
  paintingList.put("String_Node_Str",Art.SEA);
  paintingList.put("String_Node_Str",Art.CREEBET);
  paintingList.put("String_Node_Str",Art.MATCH);
  paintingList.put("String_Node_Str",Art.BUST);
  paintingList.put("String_Node_Str",Art.STAGE);
  paintingList.put("String_Node_Str",Art.VOID);
  paintingList.put("String_Node_Str",Art.SKULL_AND_ROSES);
  paintingList.put("String_Node_Str",Art.WITHER);
  paintingList.put("String_Node_Str",Art.FIGHTERS);
  paintingList.put("String_Node_Str",Art.SKELETON);
  paintingList.put("String_Node_Str",Art.DONKEYKONG);
  paintingList.put("String_Node_Str",Art.POINTER);
  paintingList.put("String_Node_Str",Art.PIGSCENE);
  paintingList.put("String_Node_Str",Art.BURNINGSKULL);
  facingList.put((byte)0,BlockFace.SOUTH);
  facingList.put((byte)1,BlockFace.WEST);
  facingList.put((byte)2,BlockFace.NORTH);
  facingList.put((byte)3,BlockFace.EAST);
  rotationList.put((byte)0,Rotation.NONE);
  rotationList.put((byte)2,Rotation.CLOCKWISE);
  rotationList.put((byte)4,Rotation.FLIPPED);
  rotationList.put((byte)6,Rotation.COUNTER_CLOCKWISE);
  if (!Bukkit.getServer().getVersion().contains("String_Node_Str")) {
    rotationList.put((byte)1,Rotation.CLOCKWISE_45);
    rotationList.put((byte)3,Rotation.CLOCKWISE_135);
    rotationList.put((byte)5,Rotation.FLIPPED_45);
    rotationList.put((byte)7,Rotation.COUNTER_CLOCKWISE_45);
  }
  try {
    nms=Util.checkVersion();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (!Bukkit.getServer().getVersion().contains("String_Node_Str")) {
    attachable.add(Material.IRON_TRAPDOOR.getId());
    attachable.add(Material.WALL_BANNER.getId());
    attachable.add(Material.ACACIA_DOOR.getId());
    attachable.add(Material.BIRCH_DOOR.getId());
    attachable.add(Material.SPRUCE_DOOR.getId());
    attachable.add(Material.DARK_OAK_DOOR.getId());
    attachable.add(Material.JUNGLE_DOOR.getId());
  }
  this.file=file;
  try {
    FileInputStream stream=new FileInputStream(file);
    NBTInputStream nbtStream=new NBTInputStream(stream);
    CompoundTag schematicTag=(CompoundTag)nbtStream.readTag();
    nbtStream.close();
    stream.close();
    if (!schematicTag.getName().equals("String_Node_Str")) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    Map<String,Tag> schematic=schematicTag.getValue();
    Vector origin=null;
    try {
      int originX=getChildTag(schematic,"String_Node_Str",IntTag.class).getValue();
      int originY=getChildTag(schematic,"String_Node_Str",IntTag.class).getValue();
      int originZ=getChildTag(schematic,"String_Node_Str",IntTag.class).getValue();
      Vector min=new Vector(originX,originY,originZ);
      origin=min.clone();
    }
 catch (    Exception ignored) {
    }
    if (!schematic.containsKey("String_Node_Str")) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    width=getChildTag(schematic,"String_Node_Str",ShortTag.class).getValue();
    length=getChildTag(schematic,"String_Node_Str",ShortTag.class).getValue();
    height=getChildTag(schematic,"String_Node_Str",ShortTag.class).getValue();
    String materials=getChildTag(schematic,"String_Node_Str",StringTag.class).getValue();
    if (!materials.equals("String_Node_Str")) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    byte[] blockId=getChildTag(schematic,"String_Node_Str",ByteArrayTag.class).getValue();
    data=getChildTag(schematic,"String_Node_Str",ByteArrayTag.class).getValue();
    byte[] addId=new byte[0];
    blocks=new short[blockId.length];
    if (schematic.containsKey("String_Node_Str")) {
      addId=getChildTag(schematic,"String_Node_Str",ByteArrayTag.class).getValue();
    }
    for (int index=0; index < blockId.length; index++) {
      if ((index >> 1) >= addId.length) {
        blocks[index]=(short)(blockId[index] & 0xFF);
      }
 else {
        if ((index & 1) == 0) {
          blocks[index]=(short)(((addId[index >> 1] & 0x0F) << 8) + (blockId[index] & 0xFF));
        }
 else {
          blocks[index]=(short)(((addId[index >> 1] & 0xF0) << 4) + (blockId[index] & 0xFF));
        }
      }
    }
    List<Tag> entities=getChildTag(schematic,"String_Node_Str",ListTag.class).getValue();
    for (    Tag tag : entities) {
      if (!(tag instanceof CompoundTag))       continue;
      CompoundTag t=(CompoundTag)tag;
      EntityObject ent=new EntityObject();
      for (      Map.Entry<String,Tag> entry : t.getValue().entrySet()) {
        if (entry.getKey().equals("String_Node_Str")) {
          String id=((StringTag)entry.getValue()).getValue().toUpperCase();
          if (id.startsWith("String_Node_Str")) {
            id=id.substring(10);
          }
          if (IslandBlock.WEtoME.containsKey(id)) {
            ent.setType(IslandBlock.WEtoME.get(id));
          }
 else           if (!id.equalsIgnoreCase("String_Node_Str")) {
            for (            EntityType type : EntityType.values()) {
              if (type.toString().equals(id)) {
                ent.setType(type);
                break;
              }
            }
          }
        }
        if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ListTag) {
            List<Tag> pos=new ArrayList<Tag>();
            pos=((ListTag)entry.getValue()).getValue();
            if (pos.size() == 3) {
              double x=(double)pos.get(0).getValue() - origin.getX();
              double y=(double)pos.get(1).getValue() - origin.getY();
              double z=(double)pos.get(2).getValue() - origin.getZ();
              ent.setLocation(new BlockVector(x,y,z));
            }
 else {
              ent.setLocation(new BlockVector(0,0,0));
            }
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ListTag) {
            List<Tag> pos=new ArrayList<Tag>();
            pos=((ListTag)entry.getValue()).getValue();
            if (pos.size() == 3) {
              ent.setMotion(new Vector((double)pos.get(0).getValue(),(double)pos.get(1).getValue(),(double)pos.get(2).getValue()));
            }
 else {
              ent.setMotion(new Vector(0,0,0));
            }
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ListTag) {
            List<Tag> pos=new ArrayList<Tag>();
            pos=((ListTag)entry.getValue()).getValue();
            if (pos.size() == 2) {
              ent.setYaw((float)pos.get(0).getValue());
              ent.setPitch((float)pos.get(1).getValue());
            }
 else {
              ent.setYaw(0F);
              ent.setPitch(0F);
            }
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ByteTag) {
            ent.setColor(((ByteTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ByteTag) {
            if (((ByteTag)entry.getValue()).getValue() != (byte)0) {
              ent.setSheared(true);
            }
 else {
              ent.setSheared(false);
            }
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            ent.setRabbitType(((IntTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            ent.setProfession(((IntTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ByteTag) {
            ent.setCarryingChest(((ByteTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          ent.setOwned(true);
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ByteTag) {
            ent.setCollarColor(((ByteTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ByteTag) {
            ent.setFacing(((ByteTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof StringTag) {
            ent.setMotive(((StringTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof FloatTag) {
            ent.setItemDropChance(((FloatTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ByteTag) {
            ent.setItemRotation(((ByteTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof CompoundTag) {
            CompoundTag itemTag=(CompoundTag)entry.getValue();
            for (            Map.Entry<String,Tag> itemEntry : itemTag.getValue().entrySet()) {
              if (itemEntry.getKey().equals("String_Node_Str")) {
                if (itemEntry.getValue() instanceof ByteTag) {
                  ent.setCount(((ByteTag)itemEntry.getValue()).getValue());
                }
              }
 else               if (itemEntry.getKey().equals("String_Node_Str")) {
                if (itemEntry.getValue() instanceof ShortTag) {
                  ent.setDamage(((ShortTag)itemEntry.getValue()).getValue());
                }
              }
 else               if (itemEntry.getKey().equals("String_Node_Str")) {
                if (itemEntry.getValue() instanceof StringTag) {
                  ent.setId(((StringTag)itemEntry.getValue()).getValue());
                }
              }
            }
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            ent.setTileX((double)((IntTag)entry.getValue()).getValue() - origin.getX());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            ent.setTileY((double)((IntTag)entry.getValue()).getValue() - origin.getY());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            ent.setTileZ((double)((IntTag)entry.getValue()).getValue() - origin.getZ());
          }
        }
      }
      if (ent.getType() != null) {
        entitiesList.add(ent);
      }
    }
    List<Tag> tileEntities=getChildTag(schematic,"String_Node_Str",ListTag.class).getValue();
    for (    Tag tag : tileEntities) {
      if (!(tag instanceof CompoundTag))       continue;
      CompoundTag t=(CompoundTag)tag;
      int x=0;
      int y=0;
      int z=0;
      Map<String,Tag> values=new HashMap<String,Tag>();
      for (      Map.Entry<String,Tag> entry : t.getValue().entrySet()) {
        if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            x=((IntTag)entry.getValue()).getValue();
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            y=((IntTag)entry.getValue()).getValue();
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            z=((IntTag)entry.getValue()).getValue();
          }
        }
        values.put(entry.getKey(),entry.getValue());
      }
      BlockVector vec=new BlockVector(x,y,z);
      tileEntitiesMap.put(vec,values);
    }
  }
 catch (  IOException e) {
    Bukkit.getLogger().severe("String_Node_Str");
    e.printStackTrace();
    throw new IOException();
  }
  List<Vector> grassBlocks=new ArrayList<Vector>();
  for (int x=0; x < width; ++x) {
    for (int y=0; y < height; ++y) {
      for (int z=0; z < length; ++z) {
        int index=y * width * length + z * width + x;
        if (blocks[index] == 7) {
          if (bedrock == null || bedrock.getY() < y) {
            bedrock=new Vector(x,y,z);
          }
        }
 else         if (blocks[index] == 54) {
          if (chest == null || chest.getY() < y) {
            chest=new Vector(x,y,z);
          }
        }
 else         if (blocks[index] == 63) {
          if (welcomeSign == null || welcomeSign.getY() < y) {
            welcomeSign=new Vector(x,y,z);
          }
        }
 else         if (blocks[index] == 2) {
          grassBlocks.add(new Vector(x,y,z));
        }
      }
    }
  }
  if (bedrock == null) {
    Bukkit.getLogger().severe("String_Node_Str");
    throw new IOException();
  }
  if (!grassBlocks.isEmpty()) {
    List<Vector> sorted=new ArrayList<Vector>();
    for (    Vector v : grassBlocks) {
      boolean inserted=false;
      for (int i=0; i < sorted.size(); i++) {
        if (v.getBlockY() > sorted.get(i).getBlockY()) {
          sorted.add(i,v);
          inserted=true;
          break;
        }
      }
      if (!inserted) {
        sorted.add(v);
      }
    }
    topGrass=sorted.get(0);
  }
 else {
    topGrass=null;
  }
  prePasteSchematic(blocks,data);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Schematic(ASkyBlock plugin,File file) throws IOException {
  this.plugin=plugin;
  short[] blocks;
  byte[] data;
  name=file.getName();
  heading="String_Node_Str";
  description="String_Node_Str";
  perm="String_Node_Str";
  icon=Material.MAP;
  rating=50;
  useDefaultChest=true;
  biome=Settings.defaultBiome;
  usePhysics=Settings.usePhysics;
  islandCompanion=new ArrayList<EntityType>();
  islandCompanion.add(Settings.islandCompanion);
  companionNames=Settings.companionNames;
  defaultChestItems=Settings.chestItems;
  pasteEntities=false;
  visible=true;
  order=0;
  bedrock=null;
  chest=null;
  welcomeSign=null;
  topGrass=null;
  playerSpawn=null;
  partnerName="String_Node_Str";
  attachable.add(Material.STONE_BUTTON.getId());
  attachable.add(Material.WOOD_BUTTON.getId());
  attachable.add(Material.COCOA.getId());
  attachable.add(Material.LADDER.getId());
  attachable.add(Material.LEVER.getId());
  attachable.add(Material.PISTON_EXTENSION.getId());
  attachable.add(Material.REDSTONE_TORCH_OFF.getId());
  attachable.add(Material.REDSTONE_TORCH_ON.getId());
  attachable.add(Material.WALL_SIGN.getId());
  attachable.add(Material.TORCH.getId());
  attachable.add(Material.TRAP_DOOR.getId());
  attachable.add(Material.TRIPWIRE_HOOK.getId());
  attachable.add(Material.VINE.getId());
  attachable.add(Material.WOODEN_DOOR.getId());
  attachable.add(Material.IRON_DOOR.getId());
  attachable.add(Material.RED_MUSHROOM.getId());
  attachable.add(Material.BROWN_MUSHROOM.getId());
  attachable.add(Material.PORTAL.getId());
  paintingList.put("String_Node_Str",Art.KEBAB);
  paintingList.put("String_Node_Str",Art.AZTEC);
  paintingList.put("String_Node_Str",Art.ALBAN);
  paintingList.put("String_Node_Str",Art.AZTEC2);
  paintingList.put("String_Node_Str",Art.BOMB);
  paintingList.put("String_Node_Str",Art.PLANT);
  paintingList.put("String_Node_Str",Art.WASTELAND);
  paintingList.put("String_Node_Str",Art.WANDERER);
  paintingList.put("String_Node_Str",Art.GRAHAM);
  paintingList.put("String_Node_Str",Art.POOL);
  paintingList.put("String_Node_Str",Art.COURBET);
  paintingList.put("String_Node_Str",Art.SUNSET);
  paintingList.put("String_Node_Str",Art.SEA);
  paintingList.put("String_Node_Str",Art.CREEBET);
  paintingList.put("String_Node_Str",Art.MATCH);
  paintingList.put("String_Node_Str",Art.BUST);
  paintingList.put("String_Node_Str",Art.STAGE);
  paintingList.put("String_Node_Str",Art.VOID);
  paintingList.put("String_Node_Str",Art.SKULL_AND_ROSES);
  paintingList.put("String_Node_Str",Art.WITHER);
  paintingList.put("String_Node_Str",Art.FIGHTERS);
  paintingList.put("String_Node_Str",Art.SKELETON);
  paintingList.put("String_Node_Str",Art.DONKEYKONG);
  paintingList.put("String_Node_Str",Art.POINTER);
  paintingList.put("String_Node_Str",Art.PIGSCENE);
  paintingList.put("String_Node_Str",Art.BURNINGSKULL);
  facingList.put((byte)0,BlockFace.SOUTH);
  facingList.put((byte)1,BlockFace.WEST);
  facingList.put((byte)2,BlockFace.NORTH);
  facingList.put((byte)3,BlockFace.EAST);
  rotationList.put((byte)0,Rotation.NONE);
  rotationList.put((byte)2,Rotation.CLOCKWISE);
  rotationList.put((byte)4,Rotation.FLIPPED);
  rotationList.put((byte)6,Rotation.COUNTER_CLOCKWISE);
  if (!Bukkit.getServer().getVersion().contains("String_Node_Str")) {
    rotationList.put((byte)1,Rotation.CLOCKWISE_45);
    rotationList.put((byte)3,Rotation.CLOCKWISE_135);
    rotationList.put((byte)5,Rotation.FLIPPED_45);
    rotationList.put((byte)7,Rotation.COUNTER_CLOCKWISE_45);
  }
  try {
    nms=Util.checkVersion();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (!Bukkit.getServer().getVersion().contains("String_Node_Str")) {
    attachable.add(Material.IRON_TRAPDOOR.getId());
    attachable.add(Material.WALL_BANNER.getId());
    attachable.add(Material.ACACIA_DOOR.getId());
    attachable.add(Material.BIRCH_DOOR.getId());
    attachable.add(Material.SPRUCE_DOOR.getId());
    attachable.add(Material.DARK_OAK_DOOR.getId());
    attachable.add(Material.JUNGLE_DOOR.getId());
  }
  this.file=file;
  try {
    FileInputStream stream=new FileInputStream(file);
    NBTInputStream nbtStream=new NBTInputStream(stream);
    CompoundTag schematicTag=(CompoundTag)nbtStream.readTag();
    nbtStream.close();
    stream.close();
    if (!schematicTag.getName().equals("String_Node_Str")) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    Map<String,Tag> schematic=schematicTag.getValue();
    Vector origin=new Vector(0,0,0);
    try {
      int originX=getChildTag(schematic,"String_Node_Str",IntTag.class).getValue();
      int originY=getChildTag(schematic,"String_Node_Str",IntTag.class).getValue();
      int originZ=getChildTag(schematic,"String_Node_Str",IntTag.class).getValue();
      Vector min=new Vector(originX,originY,originZ);
      origin=min.clone();
    }
 catch (    Exception ignored) {
    }
    if (!schematic.containsKey("String_Node_Str")) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    width=getChildTag(schematic,"String_Node_Str",ShortTag.class).getValue();
    length=getChildTag(schematic,"String_Node_Str",ShortTag.class).getValue();
    height=getChildTag(schematic,"String_Node_Str",ShortTag.class).getValue();
    String materials=getChildTag(schematic,"String_Node_Str",StringTag.class).getValue();
    if (!materials.equals("String_Node_Str")) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    byte[] blockId=getChildTag(schematic,"String_Node_Str",ByteArrayTag.class).getValue();
    data=getChildTag(schematic,"String_Node_Str",ByteArrayTag.class).getValue();
    byte[] addId=new byte[0];
    blocks=new short[blockId.length];
    if (schematic.containsKey("String_Node_Str")) {
      addId=getChildTag(schematic,"String_Node_Str",ByteArrayTag.class).getValue();
    }
    for (int index=0; index < blockId.length; index++) {
      if ((index >> 1) >= addId.length) {
        blocks[index]=(short)(blockId[index] & 0xFF);
      }
 else {
        if ((index & 1) == 0) {
          blocks[index]=(short)(((addId[index >> 1] & 0x0F) << 8) + (blockId[index] & 0xFF));
        }
 else {
          blocks[index]=(short)(((addId[index >> 1] & 0xF0) << 4) + (blockId[index] & 0xFF));
        }
      }
    }
    List<Tag> entities=getChildTag(schematic,"String_Node_Str",ListTag.class).getValue();
    for (    Tag tag : entities) {
      if (!(tag instanceof CompoundTag))       continue;
      CompoundTag t=(CompoundTag)tag;
      EntityObject ent=new EntityObject();
      for (      Map.Entry<String,Tag> entry : t.getValue().entrySet()) {
        if (entry.getKey().equals("String_Node_Str")) {
          String id=((StringTag)entry.getValue()).getValue().toUpperCase();
          if (id.startsWith("String_Node_Str")) {
            id=id.substring(10);
          }
          if (IslandBlock.WEtoME.containsKey(id)) {
            ent.setType(IslandBlock.WEtoME.get(id));
          }
 else           if (!id.equalsIgnoreCase("String_Node_Str")) {
            for (            EntityType type : EntityType.values()) {
              if (type.toString().equals(id)) {
                ent.setType(type);
                break;
              }
            }
          }
        }
        if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ListTag) {
            List<Tag> pos=new ArrayList<Tag>();
            pos=((ListTag)entry.getValue()).getValue();
            if (pos.size() == 3) {
              double x=(double)pos.get(0).getValue() - origin.getX();
              double y=(double)pos.get(1).getValue() - origin.getY();
              double z=(double)pos.get(2).getValue() - origin.getZ();
              ent.setLocation(new BlockVector(x,y,z));
            }
 else {
              ent.setLocation(new BlockVector(0,0,0));
            }
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ListTag) {
            List<Tag> pos=new ArrayList<Tag>();
            pos=((ListTag)entry.getValue()).getValue();
            if (pos.size() == 3) {
              ent.setMotion(new Vector((double)pos.get(0).getValue(),(double)pos.get(1).getValue(),(double)pos.get(2).getValue()));
            }
 else {
              ent.setMotion(new Vector(0,0,0));
            }
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ListTag) {
            List<Tag> pos=new ArrayList<Tag>();
            pos=((ListTag)entry.getValue()).getValue();
            if (pos.size() == 2) {
              ent.setYaw((float)pos.get(0).getValue());
              ent.setPitch((float)pos.get(1).getValue());
            }
 else {
              ent.setYaw(0F);
              ent.setPitch(0F);
            }
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ByteTag) {
            ent.setColor(((ByteTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ByteTag) {
            if (((ByteTag)entry.getValue()).getValue() != (byte)0) {
              ent.setSheared(true);
            }
 else {
              ent.setSheared(false);
            }
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            ent.setRabbitType(((IntTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            ent.setProfession(((IntTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ByteTag) {
            ent.setCarryingChest(((ByteTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          ent.setOwned(true);
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ByteTag) {
            ent.setCollarColor(((ByteTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ByteTag) {
            ent.setFacing(((ByteTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof StringTag) {
            ent.setMotive(((StringTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof FloatTag) {
            ent.setItemDropChance(((FloatTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof ByteTag) {
            ent.setItemRotation(((ByteTag)entry.getValue()).getValue());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof CompoundTag) {
            CompoundTag itemTag=(CompoundTag)entry.getValue();
            for (            Map.Entry<String,Tag> itemEntry : itemTag.getValue().entrySet()) {
              if (itemEntry.getKey().equals("String_Node_Str")) {
                if (itemEntry.getValue() instanceof ByteTag) {
                  ent.setCount(((ByteTag)itemEntry.getValue()).getValue());
                }
              }
 else               if (itemEntry.getKey().equals("String_Node_Str")) {
                if (itemEntry.getValue() instanceof ShortTag) {
                  ent.setDamage(((ShortTag)itemEntry.getValue()).getValue());
                }
              }
 else               if (itemEntry.getKey().equals("String_Node_Str")) {
                if (itemEntry.getValue() instanceof StringTag) {
                  ent.setId(((StringTag)itemEntry.getValue()).getValue());
                }
              }
            }
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            ent.setTileX((double)((IntTag)entry.getValue()).getValue() - origin.getX());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            ent.setTileY((double)((IntTag)entry.getValue()).getValue() - origin.getY());
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            ent.setTileZ((double)((IntTag)entry.getValue()).getValue() - origin.getZ());
          }
        }
      }
      if (ent.getType() != null) {
        entitiesList.add(ent);
      }
    }
    List<Tag> tileEntities=getChildTag(schematic,"String_Node_Str",ListTag.class).getValue();
    for (    Tag tag : tileEntities) {
      if (!(tag instanceof CompoundTag))       continue;
      CompoundTag t=(CompoundTag)tag;
      int x=0;
      int y=0;
      int z=0;
      Map<String,Tag> values=new HashMap<String,Tag>();
      for (      Map.Entry<String,Tag> entry : t.getValue().entrySet()) {
        if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            x=((IntTag)entry.getValue()).getValue();
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            y=((IntTag)entry.getValue()).getValue();
          }
        }
 else         if (entry.getKey().equals("String_Node_Str")) {
          if (entry.getValue() instanceof IntTag) {
            z=((IntTag)entry.getValue()).getValue();
          }
        }
        values.put(entry.getKey(),entry.getValue());
      }
      BlockVector vec=new BlockVector(x,y,z);
      tileEntitiesMap.put(vec,values);
    }
  }
 catch (  IOException e) {
    Bukkit.getLogger().severe("String_Node_Str");
    e.printStackTrace();
    throw new IOException();
  }
  List<Vector> grassBlocks=new ArrayList<Vector>();
  for (int x=0; x < width; ++x) {
    for (int y=0; y < height; ++y) {
      for (int z=0; z < length; ++z) {
        int index=y * width * length + z * width + x;
        if (blocks[index] == 7) {
          if (bedrock == null || bedrock.getY() < y) {
            bedrock=new Vector(x,y,z);
          }
        }
 else         if (blocks[index] == 54) {
          if (chest == null || chest.getY() < y) {
            chest=new Vector(x,y,z);
          }
        }
 else         if (blocks[index] == 63) {
          if (welcomeSign == null || welcomeSign.getY() < y) {
            welcomeSign=new Vector(x,y,z);
          }
        }
 else         if (blocks[index] == 2) {
          grassBlocks.add(new Vector(x,y,z));
        }
      }
    }
  }
  if (bedrock == null) {
    Bukkit.getLogger().severe("String_Node_Str");
    throw new IOException();
  }
  if (!grassBlocks.isEmpty()) {
    List<Vector> sorted=new ArrayList<Vector>();
    for (    Vector v : grassBlocks) {
      boolean inserted=false;
      for (int i=0; i < sorted.size(); i++) {
        if (v.getBlockY() > sorted.get(i).getBlockY()) {
          sorted.add(i,v);
          inserted=true;
          break;
        }
      }
      if (!inserted) {
        sorted.add(v);
      }
    }
    topGrass=sorted.get(0);
  }
 else {
    topGrass=null;
  }
  prePasteSchematic(blocks,data);
}