Skip to content

Commit 8da0f6d

Browse files
committed
Update setters to return boolean indicating success instead of this
1 parent 35bbdff commit 8da0f6d

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

providers/decent-holograms/src/main/java/net/thenextlvl/service/providers/decentholograms/DecentPagedHologramLine.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ public Duration getInterval() {
268268
}
269269

270270
@Override
271-
public PagedHologramLine setInterval(final Duration interval) throws IllegalArgumentException {
271+
public boolean setInterval(final Duration interval) throws IllegalArgumentException {
272272
if (!interval.isPositive()) throw new IllegalArgumentException("Interval must be positive");
273-
return this;
273+
return false;
274274
}
275275

276276
@Override
@@ -279,8 +279,8 @@ public boolean isRandomOrder() {
279279
}
280280

281281
@Override
282-
public PagedHologramLine setRandomOrder(final boolean random) {
283-
return this;
282+
public boolean setRandomOrder(final boolean random) {
283+
return false;
284284
}
285285

286286
@Override
@@ -289,8 +289,8 @@ public boolean isPaused() {
289289
}
290290

291291
@Override
292-
public PagedHologramLine setPaused(final boolean paused) {
293-
return this;
292+
public boolean setPaused(final boolean paused) {
293+
return false;
294294
}
295295

296296
@Override

src/main/java/net/thenextlvl/service/api/hologram/line/PagedHologramLine.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,11 @@ public interface PagedHologramLine extends HologramLine {
254254
* Sets the interval between page changes.
255255
*
256256
* @param interval the new interval duration
257-
* @return this
257+
* @return whether the interval has been changed
258258
* @throws IllegalArgumentException if the interval is not bigger than zero
259259
* @since 3.0.0
260260
*/
261-
PagedHologramLine setInterval(Duration interval) throws IllegalArgumentException;
261+
boolean setInterval(Duration interval) throws IllegalArgumentException;
262262

263263
/**
264264
* Gets whether pages are cycled in random order.
@@ -272,10 +272,10 @@ public interface PagedHologramLine extends HologramLine {
272272
* Sets whether pages should be cycled in random order.
273273
*
274274
* @param random {@code true} for random order, {@code false} for sequential
275-
* @return this
275+
* @return whether the order has been changed
276276
* @since 3.0.0
277277
*/
278-
PagedHologramLine setRandomOrder(boolean random);
278+
boolean setRandomOrder(boolean random);
279279

280280
/**
281281
* Gets whether the paged line is currently paused.
@@ -290,10 +290,10 @@ public interface PagedHologramLine extends HologramLine {
290290
* When paused, the line will not automatically cycle through pages.
291291
*
292292
* @param paused {@code true} to pause, {@code false} to resume
293-
* @return this
293+
* @return whether the automatic cycling state has been changed
294294
* @since 3.0.0
295295
*/
296-
PagedHologramLine setPaused(boolean paused);
296+
boolean setPaused(boolean paused);
297297

298298
/**
299299
* Cycles the page of this line for the given player.

0 commit comments

Comments
 (0)