diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-01-17 14:31:30 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-01-17 14:31:30 +0800 |
| commit | 7a1cf35934ef14c04f884fe6ae34282e1d6243ba (patch) | |
| tree | e84d0c5bfb9929f065544e96ecc1fb07d3496c29 /src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java | |
| parent | b4be45e414504afb49910d766bebcd00f55b052b (diff) | |
| download | RoughlyEnoughItems-7a1cf35934ef14c04f884fe6ae34282e1d6243ba.tar.gz RoughlyEnoughItems-7a1cf35934ef14c04f884fe6ae34282e1d6243ba.tar.bz2 RoughlyEnoughItems-7a1cf35934ef14c04f884fe6ae34282e1d6243ba.zip | |
3.3.12
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java index be4b0f897..3cd14b78e 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java @@ -11,6 +11,7 @@ import me.shedaniel.rei.plugin.DefaultPlugin; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.Element; import net.minecraft.util.math.MathHelper; +import org.jetbrains.annotations.ApiStatus; import java.util.Collections; import java.util.List; @@ -18,9 +19,10 @@ import java.util.List; public class RecipeArrowWidget extends WidgetWithBounds { private int x, y; + private double time = 250d; private boolean animated; - @Deprecated + @ApiStatus.Internal public RecipeArrowWidget(int x, int y, boolean animated) { this.x = x; this.y = y; @@ -31,6 +33,11 @@ public class RecipeArrowWidget extends WidgetWithBounds { return new RecipeArrowWidget(point.x, point.y, animated); } + public RecipeArrowWidget time(double time) { + this.time = time; + return this; + } + @Override public Rectangle getBounds() { return new Rectangle(x, y, 24, 17); @@ -41,7 +48,7 @@ public class RecipeArrowWidget extends WidgetWithBounds { MinecraftClient.getInstance().getTextureManager().bindTexture(DefaultPlugin.getDisplayTexture()); blit(x, y, 106, 91, 24, 17); if (animated) { - int width = MathHelper.ceil((System.currentTimeMillis() / 250 % 24d) / 1f); + int width = MathHelper.ceil((System.currentTimeMillis() / (time / 24) % 24d) / 1f); blit(x, y, 82, 91, width, 17); } } |
