/*
 * Copyright 2015 CrystalCraftMC
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package com.crystalcraftmc.crystaleggfactory;


import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;

public class CakeAnimation {
	private CrystalEggFactory plugin;
	public final int NUMCAKES = 5; //MAY CHANGE NUMBER - will also automatically check NUMCAKES blocks
									//above the PlayerInteractEvent to make sure clear before proceeding
	
	private final int CAKEFRAMERATE = 5; //cakes show up CAKEFRAMERATE ticks inbetween eachother
//####################################################################
	public CakeAnimation(Block b, CrystalEggFactory plugin) {
		this.plugin = plugin;
		Location loc = b.getLocation();
		for(int i = 0; i < 5; i++) {
			loc.setY(b.getLocation().getY()+(i+1));
			this.hailMary(loc.getBlock(), i);
		}
	}
	public CakeAnimation() {
		//to create a low-resource accessFields object in EggThrowListener class
	}
	public void hailMary(Block b, int z) {
		final Block bw = b; //has to be Final for runnable code to work
		plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
            public void run() {
                bw.setType(Material.CAKE_BLOCK);
            }
        }, (long)((CAKEFRAMERATE*z)+1));
	}
	
}

@@ -759,416 +759,345 @@
 k;%0A%0A
-public class CakeAnimation %7B%0A%09private CrystalEggFactory plugin;%0A%09public final int NUMCAKES = 5; //MAY CHANGE NUMBER - will also automatically check NUMCAKES blocks%0A%09%09%09%09%09%09%09%09%09//above the PlayerInteractEvent to make sure clear before proceeding%0A%09%0A%09private final int CAKEFRAMERATE = 5; //cakes show up CAKEFRAMERATE ticks inbetween eachother%0A//####################################################################
+/**The cake animation that is shown upon using a Raeganrr spawnegg*/%0Apublic class CakeAnimation %7B%0A%09private CrystalEggFactory plugin;%0A%09%0A%09%0A//####################################################################%0A%09%0A%09/**Initializes a cake animation object%0A%09 * @param b the block we're starting from%0A%09 * @param plugin the main plugin class%0A%09 */
 %0A%09pu
@@ -1333,110 +1333,177 @@
 %09%7D%0A%09
-public CakeAnimation() %7B%0A%09%09//to create a low-resource accessFields object in EggThrowListener class%0A%09%7D
+%0A%09/**Where the actual spawning of the eggs takes place%0A%09 * @param b the block to change to cake%0A%09 * @param z the nth cake we're spawning in (to determine the delay)%0A%09 */
 %0A%09pu
@@ -1804,16 +1804,34 @@
 (long)((
+CrystalEggFactory.
 CAKEFRAM

add javadoc