diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-04-13 21:28:20 +0300 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-04-13 21:28:20 +0300 |
commit | 91f5841932be075f29b97b0c853edbb86d98dde9 (patch) | |
tree | 467fcd1df83ff93474afab92a974e0415154e960 /src | |
parent | 175a073f373d675e995c654f9b7e164221283226 (diff) | |
download | LibGui-91f5841932be075f29b97b0c853edbb86d98dde9.tar.gz LibGui-91f5841932be075f29b97b0c853edbb86d98dde9.tar.bz2 LibGui-91f5841932be075f29b97b0c853edbb86d98dde9.zip |
Add Environment annotations to WWidget.tick overrides
Diffstat (limited to 'src')
3 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java index a086b3a..7d19288 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java @@ -1,5 +1,7 @@ package io.github.cottonmc.cotton.gui.widget; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.minecraft.util.math.MathHelper; import org.lwjgl.glfw.GLFW; @@ -152,6 +154,7 @@ public abstract class WAbstractSlider extends WWidget { } } + @Environment(EnvType.CLIENT) @Override public void tick() { if (draggingFinishedFromScrollingTimer > 0) { diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java index be516c7..6302125 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java @@ -41,6 +41,7 @@ public class WItem extends WWidget { return true; } + @Environment(EnvType.CLIENT) @Override public void tick() { if (ticks++ >= duration) { diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java index 1233d7d..706a71b 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java @@ -169,7 +169,11 @@ public abstract class WPanel extends WWidget { child.paintForeground(x + child.getX(), y + child.getY(), mouseX, mouseY); } } - + + /** + * Ticks all children of this panel. + */ + @Environment(EnvType.CLIENT) @Override public void tick() { for(WWidget child : children) child.tick(); |