public int compare(Static o1, Static o2) {
			if(tiledata != null && o1.getX() == o2.getX() && o1.getY() == o2.getY() && o1.getZ() == o2.getZ()){
				ItemData t1 = tiledata.getItem(o1.getId());
				ItemData t2 = tiledata.getItem(o2.getId());
				if(t1 == null && t2 == null) return 0;

				int t1b = (t1.getFlags().contains(TileFlag.Background) ?  1: 0);
				int t2b = (t2.getFlags().contains(TileFlag.Background) ?  1: 0);
				return t2b - t1b;
			}
			return ((o1.getX() + o1.getY()) * 22 - o1.getZ() * VERTICAL_SHIFT) - ((o2.getX() + o2.getY()) * 22 - o2.getZ() * VERTICAL_SHIFT);
		}