<commit_before>package net.glowstone.generator.decorators.overworld;

import java.util.Random;
import net.glowstone.generator.decorators.BlockDecorator;
import net.glowstone.generator.objects.SugarCane;
import org.bukkit.Chunk;
import org.bukkit.World;

public class SugarCaneDecorator extends BlockDecorator {

    @Override
    public void decorate(World world, Random random, Chunk source) {
        int sourceX = (source.getX() << 4) + random.nextInt(16);
        int sourceZ = (source.getZ() << 4) + random.nextInt(16);
        int maxY = world.getHighestBlockYAt(sourceX, sourceZ);
        if (maxY > 0) {
            int sourceY = random.nextInt(maxY << 1);
            for (int j = 0; j < 20; j++) {
                int x = sourceX + random.nextInt(4) - random.nextInt(4);
                int z = sourceZ + random.nextInt(4) - random.nextInt(4);
                new SugarCane().generate(world, random, x, sourceY, z);
            }
        }
    }
}<commit_msg>Refactor for shallower nesting<commit_after>package net.glowstone.generator.decorators.overworld;

import java.util.Random;
import net.glowstone.generator.decorators.BlockDecorator;
import net.glowstone.generator.objects.SugarCane;
import org.bukkit.Chunk;
import org.bukkit.World;

public class SugarCaneDecorator extends BlockDecorator {

    @Override
    public void decorate(World world, Random random, Chunk source) {
        int sourceX = (source.getX() << 4) + random.nextInt(16);
        int sourceZ = (source.getZ() << 4) + random.nextInt(16);
        int maxY = world.getHighestBlockYAt(sourceX, sourceZ);
        if (maxY <= 0) {
            return;
        }
        int sourceY = random.nextInt(maxY << 1);
        for (int j = 0; j < 20; j++) {
            int x = sourceX + random.nextInt(4) - random.nextInt(4);
            int z = sourceZ + random.nextInt(4) - random.nextInt(4);
            new SugarCane().generate(world, random, x, sourceY, z);
        }
    }
}
{'fraction_non_alphanumeric': 0.12397540983606557, 'fraction_numerical': 0.015368852459016393, 'mean_word_length': 2.734225621414914, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4673657', 'n_tokens_mistral': 658, 'n_tokens_neox': 626, 'n_words': 144}