Added properties for handling the floor blocks, added cleanup of floor blocks to removeAll() method.

This commit is contained in:
RangerMauve 2013-11-09 15:02:46 -05:00
parent ca8d41a7ae
commit b7361acb9b

View File

@ -15,6 +15,8 @@ import org.bukkit.entity.Player;
import org.bukkit.entity.Sheep; import org.bukkit.entity.Sheep;
import org.bukkit.FireworkEffect; import org.bukkit.FireworkEffect;
import org.bukkit.FireworkEffect.Builder; import org.bukkit.FireworkEffect.Builder;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.inventory.meta.FireworkMeta; import org.bukkit.inventory.meta.FireworkMeta;
@ -67,6 +69,8 @@ public class DiscoParty {
private Player player; private Player player;
private ArrayList<Sheep> sheepList = new ArrayList<Sheep>(); private ArrayList<Sheep> sheepList = new ArrayList<Sheep>();
private ArrayList<Entity> guestList = new ArrayList<Entity>(); private ArrayList<Entity> guestList = new ArrayList<Entity>();
private ArrayList<BlockState> floorBlockCache = new ArrayList<BlockState>();
private ArrayList<Block> floorBlocks = new ArrayList<Block>();
private HashMap<String, Integer> guestNumbers = new HashMap<String, Integer>(); private HashMap<String, Integer> guestNumbers = new HashMap<String, Integer>();
private boolean doFireworks = false; private boolean doFireworks = false;
private boolean doJump = true; private boolean doJump = true;
@ -291,8 +295,12 @@ public class DiscoParty {
for (Entity guest : getGuestList()) { for (Entity guest : getGuestList()) {
guest.remove(); guest.remove();
} }
for(BlockState block : this.floorBlockCache){
block.update(true);
}
getSheepList().clear(); getSheepList().clear();
getGuestList().clear(); getGuestList().clear();
floorBlockCache.clear();
} }
// Set a random colour for all sheep in array // Set a random colour for all sheep in array