aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-04-13 21:28:20 +0300
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-04-26 00:41:47 +0300
commit084780db053f12c8908847d02bf24b5fb23c9581 (patch)
tree9c07c6a06e0ba6092064d0b7f9cb71b44e3c520d /src/main
parentc4f5735047943775c8f4fddc80f87227d0127753 (diff)
downloadLibGui-084780db053f12c8908847d02bf24b5fb23c9581.tar.gz
LibGui-084780db053f12c8908847d02bf24b5fb23c9581.tar.bz2
LibGui-084780db053f12c8908847d02bf24b5fb23c9581.zip
Add Environment annotations to WWidget.tick overrides
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java3
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WItem.java1
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java6
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();