Skip to content

Commit e308397

Browse files
authored
Fix lombok for recipe after finish (#3885)
1 parent 6bc1760 commit e308397

File tree

5 files changed

+7
-12
lines changed

5 files changed

+7
-12
lines changed

src/main/java/com/gregtechceu/gtceu/api/capability/IControllable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public interface IControllable {
2222

2323
default void setSuspendAfterFinish(boolean suspendAfterFinish) {}
2424

25-
default boolean getSuspendAfterFinish() {
25+
default boolean isSuspendAfterFinish() {
2626
return false;
2727
}
2828
}

src/main/java/com/gregtechceu/gtceu/api/machine/feature/IRecipeLogicMachine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ default void setSuspendAfterFinish(boolean suspendAfterFinish) {
145145
}
146146

147147
@Override
148-
default boolean getSuspendAfterFinish() {
149-
return getRecipeLogic().getSuspendAfterFinish();
148+
default boolean isSuspendAfterFinish() {
149+
return getRecipeLogic().isSuspendAfterFinish();
150150
}
151151

152152
@Override

src/main/java/com/gregtechceu/gtceu/api/machine/trait/RecipeLogic.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public enum Status implements StringRepresentable {
121121
protected int runDelay = 0;
122122
@Persisted
123123
@Setter
124+
@Getter
124125
protected boolean suspendAfterFinish = false;
125126
@Getter
126127
protected final Map<RecipeCapability<?>, Object2IntMap<?>> chanceCaches = makeChanceCaches();
@@ -182,12 +183,6 @@ public double getProgressPercent() {
182183
return duration == 0 ? 0.0 : progress / (duration * 1.0);
183184
}
184185

185-
// have to do this manually because Lombok can't figure out the inheritance
186-
@Override
187-
public boolean getSuspendAfterFinish() {
188-
return this.suspendAfterFinish;
189-
}
190-
191186
/**
192187
* it should be called on the server side restrictively.
193188
*/
@@ -440,7 +435,7 @@ public boolean isSuspend() {
440435
}
441436

442437
public boolean isWorkingEnabled() {
443-
return !isSuspend() && !getSuspendAfterFinish();
438+
return !isSuspend() && !isSuspendAfterFinish();
444439
}
445440

446441
@Override

src/main/java/com/gregtechceu/gtceu/integration/jade/provider/ControllableBlockProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected IControllable getCapability(Level level, BlockPos pos, @Nullable Direc
3333
@Override
3434
protected void write(CompoundTag data, IControllable capability) {
3535
data.putBoolean("WorkingEnabled", capability.isWorkingEnabled());
36-
data.putBoolean("SuspendAfter", capability.getSuspendAfterFinish());
36+
data.putBoolean("SuspendAfter", capability.isSuspendAfterFinish());
3737
}
3838

3939
@Override

src/main/java/com/gregtechceu/gtceu/integration/top/provider/ControllableInfoProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected void addProbeInfo(IControllable capability, IProbeInfo probeInfo, Play
3535
IProbeHitData data) {
3636
IProbeInfo horizontalPane = probeInfo
3737
.horizontal(probeInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER));
38-
if (capability.getSuspendAfterFinish())
38+
if (capability.isSuspendAfterFinish())
3939
horizontalPane.text(CompoundText.create().warning("behaviour.soft_hammer.disabled_cycle"));
4040
else if (!capability.isWorkingEnabled())
4141
horizontalPane.text(CompoundText.create().warning("behaviour.soft_hammer.disabled"));

0 commit comments

Comments
 (0)