diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-02-09 20:17:34 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-02-18 11:44:53 +0800 |
| commit | add82389af2c1196cdd410b441b6ee728c84a390 (patch) | |
| tree | 0af36169be21e61f4fb124c76fa79e5dda26461b /default-plugin/src/main/java | |
| parent | 240b0b563f4ac98a7b1a2086c7de0a51a5dd64cc (diff) | |
| download | RoughlyEnoughItems-add82389af2c1196cdd410b441b6ee728c84a390.tar.gz RoughlyEnoughItems-add82389af2c1196cdd410b441b6ee728c84a390.tar.bz2 RoughlyEnoughItems-add82389af2c1196cdd410b441b6ee728c84a390.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 1f8b115a9..fd61c37ac 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; @@ -194,7 +194,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); } } |
