Skip to content

Commit

Permalink
+ Server Closing - Added check for features using BZ and/or AH to che…
Browse files Browse the repository at this point in the history
…ck for server closing

= Other fixes
  • Loading branch information
May2Beez committed Dec 2, 2023
2 parents b7b6eda + 69bbf11 commit 6172384
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ baseGroup=com.jelly.farmhelperv2
mcVersion=1.8.9
modid=farmhelperv2
modName=FarmHelper
version=2.1.2
version=2.1.3
shouldRelease=true
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public void onClientTick(TickEvent.ClientTickEvent event) {
PlotData data = sprayonatorPlotStates.get(GameStateHandler.getInstance().getCurrentPlot());
if (data == null)
return;
if (!data.sprayed || !data.sprayItem.equals(sprayItem.getItemName())) {
if (!data.isSprayed() || !data.sprayItem.equals(sprayItem.getItemName())) {
sprayState = AUTO_SPRAYONATOR_STATE.CHECK_SPRAYONATOR;
return;
} else {
Expand Down Expand Up @@ -591,8 +591,6 @@ public static class PlotData {
@Getter
private final Clock sprayClock = new Clock();

@Getter @Setter
private boolean sprayed = false;
@Setter @Getter
private String sprayItem = "none";
@Setter
Expand All @@ -607,13 +605,16 @@ private PlotData(int plot_number, String spray_item, long time) {
this.plot_number = plot_number;
this.sprayItem = spray_item;
this.sprayTime = time;
this.sprayed = true;
sprayClock.schedule(time);
}

public boolean isSprayed() {
return !sprayClock.passed();
}

@Override
public String toString() {
return "{" + "sprayed=" + sprayed + ", sprayItem='" + sprayItem + '\'' + ", sprayTime=" + sprayTime + ", plot_number=" + plot_number + '}';
return "{" + "sprayed=" + isSprayed() + ", sprayItem='" + sprayItem + '\'' + ", sprayTime=" + sprayTime + ", plot_number=" + plot_number + '}';
}
}
}

0 comments on commit 6172384

Please sign in to comment.