diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-02-09 20:17:34 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-02-18 11:29:59 +0800 |
| commit | 07cf05103e82b6edd25b4c401808f3be2a0294fd (patch) | |
| tree | 494b3019349137a277d37905e7f1b7e69caa887c /default-plugin/src/main/java | |
| parent | 2a6c99e0e489cd7c63f4c3dabed83b8b3f910c89 (diff) | |
| download | RoughlyEnoughItems-07cf05103e82b6edd25b4c401808f3be2a0294fd.tar.gz RoughlyEnoughItems-07cf05103e82b6edd25b4c401808f3be2a0294fd.tar.bz2 RoughlyEnoughItems-07cf05103e82b6edd25b4c401808f3be2a0294fd.zip | |
Migrate to Cloth Config's ValueAnimator, and add option to cache entry renders
Diffstat (limited to 'default-plugin/src/main/java')
3 files changed, 6 insertions, 6 deletions
diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java index 859ec3804..5cb04c7cd 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/DefaultInformationCategory.java @@ -29,7 +29,7 @@ import com.mojang.blaze3d.vertex.*; import com.mojang.math.Matrix4f; import me.shedaniel.clothconfig2.ClothConfigInitializer; import me.shedaniel.clothconfig2.api.ScissorsHandler; -import me.shedaniel.clothconfig2.api.ScrollingContainer; +import me.shedaniel.clothconfig2.api.scroll.ScrollingContainer; import me.shedaniel.math.Point; import me.shedaniel.math.Rectangle; import me.shedaniel.rei.api.client.REIRuntime; @@ -195,7 +195,7 @@ public class DefaultInformationCategory implements DisplayCategory<DefaultInform scrolling.updatePosition(delta); Rectangle innerBounds = scrolling.getScissorBounds(); ScissorsHandler.INSTANCE.scissor(innerBounds); - int currentY = (int) -scrolling.scrollAmount + innerBounds.y; + int currentY = -scrolling.scrollAmountInt() + innerBounds.y; for (FormattedCharSequence text : texts) { if (text != null && currentY + font.lineHeight >= innerBounds.y && currentY <= innerBounds.getMaxY()) { font.draw(matrices, text, innerBounds.x + 2, currentY + 2, REIRuntime.getInstance().isDarkThemeEnabled() ? 0xFFBBBBBB : 0xFF090909); diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/beacon/DefaultBeaconBaseCategory.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/beacon/DefaultBeaconBaseCategory.java index 7a467ef7f..d2dd424cf 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/beacon/DefaultBeaconBaseCategory.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/beacon/DefaultBeaconBaseCategory.java @@ -27,7 +27,7 @@ import com.google.common.collect.Lists; import com.mojang.blaze3d.vertex.PoseStack; import me.shedaniel.clothconfig2.ClothConfigInitializer; import me.shedaniel.clothconfig2.api.ScissorsHandler; -import me.shedaniel.clothconfig2.api.ScrollingContainer; +import me.shedaniel.clothconfig2.api.scroll.ScrollingContainer; import me.shedaniel.math.Point; import me.shedaniel.math.Rectangle; import me.shedaniel.rei.api.client.REIRuntime; @@ -165,7 +165,7 @@ public class DefaultBeaconBaseCategory implements DisplayCategory<DefaultBeaconB if (widgets.size() <= index) break; Slot widget = widgets.get(index); - widget.getBounds().setLocation(bounds.x + 1 + x * 18, (int) (bounds.y + 1 + y * 18 - scrolling.scrollAmount)); + widget.getBounds().setLocation(bounds.x + 1 + x * 18, bounds.y + 1 + y * 18 - scrolling.scrollAmountInt()); widget.render(matrices, mouseX, mouseY, delta); } } diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/beacon/DefaultBeaconPaymentCategory.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/beacon/DefaultBeaconPaymentCategory.java index 982e8ce04..71642fc1e 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/beacon/DefaultBeaconPaymentCategory.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/categories/beacon/DefaultBeaconPaymentCategory.java @@ -27,7 +27,7 @@ import com.google.common.collect.Lists; import com.mojang.blaze3d.vertex.PoseStack; import me.shedaniel.clothconfig2.ClothConfigInitializer; import me.shedaniel.clothconfig2.api.ScissorsHandler; -import me.shedaniel.clothconfig2.api.ScrollingContainer; +import me.shedaniel.clothconfig2.api.scroll.ScrollingContainer; import me.shedaniel.math.Point; import me.shedaniel.math.Rectangle; import me.shedaniel.rei.api.client.REIRuntime; @@ -165,7 +165,7 @@ public class DefaultBeaconPaymentCategory implements DisplayCategory<DefaultBeac if (widgets.size() <= index) break; Slot widget = widgets.get(index); - widget.getBounds().setLocation(bounds.x + 1 + x * 18, (int) (bounds.y + 1 + y * 18 - scrolling.scrollAmount)); + widget.getBounds().setLocation(bounds.x + 1 + x * 18, bounds.y + 1 + y * 18 - scrolling.scrollAmountInt()); widget.render(matrices, mouseX, mouseY, delta); } } |
