<commit_before>package com.almuradev.backpack.inventory;

import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.text.Text;

public class BackpackChangeResult {

    public static class Success extends BackpackChangeResult {

        public int originalSize;
        public int newSize;

        public Success(int originalSize, int newSize) {
            this.originalSize = originalSize;
            this.newSize = newSize;
        }
    }

    public static class Failure extends BackpackChangeResult {

        public int targetSize;
        public int currentSize;

        public Failure(int targetSize, int currentSize) {
            this.targetSize = targetSize;
            this.currentSize = currentSize;
        }
    }

    public static class LimitReached extends BackpackChangeResult {

        public int targetSize;
        public int currentSize;

        public LimitReached(int targetSize, int currentSize) {
            this.targetSize = targetSize;
            this.currentSize = currentSize;
        }
    }

    public static void sendResultText(BackpackChangeResult result, CommandSource src, Player player) {
        if (result instanceof Success) {
            final String format = "%s backpack was %s from %d to %d.";
            if (src != player) {
                src.sendMessage(Text.of(String.format(format,
                        player.getName() + "'s",
                        ((Success) result).originalSize < ((Success) result).newSize ? "upgraded" : "downgraded",
                        ((Success) result).originalSize,
                        ((Success) result).newSize)));
            }
            player.sendMessage(Text.of(String.format(format,
                    "Your",
                    ((Success) result).originalSize < ((Success) result).newSize ? "upgraded" : "downgraded",
                    ((Success) result).originalSize,
                    ((Success) result).newSize)));

        } else if (result instanceof Failure) {
            final String format = "%s backpack was unable to be %s.";
            if (src != player) {
                src.sendMessage(Text.of(String.format(format,
                        player.getName() + "'s",
                        ((Failure) result).currentSize < ((Failure) result).targetSize ? "upgraded" : "downgraded")));
            }
            player.sendMessage(Text.of(String.format(format,
                    "Your",
                    ((Failure) result).currentSize < ((Failure) result).targetSize ? "upgraded" : "downgraded")));

        } else if (result instanceof LimitReached) {
            final String format = "%s backpack has already reached its %s size.";
            if (src != player) {
                src.sendMessage(Text.of(String.format(format,
                        player.getName() + "'s",
                        ((LimitReached) result).currentSize < ((LimitReached) result).targetSize ? "maximum" : "minimum")));
            }
            player.sendMessage(Text.of(String.format(format,
                    "Your",
                    ((LimitReached) result).currentSize < ((LimitReached) result).targetSize ? "maximum" : "minimum")));
        }
    }
}<commit_msg>Phrasing<commit_after>package com.almuradev.backpack.inventory;

import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.text.Text;

public class BackpackChangeResult {

    public static class Success extends BackpackChangeResult {

        public int originalSize;
        public int newSize;

        public Success(int originalSize, int newSize) {
            this.originalSize = originalSize;
            this.newSize = newSize;
        }
    }

    public static class Failure extends BackpackChangeResult {

        public int targetSize;
        public int currentSize;

        public Failure(int targetSize, int currentSize) {
            this.targetSize = targetSize;
            this.currentSize = currentSize;
        }
    }

    public static class LimitReached extends BackpackChangeResult {

        public int targetSize;
        public int currentSize;

        public LimitReached(int targetSize, int currentSize) {
            this.targetSize = targetSize;
            this.currentSize = currentSize;
        }
    }

    public static void sendResultText(BackpackChangeResult result, CommandSource src, Player player) {
        if (result instanceof Success) {
            final String format = "%s backpack was %s from %d to %d.";
            if (src != player) {
                src.sendMessage(Text.of(String.format(format,
                        player.getName() + "'s",
                        ((Success) result).originalSize < ((Success) result).newSize ? "upgraded" : "downgraded",
                        ((Success) result).originalSize,
                        ((Success) result).newSize)));
            }
            player.sendMessage(Text.of(String.format(format,
                    "Your",
                    ((Success) result).originalSize < ((Success) result).newSize ? "upgraded" : "downgraded",
                    ((Success) result).originalSize,
                    ((Success) result).newSize)));

        } else if (result instanceof Failure) {
            final String format = "%s backpack was unable to be %s.";
            src.sendMessage(Text.of(String.format(format,
                    src == player ? "Your" : player.getName() + "'s",
                    ((Failure) result).currentSize < ((Failure) result).targetSize ? "upgraded" : "downgraded")));
        } else if (result instanceof LimitReached) {
            final String format = "%s backpack has already reached the %s size.";
            src.sendMessage(Text.of(String.format(format,
                    src == player ? "Your" : player.getName() + "'s",
                    ((LimitReached) result).currentSize < ((LimitReached) result).targetSize ? "maximum" : "minimum")));

        }
    }
}
{'fraction_non_alphanumeric': 0.10687778327560614, 'fraction_numerical': 0.0, 'mean_word_length': 2.0124192747143566, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, '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': '5219130', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1471, 'n_words': 378}