From 1f13192aec57632ae94c014d2f28a5e4d9738a5f Mon Sep 17 00:00:00 2001 From: Gibstick Date: Fri, 19 Jul 2013 11:42:25 -0400 Subject: [PATCH] implemented copy with new player method for DiscoParty --- src/gibstick/bukkit/discosheep/DiscoParty.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/gibstick/bukkit/discosheep/DiscoParty.java b/src/gibstick/bukkit/discosheep/DiscoParty.java index 2d52f43..abe1c98 100644 --- a/src/gibstick/bukkit/discosheep/DiscoParty.java +++ b/src/gibstick/bukkit/discosheep/DiscoParty.java @@ -60,6 +60,22 @@ public class DiscoParty { 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 getSheep() { return sheepList; }