aboutsummaryrefslogtreecommitdiff
path: root/mod/src/main/java/kr
diff options
context:
space:
mode:
authorsyeyoung <cyoung06@naver.com>2023-02-07 18:39:48 +0900
committersyeyoung <cyoung06@naver.com>2023-02-07 18:39:48 +0900
commit980d5179fead0be5fdda90564bd1f13dee557ebe (patch)
tree65375b9eb59b5675aecb019958a04685e87e5d96 /mod/src/main/java/kr
parentf71dbf1441553e9884df64dcf64acebf12807810 (diff)
downloadSkyblock-Dungeons-Guide-980d5179fead0be5fdda90564bd1f13dee557ebe.tar.gz
Skyblock-Dungeons-Guide-980d5179fead0be5fdda90564bd1f13dee557ebe.tar.bz2
Skyblock-Dungeons-Guide-980d5179fead0be5fdda90564bd1f13dee557ebe.zip
- Make it impossible to get mechanic browser super tiny
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'mod/src/main/java/kr')
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/AbstractHUDFeature.java7
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java8
2 files changed, 13 insertions, 2 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/AbstractHUDFeature.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/AbstractHUDFeature.java
index 94bec8fd..51f9a8b4 100644
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/AbstractHUDFeature.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/AbstractHUDFeature.java
@@ -56,15 +56,18 @@ public abstract class AbstractHUDFeature extends AbstractGuiFeature {
updatePosition();
}
+ public double minWidth() {return 10;}
+
+ public double minHeight() {return 10;}
public void setWidth(double width) {
if (!requiresWidthBound()) throw new UnsupportedOperationException("Width unsettable");
- if (width < 10) width = 10;
+ if (width < minWidth()) width = minWidth();
featureRect.setWidth(width);
updatePosition();
}
public void setHeight(double height) {
if (!requiresHeightBound() && (getKeepRatio() == null)) throw new UnsupportedOperationException("Height unsettable");
- if (height < 10) height = 10;
+ if (height < minHeight()) height = minHeight();
if (getKeepRatio() != null)
featureRect.setWidth(height / getKeepRatio());
else
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java
index 7b805234..8c453b78 100644
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java
@@ -71,7 +71,15 @@ public class FeatureMechanicBrowse extends RawRenderingGuiFeature {
return this.<Double>getParameter("scale").getValue();
}
+ @Override
+ public double minWidth() {
+ return 100 * FeatureMechanicBrowse.this.<Double>getParameter("scale").getValue();
+ }
+ @Override
+ public double minHeight() {
+ return 50 * FeatureMechanicBrowse.this.<Double>getParameter("scale").getValue();
+ }
@Override
public void drawDemo(float partialTicks) {