1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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!
}
}