40public abstract class DiseasablePatch
extends HarvestablePatch {
41 protected boolean watched;
44 super(player, zone, boundaries);
48 protected void onGrowth() {
60 protected void resetPatch() {
65 public boolean clickObject(
int opcode) {
66 if (opcode == 1 && isDiseased()) {
70 return super.clickObject(opcode);
73 public boolean itemOnObject(Item item,
int index) {
78 return super.itemOnObject(item, index);
92 private void curePlant(
int index) {
93 if (player.locking.locked()) {
102 player.message(
"This plant doesn't need to be cured.");
107 player.message(
"You need plant cure to cure this plant.");
118 player.locking.lock(7);
123 player.resetAnimation();
124 player.message(
"You cure the plant with a plant cure.");
125 zone.sendPatchConfigs(player);
130 public JsonObject toJson() {
131 JsonObject
object = super.toJson();
132 object.addProperty(
"watched", watched);
137 public void fromJson(JsonObject
object) {
138 watched =
object.get(
"watched").getAsBoolean();
139 super.fromJson(
object);