diff options
Diffstat (limited to 'src/main/java/io')
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(); |