aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/api/widgets/Arrow.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-03-18 00:35:36 +0800
committershedaniel <daniel@shedaniel.me>2020-03-18 00:35:36 +0800
commit550fe32e612801daa99493aa0bade083f3330133 (patch)
tree7825027dd8933d542a831e2bda6626c63f4cd8db /src/main/java/me/shedaniel/rei/api/widgets/Arrow.java
parent9e990de7685960391d78ca2cca0ff68bebe1a8cd (diff)
downloadRoughlyEnoughItems-550fe32e612801daa99493aa0bade083f3330133.tar.gz
RoughlyEnoughItems-550fe32e612801daa99493aa0bade083f3330133.tar.bz2
RoughlyEnoughItems-550fe32e612801daa99493aa0bade083f3330133.zip
4.0.14: Better widgets system
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/widgets/Arrow.java')
-rw-r--r--src/main/java/me/shedaniel/rei/api/widgets/Arrow.java22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/widgets/Arrow.java b/src/main/java/me/shedaniel/rei/api/widgets/Arrow.java
index 90d840ce2..98a0da428 100644
--- a/src/main/java/me/shedaniel/rei/api/widgets/Arrow.java
+++ b/src/main/java/me/shedaniel/rei/api/widgets/Arrow.java
@@ -24,12 +24,19 @@
package me.shedaniel.rei.api.widgets;
import me.shedaniel.rei.gui.widget.WidgetWithBounds;
+import org.jetbrains.annotations.NotNull;
public abstract class Arrow extends WidgetWithBounds {
+ /**
+ * @return the x coordinate for the top left corner of this widget.
+ */
public final int getX() {
return getBounds().getX();
}
+ /**
+ * @return the y coordinate for the top left corner of this widget.
+ */
public final int getY() {
return getBounds().getY();
}
@@ -42,16 +49,17 @@ public abstract class Arrow extends WidgetWithBounds {
/**
* Sets the animation duration in milliseconds.
*
- * @param animationDurationMS animation duration in milliseconds, animation is disabled when below or equals to 0
+ * @param animationDurationMS animation duration in milliseconds, animation is disabled when below or equals to 0.
*/
public abstract void setAnimationDuration(double animationDurationMS);
/**
* Sets the animation duration in milliseconds.
*
- * @param animationDurationMS animation duration in milliseconds, animation is disabled when below or equals to 0
- * @return the arrow itself
+ * @param animationDurationMS animation duration in milliseconds, animation is disabled when below or equals to 0.
+ * @return the arrow itself.
*/
+ @NotNull
public final Arrow animationDurationMS(double animationDurationMS) {
setAnimationDuration(animationDurationMS);
return this;
@@ -60,9 +68,10 @@ public abstract class Arrow extends WidgetWithBounds {
/**
* Sets the animation duration in ticks.
*
- * @param animationDurationTicks animation duration in ticks, animation is disabled when below or equals to 0
- * @return the arrow itself
+ * @param animationDurationTicks animation duration in ticks, animation is disabled when below or equals to 0.
+ * @return the arrow itself.
*/
+ @NotNull
public final Arrow animationDurationTicks(double animationDurationTicks) {
return animationDurationMS(animationDurationTicks * 50);
}
@@ -70,8 +79,9 @@ public abstract class Arrow extends WidgetWithBounds {
/**
* Disables the animation.
*
- * @return the arrow itself
+ * @return the arrow itself.
*/
+ @NotNull
public final Arrow disableAnimation() {
return animationDurationMS(-1);
}