Browse Source

Fading selection box and clean up for entry tooltip

Signed-off-by: shedaniel <daniel@shedaniel.me>
shedaniel 4 years ago
parent
commit
e8be30bfa7

+ 2 - 1
build.gradle

@@ -157,8 +157,9 @@ curseforge {
     if (apiKey != null)
         project {
             id = '319057'
-            releaseType = 'beta'
+            releaseType = 'release'
             addGameVersion '1.16-Snapshot'
+            addGameVersion '1.16.2'
             addGameVersion 'Fabric'
             addGameVersion 'Java 8'
             relations {

+ 3 - 3
gradle.properties

@@ -1,9 +1,9 @@
 org.gradle.jvmargs=-Xmx3G
 
-supported_version=20w30a
+supported_version=1.16.2
 minecraft_version=20w30a
 yarn_mappings=20w30a+build.3+legacy.20w09a+build.8
 loader_version=0.9.0+build.204
 fabric_version=0.15.2+build.382-1.16
-mod_version=4.7.0-unstable
-modmenu_version=1.12.2+build.16
+mod_version=4.8.0
+modmenu_version=1.14.6+build.31

+ 1 - 0
src/main/java/me/shedaniel/clothconfig2/api/ConfigBuilder.java

@@ -112,4 +112,5 @@ public interface ConfigBuilder {
     
     Screen build();
     
+    boolean hasTransparentBackground();
 }

+ 13 - 4
src/main/java/me/shedaniel/clothconfig2/api/ConfigCategory.java

@@ -2,6 +2,7 @@ package me.shedaniel.clothconfig2.api;
 
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
+import net.minecraft.text.StringRenderable;
 import net.minecraft.text.Text;
 import net.minecraft.util.Identifier;
 import org.jetbrains.annotations.Nullable;
@@ -21,11 +22,19 @@ public interface ConfigCategory {
     ConfigCategory addEntry(AbstractConfigListEntry entry);
     
     ConfigCategory setCategoryBackground(Identifier identifier);
-
+    
+    void setBackground(@Nullable Identifier background);
+    
+    @Nullable Identifier getBackground();
+    
     @Nullable
-    Supplier<Optional<Text[]>> getTooltipSupplier();
-
-    ConfigCategory setTooltipSupplier(@Nullable Supplier<Optional<Text[]>> tooltipSupplier);
+    Supplier<Optional<StringRenderable[]>> getDescription();
+    
+    void setDescription(@Nullable Supplier<Optional<StringRenderable[]>> description);
+    
+    default void setDescription(@Nullable StringRenderable[] description) {
+        setDescription(() -> Optional.ofNullable(description));
+    }
     
     void removeCategory();
     

+ 17 - 4
src/main/java/me/shedaniel/clothconfig2/api/QueuedTooltip.java

@@ -1,7 +1,11 @@
 package me.shedaniel.clothconfig2.api;
 
 import me.shedaniel.math.Point;
+import net.minecraft.class_5481;
+import net.minecraft.text.StringRenderable;
 import net.minecraft.text.Text;
+import net.minecraft.util.Language;
+import org.jetbrains.annotations.ApiStatus;
 
 import java.util.Arrays;
 import java.util.Collections;
@@ -9,28 +13,37 @@ import java.util.List;
 
 public class QueuedTooltip implements Tooltip {
     private Point location;
-    private List<Text> text;
+    private List<class_5481> text;
     
-    private QueuedTooltip(Point location, List<Text> text) {
+    private QueuedTooltip(Point location, List<class_5481> text) {
         this.location = location;
         this.text = Collections.unmodifiableList(text);
     }
     
     public static QueuedTooltip create(Point location, List<Text> text) {
-        return new QueuedTooltip(location, text);
+        return new QueuedTooltip(location, Language.getInstance().method_30933((List) text));
     }
     
     public static QueuedTooltip create(Point location, Text... text) {
         return QueuedTooltip.create(location, Arrays.asList(text));
     }
     
+    public static QueuedTooltip create(Point location, class_5481... text) {
+        return new QueuedTooltip(location, Arrays.asList(text));
+    }
+    
+    public static QueuedTooltip create(Point location, StringRenderable... text) {
+        return new QueuedTooltip(location, Language.getInstance().method_30933(Arrays.asList(text)));
+    }
+    
     @Override
     public Point getPoint() {
         return location;
     }
     
+    @ApiStatus.Internal
     @Override
-    public List<Text> getText() {
+    public List<class_5481> getText() {
         return text;
     }
 }

+ 12 - 1
src/main/java/me/shedaniel/clothconfig2/api/Tooltip.java

@@ -1,6 +1,8 @@
 package me.shedaniel.clothconfig2.api;
 
 import me.shedaniel.math.Point;
+import net.minecraft.class_5481;
+import net.minecraft.text.StringRenderable;
 import net.minecraft.text.Text;
 
 import java.util.List;
@@ -9,6 +11,15 @@ public interface Tooltip {
     static Tooltip of(Point location, Text... text) {
         return QueuedTooltip.create(location, text);
     }
+    
+    static Tooltip of(Point location, StringRenderable... text) {
+        return QueuedTooltip.create(location, text);
+    }
+    
+    static Tooltip of(Point location, class_5481... text) {
+        return QueuedTooltip.create(location, text);
+    }
+    
     Point getPoint();
     
     default int getX() {
@@ -19,5 +30,5 @@ public interface Tooltip {
         return getPoint().getY();
     }
     
-    List<Text> getText();
+    List<class_5481> getText();
 }

+ 1 - 2
src/main/java/me/shedaniel/clothconfig2/gui/AbstractConfigScreen.java

@@ -19,7 +19,6 @@ import net.minecraft.client.util.math.MatrixStack;
 import net.minecraft.text.Text;
 import net.minecraft.text.TranslatableText;
 import net.minecraft.util.Identifier;
-import net.minecraft.util.Language;
 import net.minecraft.util.Tickable;
 import net.minecraft.util.math.Matrix4f;
 import org.jetbrains.annotations.ApiStatus;
@@ -356,7 +355,7 @@ public abstract class AbstractConfigScreen extends Screen implements ConfigScree
     public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
         super.render(matrices, mouseX, mouseY, delta);
         for (Tooltip tooltip : tooltips) {
-            renderTooltip(matrices, Language.getInstance().method_30933((List) tooltip.getText()), tooltip.getX(), tooltip.getY());
+            renderTooltip(matrices, tooltip.getText(), tooltip.getX(), tooltip.getY());
         }
         this.tooltips.clear();
     }

+ 23 - 11
src/main/java/me/shedaniel/clothconfig2/gui/ClothConfigScreen.java

@@ -24,6 +24,7 @@ import net.minecraft.text.Text;
 import net.minecraft.text.TranslatableText;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.Pair;
+import net.minecraft.util.math.MathHelper;
 import net.minecraft.util.math.Matrix4f;
 import org.jetbrains.annotations.ApiStatus;
 
@@ -63,11 +64,11 @@ public class ClothConfigScreen extends AbstractTabbedConfigScreen {
     private final Map<Text, ConfigCategory> categoryMap;
     
     @ApiStatus.Internal
-    public ClothConfigScreen(Screen parent, Text title, Map<Text, List<Object>> entriesMap, Map<Text, ConfigCategory> categoryMap, Identifier backgroundLocation) {
+    public ClothConfigScreen(Screen parent, Text title, Map<Text, ConfigCategory> categoryMap, Identifier backgroundLocation) {
         super(parent, title, backgroundLocation);
-        entriesMap.forEach((categoryName, list) -> {
+        categoryMap.forEach((categoryName, category) -> {
             List<AbstractConfigEntry<?>> entries = Lists.newArrayList();
-            for (Object object : list) {
+            for (Object object : category.getEntries()) {
                 AbstractConfigListEntry<?> entry;
                 if (object instanceof Pair<?, ?>) {
                     entry = (AbstractConfigListEntry<?>) ((Pair<?, ?>) object).getRight();
@@ -78,8 +79,11 @@ public class ClothConfigScreen extends AbstractTabbedConfigScreen {
                 entries.add(entry);
             }
             categorizedEntries.put(categoryName, entries);
+            if (category.getBackground() != null) {
+                registerCategoryBackground(categoryName, category.getBackground());
+            }
         });
-
+        
         this.tabs = categorizedEntries.keySet().stream().map(s -> new Pair<>(s, MinecraftClient.getInstance().textRenderer.getWidth(s) + 8)).collect(Collectors.toList());
         this.categoryMap = categoryMap;
     }
@@ -169,7 +173,7 @@ public class ClothConfigScreen extends AbstractTabbedConfigScreen {
             });
             int j = 0;
             for (Pair<Text, Integer> tab : tabs) {
-                tabButtons.add(new ClothConfigTabButton(this, j, -100, 43, tab.getRight(), 20, tab.getLeft(), this.categoryMap.get(tab.getLeft()).getTooltipSupplier()));
+                tabButtons.add(new ClothConfigTabButton(this, j, -100, 43, tab.getRight(), 20, tab.getLeft(), this.categoryMap.get(tab.getLeft()).getDescription()));
                 j++;
             }
             children.addAll(tabButtons);
@@ -342,6 +346,7 @@ public class ClothConfigScreen extends AbstractTabbedConfigScreen {
         private double currentHeight;
         public Rectangle target;
         public Rectangle thisTimeTarget;
+        public long lastTouch;
         public long start;
         public long duration;
         
@@ -372,9 +377,15 @@ public class ClothConfigScreen extends AbstractTabbedConfigScreen {
         protected void renderList(MatrixStack matrices, int startX, int startY, int int_3, int int_4, float delta) {
             thisTimeTarget = null;
             if (hasCurrent) {
-                fillGradient(matrices, currentX, currentY, currentX + currentWidth, currentY + currentHeight, 0x24FFFFFF, 0x24FFFFFF);
+                long timePast = System.currentTimeMillis() - lastTouch;
+                int alpha = timePast <= 200 ? 255 : MathHelper.ceil(255 - Math.min(timePast - 200, 500F) / 500F * 255.0);
+                alpha = (alpha * 36 / 255) << 24;
+                fillGradient(matrices, currentX, currentY, currentX + currentWidth, currentY + currentHeight, 0xFFFFFF | alpha, 0xFFFFFF | alpha);
             }
             super.renderList(matrices, startX, startY, int_3, int_4, delta);
+            if (thisTimeTarget != null && isMouseOver(int_3, int_4)) {
+                lastTouch = System.currentTimeMillis();
+            }
             if (thisTimeTarget != null && !thisTimeTarget.equals(target)) {
                 if (!hasCurrent) {
                     currentX = thisTimeTarget.x;
@@ -384,13 +395,14 @@ public class ClothConfigScreen extends AbstractTabbedConfigScreen {
                     hasCurrent = true;
                 }
                 target = thisTimeTarget.clone();
-                start = System.currentTimeMillis();
+                start = lastTouch;
                 this.duration = 40;
             } else if (hasCurrent && target != null) {
-                currentX = (int) ScrollingContainer.ease(currentX, target.x, Math.min((System.currentTimeMillis() - start) / (double) duration * delta * 3, 1), EasingMethod.EasingMethodImpl.LINEAR);
-                currentY = (int) ScrollingContainer.ease(currentY, target.y, Math.min((System.currentTimeMillis() - start) / (double) duration * delta * 3, 1), EasingMethod.EasingMethodImpl.LINEAR);
-                currentWidth = (int) ScrollingContainer.ease(currentWidth, target.width, Math.min((System.currentTimeMillis() - start) / (double) duration * delta * 3, 1), EasingMethod.EasingMethodImpl.LINEAR);
-                currentHeight = (int) ScrollingContainer.ease(currentHeight, target.height, Math.min((System.currentTimeMillis() - start) / (double) duration * delta * 3, 1), EasingMethod.EasingMethodImpl.LINEAR);
+                long timePast = System.currentTimeMillis() - start;
+                currentX = (int) ScrollingContainer.ease(currentX, target.x, Math.min(timePast / (double) duration * delta * 3, 1), EasingMethod.EasingMethodImpl.LINEAR);
+                currentY = (int) ScrollingContainer.ease(currentY, target.y, Math.min(timePast / (double) duration * delta * 3, 1), EasingMethod.EasingMethodImpl.LINEAR);
+                currentWidth = (int) ScrollingContainer.ease(currentWidth, target.width, Math.min(timePast / (double) duration * delta * 3, 1), EasingMethod.EasingMethodImpl.LINEAR);
+                currentHeight = (int) ScrollingContainer.ease(currentHeight, target.height, Math.min(timePast / (double) duration * delta * 3, 1), EasingMethod.EasingMethodImpl.LINEAR);
             }
         }
         

+ 9 - 12
src/main/java/me/shedaniel/clothconfig2/gui/ClothConfigTabButton.java

@@ -7,6 +7,7 @@ import net.fabricmc.api.Environment;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.gui.widget.AbstractPressableButtonWidget;
 import net.minecraft.client.util.math.MatrixStack;
+import net.minecraft.text.StringRenderable;
 import net.minecraft.text.Text;
 import org.jetbrains.annotations.Nullable;
 
@@ -18,13 +19,14 @@ public class ClothConfigTabButton extends AbstractPressableButtonWidget {
     
     private final int index;
     private final ClothConfigScreen screen;
-    @Nullable private final Supplier<Optional<Text[]>> tooltipSupplier;
+    @Nullable 
+    private final Supplier<Optional<StringRenderable[]>> descriptionSupplier;
     
-    public ClothConfigTabButton(ClothConfigScreen screen, int index, int int_1, int int_2, int int_3, int int_4, Text string_1, Supplier<Optional<Text[]>> tooltipSupplier) {
+    public ClothConfigTabButton(ClothConfigScreen screen, int index, int int_1, int int_2, int int_3, int int_4, Text string_1, Supplier<Optional<StringRenderable[]>> descriptionSupplier) {
         super(int_1, int_2, int_3, int_4, string_1);
         this.index = index;
         this.screen = screen;
-        this.tooltipSupplier = tooltipSupplier;
+        this.descriptionSupplier = descriptionSupplier;
     }
 
     public ClothConfigTabButton(ClothConfigScreen screen, int index, int int_1, int int_2, int int_3, int int_4, Text string_1) {
@@ -44,7 +46,7 @@ public class ClothConfigTabButton extends AbstractPressableButtonWidget {
         super.render(matrices, int_1, int_2, float_1);
 
         if (isMouseOver(int_1, int_2)) {
-            Optional<Text[]> tooltip = getTooltip();
+            Optional<StringRenderable[]> tooltip = getTooltip();
             if (tooltip.isPresent() && tooltip.get().length > 0)
                 screen.addTooltip(Tooltip.of(new Point(int_1, int_2), tooltip.get()));
         }
@@ -60,15 +62,10 @@ public class ClothConfigTabButton extends AbstractPressableButtonWidget {
         return this.active && this.visible && double_1 >= this.x && double_2 >= this.y && double_1 < this.x + this.width && double_2 < this.y + this.height && double_1 >= 20 && double_1 < screen.width - 20;
     }
 
-    public Optional<Text[]> getTooltip() {
-        if (tooltipSupplier != null)
-            return tooltipSupplier.get();
+    public Optional<StringRenderable[]> getTooltip() {
+        if (descriptionSupplier != null)
+            return descriptionSupplier.get();
         return Optional.empty();
     }
 
-    @Nullable
-    public Supplier<Optional<Text[]>> getTooltipSupplier() {
-        return tooltipSupplier;
-    }
-
 }

+ 3 - 3
src/main/java/me/shedaniel/clothconfig2/gui/GlobalizedClothConfigScreen.java

@@ -81,11 +81,11 @@ public class GlobalizedClothConfigScreen extends AbstractConfigScreen implements
     private boolean requestingReferenceRebuilding = false;
     
     @ApiStatus.Internal
-    public GlobalizedClothConfigScreen(Screen parent, Text title, Map<Text, List<Object>> entriesMap, Identifier backgroundLocation) {
+    public GlobalizedClothConfigScreen(Screen parent, Text title, Map<Text, ConfigCategory> categoryMap, Identifier backgroundLocation) {
         super(parent, title, backgroundLocation);
-        entriesMap.forEach((categoryName, list) -> {
+        categoryMap.forEach((categoryName, category) -> {
             List<AbstractConfigEntry<?>> entries = Lists.newArrayList();
-            for (Object object : list) {
+            for (Object object : category.getEntries()) {
                 AbstractConfigListEntry<?> entry;
                 if (object instanceof Pair<?, ?>) {
                     entry = (AbstractConfigListEntry<?>) ((Pair<?, ?>) object).getRight();

+ 16 - 20
src/main/java/me/shedaniel/clothconfig2/impl/ConfigBuilderImpl.java

@@ -38,9 +38,7 @@ public class ConfigBuilderImpl implements ConfigBuilder {
     private boolean transparentBackground = false;
     private Identifier defaultBackground = DrawableHelper.BACKGROUND_TEXTURE;
     private Consumer<Screen> afterInitConsumer = screen -> {};
-    private final Map<Text, Identifier> categoryBackground = Maps.newHashMap();
-    private final Map<Text, List<Object>> dataMap = Maps.newLinkedHashMap();
-    private final Map<Text, ConfigCategory> categoryMap = Maps.newHashMap();
+    private final Map<Text, ConfigCategory> categoryMap = Maps.newLinkedHashMap();
     private Text fallbackCategory = null;
     private boolean alwaysShowTabs = false;
     
@@ -76,6 +74,11 @@ public class ConfigBuilderImpl implements ConfigBuilder {
         return this;
     }
     
+    @Override
+    public boolean hasTransparentBackground() {
+        return transparentBackground;
+    }
+    
     @Override
     public ConfigBuilder setAfterInitConsumer(Consumer<Screen> afterInitConsumer) {
         this.afterInitConsumer = afterInitConsumer;
@@ -125,37 +128,32 @@ public class ConfigBuilderImpl implements ConfigBuilder {
     public ConfigCategory getOrCreateCategory(Text categoryKey) {
         if (categoryMap.containsKey(categoryKey))
             return categoryMap.get(categoryKey);
-        dataMap.put(categoryKey, Lists.newArrayList());
         if (fallbackCategory == null)
             fallbackCategory = categoryKey;
-        return categoryMap.computeIfAbsent(categoryKey, key -> new ConfigCategoryImpl(categoryKey, identifier -> {
-            if (transparentBackground)
-                throw new IllegalStateException("Cannot set category background if screen is using transparent background.");
-            categoryBackground.put(categoryKey, identifier);
-        }, () -> dataMap.get(categoryKey), () -> removeCategory(categoryKey)));
+        return categoryMap.computeIfAbsent(categoryKey, key -> new ConfigCategoryImpl(this, categoryKey));
     }
     
     @Override
     public ConfigBuilder removeCategory(Text category) {
-        if (dataMap.containsKey(category) && fallbackCategory.equals(category))
+        if (categoryMap.containsKey(category) && fallbackCategory.equals(category))
             fallbackCategory = null;
-        if (!dataMap.containsKey(category))
+        if (!categoryMap.containsKey(category))
             throw new NullPointerException("Category doesn't exist!");
-        dataMap.remove(category);
+        categoryMap.remove(category);
         return this;
     }
     
     @Override
     public ConfigBuilder removeCategoryIfExists(Text category) {
-        if (dataMap.containsKey(category) && fallbackCategory.equals(category))
+        if (categoryMap.containsKey(category) && fallbackCategory.equals(category))
             fallbackCategory = null;
-        dataMap.remove(category);
+        categoryMap.remove(category);
         return this;
     }
     
     @Override
     public boolean hasCategory(Text category) {
-        return dataMap.containsKey(category);
+        return categoryMap.containsKey(category);
     }
     
     @Override
@@ -215,13 +213,13 @@ public class ConfigBuilderImpl implements ConfigBuilder {
     
     @Override
     public Screen build() {
-        if (dataMap.isEmpty() || fallbackCategory == null)
+        if (categoryMap.isEmpty() || fallbackCategory == null)
             throw new NullPointerException("There cannot be no categories or fallback category!");
         AbstractConfigScreen screen;
         if (globalized) {
-            screen = new GlobalizedClothConfigScreen(parent, title, dataMap, defaultBackground);
+            screen = new GlobalizedClothConfigScreen(parent, title, categoryMap, defaultBackground);
         } else {
-            screen = new ClothConfigScreen(parent, title, dataMap, categoryMap, defaultBackground);
+            screen = new ClothConfigScreen(parent, title,  categoryMap, defaultBackground);
         }
         screen.setSavingRunnable(savingRunnable);
         screen.setEditable(editable);
@@ -232,8 +230,6 @@ public class ConfigBuilderImpl implements ConfigBuilder {
         screen.setAfterInitConsumer(afterInitConsumer);
         if (screen instanceof Expandable)
             ((Expandable) screen).setExpanded(globalizedExpanded);
-        if (screen instanceof TabbedConfigScreen)
-            categoryBackground.forEach(((TabbedConfigScreen) screen)::registerCategoryBackground);
         return screen;
     }
     

+ 38 - 23
src/main/java/me/shedaniel/clothconfig2/impl/ConfigCategoryImpl.java

@@ -1,32 +1,34 @@
 package me.shedaniel.clothconfig2.impl;
 
+import com.google.common.collect.Lists;
 import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
+import me.shedaniel.clothconfig2.api.ConfigBuilder;
 import me.shedaniel.clothconfig2.api.ConfigCategory;
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
+import net.minecraft.text.StringRenderable;
 import net.minecraft.text.Text;
 import net.minecraft.util.Identifier;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.List;
 import java.util.Optional;
-import java.util.function.Consumer;
 import java.util.function.Supplier;
 
 @Environment(EnvType.CLIENT)
 public class ConfigCategoryImpl implements ConfigCategory {
-    
-    private final Supplier<List<Object>> listSupplier;
-    private final Consumer<Identifier> backgroundConsumer;
-    private final Runnable destroyCategory;
+    private final ConfigBuilder builder;
+    private final List<Object> data;
+    @Nullable
+    private Identifier background;
     private final Text categoryKey;
-    @Nullable private Supplier<Optional<Text[]>> tooltipSupplier;
-
-    ConfigCategoryImpl(Text categoryKey, Consumer<Identifier> backgroundConsumer, Supplier<List<Object>> listSupplier, Runnable destroyCategory) {
-        this.listSupplier = listSupplier;
-        this.backgroundConsumer = backgroundConsumer;
+    @Nullable
+    private Supplier<Optional<StringRenderable[]>> description = Optional::empty;
+    
+    ConfigCategoryImpl(ConfigBuilder builder, Text categoryKey) {
+        this.builder = builder;
+        this.data = Lists.newArrayList();
         this.categoryKey = categoryKey;
-        this.destroyCategory = destroyCategory;
     }
     
     @Override
@@ -36,34 +38,47 @@ public class ConfigCategoryImpl implements ConfigCategory {
     
     @Override
     public List<Object> getEntries() {
-        return listSupplier.get();
+        return data;
     }
     
     @Override
     public ConfigCategory addEntry(AbstractConfigListEntry entry) {
-        listSupplier.get().add(entry);
+        data.add(entry);
         return this;
     }
     
     @Override
     public ConfigCategory setCategoryBackground(Identifier identifier) {
-        backgroundConsumer.accept(identifier);
+        if (builder.hasTransparentBackground())
+            throw new IllegalStateException("Cannot set category background if screen is using transparent background.");
+        background = identifier;
         return this;
     }
     
     @Override
     public void removeCategory() {
-        destroyCategory.run();
+        builder.removeCategory(categoryKey);
     }
-
+    
+    @Override
+    public void setBackground(@Nullable Identifier background) {
+        this.background = background;
+    }
+    
+    @Override
     @Nullable
-    public Supplier<Optional<Text[]>> getTooltipSupplier() {
-        return tooltipSupplier;
+    public Identifier getBackground() {
+        return background;
     }
-
-    public ConfigCategory setTooltipSupplier(@Nullable Supplier<Optional<Text[]>> tooltipSupplier) {
-        this.tooltipSupplier = tooltipSupplier;
-        return this;
+    
+    @Nullable
+    @Override
+    public Supplier<Optional<StringRenderable[]>> getDescription() {
+        return description;
+    }
+    
+    @Override
+    public void setDescription(@Nullable Supplier<Optional<StringRenderable[]>> description) {
+        this.description = description;
     }
-
 }

+ 4 - 3
src/main/java/me/shedaniel/clothconfig2/impl/ScissorsHandlerImpl.java

@@ -10,16 +10,17 @@ import net.fabricmc.api.Environment;
 import net.fabricmc.loader.api.FabricLoader;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.util.Window;
-import net.minecraft.util.math.MathHelper;
+import org.jetbrains.annotations.ApiStatus;
 import org.lwjgl.opengl.GL11;
 
 import java.util.Collections;
 import java.util.List;
 
 @Environment(EnvType.CLIENT)
+@ApiStatus.Internal
 public final class ScissorsHandlerImpl implements ScissorsHandler {
-    
-    @Deprecated public static final ScissorsHandler INSTANCE = new ScissorsHandlerImpl();
+    @ApiStatus.Internal
+    public static final ScissorsHandler INSTANCE = new ScissorsHandlerImpl();
     
     static {
         Executor.runIf(() -> FabricLoader.getInstance().isModLoaded("notenoughcrashes"), () -> () -> {