Skip to content

Commit c7d8530

Browse files
committed
bumped version,fixed java 17, added a secret option to disable update checks, removed unused Class<T> parameter
1 parent 3f153a6 commit c7d8530

File tree

5 files changed

+35
-29
lines changed

5 files changed

+35
-29
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ processResources {
4646
}
4747
}
4848

49-
def targetJavaVersion = 21
49+
def targetJavaVersion = 17
5050
tasks.withType(JavaCompile).configureEach {
5151
// ensure that the encoding is set to UTF-8, no matter what the system default is
5252
// this fixes some edge cases with special characters not displaying correctly

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Done to increase the memory available to gradle.
2-
org.gradle.jvmargs=-Xmx1G
2+
org.gradle.jvmargs=-Xmx1G
33

44
# Fabric Properties
55
# check these on https://modmuss50.me/fabric.html
@@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
88
loader_version=0.15.11
99

1010
# Mod Properties
11-
mod_version = 1.0.0-1.20.2-fabric
11+
mod_version = 1.0.1-1.20.2-fabric
1212
maven_group=net.i_no_am.view_model
1313
archives_base_name=view-model
1414

src/main/java/net/i_no_am/viewmodel/config/Config.java

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,33 @@ public class Config implements Global {
3232
public static ConfigSettings<Boolean> noHandSwingV1;
3333
public static ConfigSettings<Boolean> noFoodSwing;
3434
public static ConfigSettings<Boolean> noHandRender;
35+
/*Secret Setting */
36+
public static ConfigSettings<Boolean> shouldCheck;
3537

3638
public static void loadConfig() {
3739
/*First Page Settings:*/
38-
mainPositionX = new ConfigSettings<>(Double.class, VMConfig.readDouble("main-position-x", 0.0));
39-
mainRotationX = new ConfigSettings<>(Double.class, VMConfig.readDouble("main-rotation-x", 0.0));
40-
offPositionX = new ConfigSettings<>(Double.class, VMConfig.readDouble("off-position-x", 0.0));
41-
offRotationX = new ConfigSettings<>(Double.class, VMConfig.readDouble("off-rotation-x", 0.0));
42-
mainPositionY = new ConfigSettings<>(Double.class, VMConfig.readDouble("main-position-y", 0.0));
43-
mainRotationY = new ConfigSettings<>(Double.class, VMConfig.readDouble("main-rotation-y", 0.0));
44-
offPositionY = new ConfigSettings<>(Double.class, VMConfig.readDouble("off-position-y", 0.0));
45-
offRotationY = new ConfigSettings<>(Double.class, VMConfig.readDouble("off-rotation-y", 0.0));
46-
mainPositionZ = new ConfigSettings<>(Double.class, VMConfig.readDouble("main-position-z", 0.0));
47-
mainRotationZ = new ConfigSettings<>(Double.class, VMConfig.readDouble("main-rotation-z", 0.0));
48-
offPositionZ = new ConfigSettings<>(Double.class, VMConfig.readDouble("off-position-z", 0.0));
49-
offRotationZ = new ConfigSettings<>(Double.class, VMConfig.readDouble("off-rotation-z", 0.0));
40+
mainPositionX = new ConfigSettings<>(VMConfig.readDouble("main-position-x", 0.0));
41+
mainRotationX = new ConfigSettings<>(VMConfig.readDouble("main-rotation-x", 0.0));
42+
offPositionX = new ConfigSettings<>(VMConfig.readDouble("off-position-x", 0.0));
43+
offRotationX = new ConfigSettings<>(VMConfig.readDouble("off-rotation-x", 0.0));
44+
mainPositionY = new ConfigSettings<>(VMConfig.readDouble("main-position-y", 0.0));
45+
mainRotationY = new ConfigSettings<>(VMConfig.readDouble("main-rotation-y", 0.0));
46+
offPositionY = new ConfigSettings<>(VMConfig.readDouble("off-position-y", 0.0));
47+
offRotationY = new ConfigSettings<>(VMConfig.readDouble("off-rotation-y", 0.0));
48+
mainPositionZ = new ConfigSettings<>(VMConfig.readDouble("main-position-z", 0.0));
49+
mainRotationZ = new ConfigSettings<>(VMConfig.readDouble("main-rotation-z", 0.0));
50+
offPositionZ = new ConfigSettings<>(VMConfig.readDouble("off-position-z", 0.0));
51+
offRotationZ = new ConfigSettings<>(VMConfig.readDouble("off-rotation-z", 0.0));
5052
/*Second Page Settings:*/
51-
handSpeedSwing = new ConfigSettings<>(Double.class, VMConfig.readDouble("hand-speed-swing", 4.0));///it was 1 - 7, from now its 0 - 5 (2 and below didnt work)
52-
mainHandScale = new ConfigSettings<>(Double.class, VMConfig.readDouble("main-hand-scale", 1.0));
53-
offHandScale = new ConfigSettings<>(Double.class, VMConfig.readDouble("off-hand-scale", 1.0));
54-
noHandSwingV2 = new ConfigSettings<>(Boolean.class, VMConfig.readBool("no-hand-swing-v2", false));
55-
noHandSwingV1 = new ConfigSettings<>(Boolean.class, VMConfig.readBool("no-hand-swing-v1", false));
56-
noFoodSwing = new ConfigSettings<>(Boolean.class, VMConfig.readBool("no-food-swing", false));
57-
noHandRender = new ConfigSettings<>(Boolean.class, VMConfig.readBool("no-hand-render", false));
53+
handSpeedSwing = new ConfigSettings<>(VMConfig.readDouble("hand-speed-swing", 4.0));
54+
mainHandScale = new ConfigSettings<>(VMConfig.readDouble("main-hand-scale", 1.0));
55+
offHandScale = new ConfigSettings<>(VMConfig.readDouble("off-hand-scale", 1.0));
56+
noHandSwingV2 = new ConfigSettings<>(VMConfig.readBool("no-hand-swing-v2", false));
57+
noHandSwingV1 = new ConfigSettings<>(VMConfig.readBool("no-hand-swing-v1", false));
58+
noFoodSwing = new ConfigSettings<>(VMConfig.readBool("no-food-swing", false));
59+
noHandRender = new ConfigSettings<>(VMConfig.readBool("no-hand-render", false));
60+
/*Secret Setting */
61+
shouldCheck = new ConfigSettings<>(VMConfig.readBool("should-check", true));
5862
/*No Swing Logic*/
5963
if (noHandSwingV2.getVal() && (noHandSwingV1.getVal())) {
6064
VMConfig.write("no-hand-swing", false);

src/main/java/net/i_no_am/viewmodel/config/settings/ConfigSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
public class ConfigSettings<T> {
44
private final T value;
55

6-
public ConfigSettings(Class<T> type, T value) {
6+
public ConfigSettings(T value) {
77
this.value = value;
88
}
99

src/main/java/net/i_no_am/viewmodel/version/Version.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
import com.google.gson.JsonParser;
55
import net.fabricmc.loader.api.FabricLoader;
66
import net.i_no_am.viewmodel.Global;
7+
import net.i_no_am.viewmodel.config.Config;
78
import net.minecraft.client.gui.screen.ConfirmScreen;
89
import net.minecraft.text.Text;
910
import net.minecraft.util.Formatting;
1011
import net.minecraft.util.Util;
12+
import org.jetbrains.annotations.Nullable;
1113

1214
import java.net.URI;
1315
import java.net.http.HttpClient;
@@ -20,20 +22,20 @@
2022
public class Version implements Global {
2123

2224
private static final Map<String, Double> versionCache = new HashMap<>();
23-
private final String api;
24-
private final String download;
25+
@Nullable private final String api;
26+
@Nullable private final String download;
2527
private static boolean bl = false;
2628
private final double version;
2729

2830
/**
29-
@param api The link to the github repo api.
31+
@param api The link to the GITHUB repo api.
3032
@param download The link to the download page.
3133
***/
3234

33-
public Version(String api, String download) throws Exception {
35+
public Version(@Nullable String api,@Nullable String download) throws Exception {
3436
this.api = api;
3537
this.download = download;
36-
this.version = getVApi();
38+
this.version = Config.shouldCheck.getVal() ? getVApi() : 0.0;
3739
}
3840

3941
public static Version create(String apiLink, String downloadLink) {
@@ -45,7 +47,7 @@ public static Version create(String apiLink, String downloadLink) {
4547
}
4648

4749
public void notifyUpdate(boolean printVersions) {
48-
if (!bl && mc.currentScreen == null && mc.player != null && !isUpdated()) {
50+
if (!bl && mc.currentScreen == null && mc.player != null && !isUpdated() && Config.shouldCheck.getVal()) {
4951
if (printVersions) {
5052
System.out.println("Versions: \nCurrent Version: " + getSelf() + "\n" + "Online Version: " + getApi());
5153
}

0 commit comments

Comments
 (0)