TurtlePondMod.java 1.33 KB
package edu.caltech.cs001;

import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.EntityType;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerBucketEmptyEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class TurtlePondMod extends CaltechMinecraftMod {
    public TurtlePondMod(JavaPlugin plugin) { super(plugin); }

    /**
     * Checks if the block `centerBlock` is a water block in the middle of a pond of Material.STONE.
     *
     * @return true if it does form a pond, false if it does not.
     **/
    private boolean isPond(Block centerBlock) {
        return false;
    }

    /**
     * Destroys the blocks that form the pond around `centerBlock` by setting their type
     * to Material.AIR.
     **/
    private void destroyPond(Block centerBlock) {
        // TODO: Implement me!
    }

    /**
     * When a player empties a bucket (in this case, a water bucket) into the middle of
     * a pond, this method (1) deletes the pond, and (2) spawns an EntityType.TURTLE where
     * the pond was.
     *
     * Hint: This method should use the other two methods you wrote above!
     **/
    protected void onBucketEmpty(PlayerBucketEmptyEvent event) {
        // TODO: Implement me!
    }
}