<commit_before>package gibstick.bukkit.discosheep;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import org.bukkit.Color;
import org.bukkit.DyeColor;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Firework;
import org.bukkit.entity.Player;
import org.bukkit.entity.Sheep;
import org.bukkit.FireworkEffect;
import org.bukkit.FireworkEffect.Builder;
import org.bukkit.inventory.meta.FireworkMeta;
import org.bukkit.util.Vector;

/**
 *
 * @author Georgiy
 */
public class DiscoParty {

	private DiscoSheep ds;
	private Player player;
	private ArrayList<Sheep> sheepList = new ArrayList<Sheep>();
	private int duration, period, radius, sheep;
	static int defaultDuration = 300; // ticks for entire party
	static int defaultPeriod = 10; // ticks per state change
	static int defaultRadius = 5;
	static int defaultSheep = 10;
	static float defaultSheepJump = 0.5f;
	static int maxDuration = 2400; // 120 seconds
	static int maxSheep = 100;
	static int maxRadius = 100;
	static int minPeriod = 5;	// 0.25 seconds
	static int maxPeriod = 40;	// 2.0 seconds
	private boolean doFireworks = false;
	private boolean doJump = true;
	private int state = 0;
	private DiscoUpdater updater;
	private static final DyeColor[] discoColours = {
		DyeColor.RED,
		DyeColor.ORANGE,
		DyeColor.YELLOW,
		DyeColor.GREEN,
		DyeColor.BLUE,
		DyeColor.LIGHT_BLUE,
		DyeColor.PINK,
		DyeColor.MAGENTA,
		DyeColor.LIME,
		DyeColor.CYAN,
		DyeColor.PURPLE
	};

	public DiscoParty(DiscoSheep parent, Player player) {
		this.ds = parent;
		this.player = player;
	}

	List<Sheep> getSheep() {
		return sheepList;
	}

	public DiscoParty setPlayer(Player player) {
		if (player != null) {
			this.player = player;
			return this;
		} else {
			throw new NullPointerException();
		}
	}

	public DiscoParty setDuration(int duration) throws IllegalArgumentException {
		if (duration <= DiscoParty.maxDuration) {
			this.duration = duration;
			return this;
		} else {
			throw new IllegalArgumentException();
		}<commit_msg>implemented copy with new player method for DiscoParty<commit_after>package gibstick.bukkit.discosheep;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import org.bukkit.Color;
import org.bukkit.DyeColor;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Firework;
import org.bukkit.entity.Player;
import org.bukkit.entity.Sheep;
import org.bukkit.FireworkEffect;
import org.bukkit.FireworkEffect.Builder;
import org.bukkit.inventory.meta.FireworkMeta;
import org.bukkit.util.Vector;

/**
 *
 * @author Georgiy
 */
public class DiscoParty {

	private DiscoSheep ds;
	private Player player;
	private ArrayList<Sheep> sheepList = new ArrayList<Sheep>();
	private int duration, period, radius, sheep;
	static int defaultDuration = 300; // ticks for entire party
	static int defaultPeriod = 10; // ticks per state change
	static int defaultRadius = 5;
	static int defaultSheep = 10;
	static float defaultSheepJump = 0.5f;
	static int maxDuration = 2400; // 120 seconds
	static int maxSheep = 100;
	static int maxRadius = 100;
	static int minPeriod = 5;	// 0.25 seconds
	static int maxPeriod = 40;	// 2.0 seconds
	private boolean doFireworks = false;
	private boolean doJump = true;
	private int state = 0;
	private DiscoUpdater updater;
	private static final DyeColor[] discoColours = {
		DyeColor.RED,
		DyeColor.ORANGE,
		DyeColor.YELLOW,
		DyeColor.GREEN,
		DyeColor.BLUE,
		DyeColor.LIGHT_BLUE,
		DyeColor.PINK,
		DyeColor.MAGENTA,
		DyeColor.LIME,
		DyeColor.CYAN,
		DyeColor.PURPLE
	};

	public DiscoParty(DiscoSheep parent, Player player) {
		this.ds = parent;
		this.player = player;
	}

	// copy but with new player
	/**
	 *
	 * @param player The new player to be stored
	 * @return A copy of the class with the new player
	 */
	public static DiscoParty DiscoParty(Player player) {
		DiscoParty newParty = new DiscoParty(this.ds, player);
		newParty.setDoFireworks(this.doFireworks);
		newParty.setDuration(this.duration);
		newParty.setPeriod(this.period);
		newParty.setRadius(this.radius);
		newParty.setSheep(this.sheep);
		return newParty;
	}
	
	List<Sheep> getSheep() {
		return sheepList;
	}

	public DiscoParty setPlayer(Player player) {
		if (player != null) {
			this.player = player;
			return this;
		} else {
			throw new NullPointerException();
		}
	}

	public DiscoParty setDuration(int duration) throws IllegalArgumentException {
		if (duration <= DiscoParty.maxDuration) {
			this.duration = duration;
			return this;
		} else {
			throw new IllegalArgumentException();
		}
{'fraction_non_alphanumeric': 0.09822184589331075, 'fraction_numerical': 0.013547840812870448, 'mean_word_length': 4.238359201773836, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '126149', 'n_tokens_mistral': 1772, 'n_tokens_neox': 1569, 'n_words': 419}