@Override
	public void populate(World world, Random random, Chunk source) {
		if (random.nextInt(100) < CHANCE_OF_CHEST) {
			ChunkSnapshot snapshot = source.getChunkSnapshot();
			int x = 1 + random.nextInt(14);
			int z = 1 + random.nextInt(14);
			int y = snapshot.getHighestBlockYAt(x, z);

			Block block = source.getBlock(x, y, z);
			if (block.getRelative(BlockFace.DOWN).getType() == FLOOR_MATERIAL) {
				block.setType(CHEST_MATERIAL);
				Chest chest = (Chest) block.getState();

				int count = 0;
				for (int chance : CHANCES) {
					if (random.nextInt(100) < chance) {
						break;
					}
					count++;
				}

				for (; count > 0; count--) {
					Material[] list = random.nextInt(100) < RARE_REWARD_CHANCE ? RARE_REWARDS
							: REWARD_MATERIALS;
					chest.getInventory().setItem(
							random.nextInt(chest.getInventory().getSize()),
							new ItemStack(list[random.nextInt(list.length)]));
				}

				chest.update();
			}
		}
	}