diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-02-09 20:17:34 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-02-09 20:17:34 +0800 |
| commit | caa850ff55576c8aef92c28ab5dcf87a319f6e3a (patch) | |
| tree | 4fbb17d0d7ee6c3d523ff5839288315e483accea /default-plugin/src/main/java/me | |
| parent | 48ef9ff7f4b1be74006837b51a683d5e8b9bdc52 (diff) | |
| download | RoughlyEnoughItems-caa850ff55576c8aef92c28ab5dcf87a319f6e3a.tar.gz RoughlyEnoughItems-caa850ff55576c8aef92c28ab5dcf87a319f6e3a.tar.bz2 RoughlyEnoughItems-caa850ff55576c8aef92c28ab5dcf87a319f6e3a.zip | |
Migrate to Cloth Config's ValueAnimator, and add option to cache entry renders
Diffstat (limited to 'default-plugin/src/main/java/me')
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); } } |
