Skip to content

Commit 939ec0f

Browse files
committed
Update 9.0
Changelog: *Improved code quality and efficiency. *Changed the update checking method. *Removed hand scaling. *Fixed a bug where hand positions would change while swimming. *Fixed hand swing speed.
1 parent f612f13 commit 939ec0f

22 files changed

+242
-351
lines changed

gradle.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ org.gradle.jvmargs=-Xmx1G
88
loader_version=0.15.11
99

1010
# Mod Properties
11-
mod_version = 8.0-1.21-fabric
11+
mod_version = 9.0-1.21-fabric
1212
maven_group=net.i_no_am.view_model
1313
archives_base_name=view-model
1414

1515
# Dependencies
1616
# check this on https://modmuss50.me/fabric.html
1717
fabric_version=0.100.4+1.21
18-
# ImproperUI
19-
# check latest release on https://github.com/ItziSpyder/ImproperUI/releases
18+
# ImproperUI Properties
19+
# check on https://github.com/ItziSpyder/ImproperUI/releases/latest
2020
improperui_version=1.21-0.0.6-BETA

src/main/java/net/i_no_am/viewmodel/client/Global.java src/main/java/net/i_no_am/viewmodel/Global.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package net.i_no_am.viewmodel.client;
1+
package net.i_no_am.viewmodel;
22

3-
import net.i_no_am.viewmodel.utils.Utils;
3+
import net.minecraft.client.MinecraftClient;
44

55
public interface Global {
6+
MinecraftClient mc = MinecraftClient.getInstance();
67
String PREFIX = "§7[§aViewModel§7]§r ";
7-
String CURRENT_VERSION = Utils.getModVersion();
88
String modId = "viewmodel";
99
String[] screens = {
1010
"assets/viewmodel/improperui/screen.ui",
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
11
package net.i_no_am.viewmodel;
22

3-
import net.i_no_am.viewmodel.client.Global;
43
import io.github.itzispyder.improperui.ImproperUIAPI;
54
import net.fabricmc.api.ModInitializer;
65
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
76
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
8-
import net.i_no_am.viewmodel.config.ConfigManager;
7+
import net.i_no_am.viewmodel.version.Version;
8+
import net.i_no_am.viewmodel.config.Config;
99
import net.i_no_am.viewmodel.event.SecondMenuCallBack;
1010
import net.minecraft.client.option.KeyBinding;
1111
import net.minecraft.client.util.InputUtil;
1212
import org.lwjgl.glfw.GLFW;
1313

1414
public class ViewModel implements ModInitializer, Global {
1515

16-
public static final KeyBinding BIND = KeyBindingHelper.registerKeyBinding(new KeyBinding(
17-
"binds.viewmodel.menu",
18-
InputUtil.Type.KEYSYM,
19-
GLFW.GLFW_KEY_V,
20-
"binds.viewmodel"
21-
));
16+
public static boolean isOutdated = false;
17+
public static final KeyBinding BIND = KeyBindingHelper.registerKeyBinding(new KeyBinding("binds.viewmodel.menu", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_V, "binds.viewmodel"));
18+
2219
@Override
2320
public void onInitialize() {
21+
Version.checkUpdates();
2422
ImproperUIAPI.init(modId, ViewModel.class, screens);
2523
ClientTickEvents.END_CLIENT_TICK.register(client -> {
24+
Config.loadConfig();
2625
while (BIND.wasPressed()) {
2726
ImproperUIAPI.parseAndRunFile(modId, "screen.ui",new SecondMenuCallBack());
2827
}
29-
ConfigManager.loadConfigValues();
3028
});
3129
}
3230
}

src/main/java/net/i_no_am/viewmodel/client/ModVersionChecker.java

-72
This file was deleted.

src/main/java/net/i_no_am/viewmodel/client/ViewModelClient.java

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package net.i_no_am.viewmodel.config;
2+
3+
import io.github.itzispyder.improperui.ImproperUIAPI;
4+
import io.github.itzispyder.improperui.config.ConfigReader;
5+
import io.github.itzispyder.improperui.util.ChatUtils;
6+
import net.i_no_am.viewmodel.Global;
7+
import net.i_no_am.viewmodel.config.settings.ConfigSettings;
8+
import net.minecraft.util.Formatting;
9+
10+
public class Config implements Global {
11+
12+
private static final ConfigReader VMConfig = ImproperUIAPI.getConfigReader(modId, "config.properties");
13+
14+
/*First Page Settings:*/
15+
public static ConfigSettings<Double> mainPositionX;
16+
public static ConfigSettings<Double> mainRotationX;
17+
public static ConfigSettings<Double> offPositionX;
18+
public static ConfigSettings<Double> offRotationX;
19+
public static ConfigSettings<Double> mainPositionY;
20+
public static ConfigSettings<Double> mainRotationY;
21+
public static ConfigSettings<Double> offPositionY;
22+
public static ConfigSettings<Double> offRotationY;
23+
public static ConfigSettings<Double> mainPositionZ;
24+
public static ConfigSettings<Double> mainRotationZ;
25+
public static ConfigSettings<Double> offPositionZ;
26+
public static ConfigSettings<Double> offRotationZ;
27+
/*Second Page Settings*/
28+
public static ConfigSettings<Double> handSpeedSwing;
29+
public static ConfigSettings<Double> mainHandScale;
30+
public static ConfigSettings<Double> offHandScale;
31+
public static ConfigSettings<Boolean> noHandSwingV2;
32+
public static ConfigSettings<Boolean> noHandSwingV1;
33+
public static ConfigSettings<Boolean> noFoodSwing;
34+
public static ConfigSettings<Boolean> noHandRender;
35+
36+
public static void loadConfig() {
37+
/*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));
50+
/*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));
58+
/*No Swing Logic*/
59+
if (noHandSwingV2.getVal() && (noHandSwingV1.getVal())) {
60+
VMConfig.write("no-hand-swing", false);
61+
VMConfig.write("no-hand-swing-v2", false);
62+
ChatUtils.sendMessage(PREFIX + Formatting.RED + "CHOOSE ONE OPTION!");
63+
}
64+
}
65+
}

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

-50
This file was deleted.

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

-31
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package net.i_no_am.viewmodel.config.settings;
2+
3+
public class ConfigSettings<T> {
4+
private final T value;
5+
6+
public ConfigSettings(Class<T> type, T value) {
7+
this.value = value;
8+
}
9+
10+
public T getVal() {
11+
return value;
12+
}
13+
}

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

-31
This file was deleted.

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

-33
This file was deleted.

src/main/java/net/i_no_am/viewmodel/event/SecondMenuCallBack.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
import io.github.itzispyder.improperui.script.CallbackHandler;
55
import io.github.itzispyder.improperui.script.CallbackListener;
66
import io.github.itzispyder.improperui.script.events.MouseEvent;
7-
import net.i_no_am.viewmodel.client.Global;
7+
import net.i_no_am.viewmodel.Global;
88

99

1010
public class SecondMenuCallBack implements CallbackListener, Global {
1111

12-
1312
@CallbackHandler
1413
public void openHandsSettingScreen(MouseEvent e) {
1514
if (e.input.isDown())

0 commit comments

Comments
 (0)