-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
22 changed files
with
242 additions
and
351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
.../net/i_no_am/viewmodel/client/Global.java → ...in/java/net/i_no_am/viewmodel/Global.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,30 @@ | ||
package net.i_no_am.viewmodel; | ||
|
||
import net.i_no_am.viewmodel.client.Global; | ||
import io.github.itzispyder.improperui.ImproperUIAPI; | ||
import net.fabricmc.api.ModInitializer; | ||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; | ||
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; | ||
import net.i_no_am.viewmodel.config.ConfigManager; | ||
import net.i_no_am.viewmodel.version.Version; | ||
import net.i_no_am.viewmodel.config.Config; | ||
import net.i_no_am.viewmodel.event.SecondMenuCallBack; | ||
import net.minecraft.client.option.KeyBinding; | ||
import net.minecraft.client.util.InputUtil; | ||
import org.lwjgl.glfw.GLFW; | ||
|
||
public class ViewModel implements ModInitializer, Global { | ||
|
||
public static final KeyBinding BIND = KeyBindingHelper.registerKeyBinding(new KeyBinding( | ||
"binds.viewmodel.menu", | ||
InputUtil.Type.KEYSYM, | ||
GLFW.GLFW_KEY_V, | ||
"binds.viewmodel" | ||
)); | ||
public static boolean isOutdated = false; | ||
public static final KeyBinding BIND = KeyBindingHelper.registerKeyBinding(new KeyBinding("binds.viewmodel.menu", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_V, "binds.viewmodel")); | ||
|
||
@Override | ||
public void onInitialize() { | ||
Version.checkUpdates(); | ||
ImproperUIAPI.init(modId, ViewModel.class, screens); | ||
ClientTickEvents.END_CLIENT_TICK.register(client -> { | ||
Config.loadConfig(); | ||
while (BIND.wasPressed()) { | ||
ImproperUIAPI.parseAndRunFile(modId, "screen.ui",new SecondMenuCallBack()); | ||
} | ||
ConfigManager.loadConfigValues(); | ||
}); | ||
} | ||
} |
72 changes: 0 additions & 72 deletions
72
src/main/java/net/i_no_am/viewmodel/client/ModVersionChecker.java
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
src/main/java/net/i_no_am/viewmodel/client/ViewModelClient.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package net.i_no_am.viewmodel.config; | ||
|
||
import io.github.itzispyder.improperui.ImproperUIAPI; | ||
import io.github.itzispyder.improperui.config.ConfigReader; | ||
import io.github.itzispyder.improperui.util.ChatUtils; | ||
import net.i_no_am.viewmodel.Global; | ||
import net.i_no_am.viewmodel.config.settings.ConfigSettings; | ||
import net.minecraft.util.Formatting; | ||
|
||
public class Config implements Global { | ||
|
||
private static final ConfigReader VMConfig = ImproperUIAPI.getConfigReader(modId, "config.properties"); | ||
|
||
/*First Page Settings:*/ | ||
public static ConfigSettings<Double> mainPositionX; | ||
public static ConfigSettings<Double> mainRotationX; | ||
public static ConfigSettings<Double> offPositionX; | ||
public static ConfigSettings<Double> offRotationX; | ||
public static ConfigSettings<Double> mainPositionY; | ||
public static ConfigSettings<Double> mainRotationY; | ||
public static ConfigSettings<Double> offPositionY; | ||
public static ConfigSettings<Double> offRotationY; | ||
public static ConfigSettings<Double> mainPositionZ; | ||
public static ConfigSettings<Double> mainRotationZ; | ||
public static ConfigSettings<Double> offPositionZ; | ||
public static ConfigSettings<Double> offRotationZ; | ||
/*Second Page Settings*/ | ||
public static ConfigSettings<Double> handSpeedSwing; | ||
public static ConfigSettings<Double> mainHandScale; | ||
public static ConfigSettings<Double> offHandScale; | ||
public static ConfigSettings<Boolean> noHandSwingV2; | ||
public static ConfigSettings<Boolean> noHandSwingV1; | ||
public static ConfigSettings<Boolean> noFoodSwing; | ||
public static ConfigSettings<Boolean> noHandRender; | ||
|
||
public static void loadConfig() { | ||
/*First Page Settings:*/ | ||
mainPositionX = new ConfigSettings<>(Double.class, VMConfig.readDouble("main-position-x", 0.0)); | ||
mainRotationX = new ConfigSettings<>(Double.class, VMConfig.readDouble("main-rotation-x", 0.0)); | ||
offPositionX = new ConfigSettings<>(Double.class, VMConfig.readDouble("off-position-x", 0.0)); | ||
offRotationX = new ConfigSettings<>(Double.class, VMConfig.readDouble("off-rotation-x", 0.0)); | ||
mainPositionY = new ConfigSettings<>(Double.class, VMConfig.readDouble("main-position-y", 0.0)); | ||
mainRotationY = new ConfigSettings<>(Double.class, VMConfig.readDouble("main-rotation-y", 0.0)); | ||
offPositionY = new ConfigSettings<>(Double.class, VMConfig.readDouble("off-position-y", 0.0)); | ||
offRotationY = new ConfigSettings<>(Double.class, VMConfig.readDouble("off-rotation-y", 0.0)); | ||
mainPositionZ = new ConfigSettings<>(Double.class, VMConfig.readDouble("main-position-z", 0.0)); | ||
mainRotationZ = new ConfigSettings<>(Double.class, VMConfig.readDouble("main-rotation-z", 0.0)); | ||
offPositionZ = new ConfigSettings<>(Double.class, VMConfig.readDouble("off-position-z", 0.0)); | ||
offRotationZ = new ConfigSettings<>(Double.class, VMConfig.readDouble("off-rotation-z", 0.0)); | ||
/*Second Page Settings:*/ | ||
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) | ||
mainHandScale = new ConfigSettings<>(Double.class, VMConfig.readDouble("main-hand-scale", 1.0)); | ||
offHandScale = new ConfigSettings<>(Double.class, VMConfig.readDouble("off-hand-scale", 1.0)); | ||
noHandSwingV2 = new ConfigSettings<>(Boolean.class, VMConfig.readBool("no-hand-swing-v2", false)); | ||
noHandSwingV1 = new ConfigSettings<>(Boolean.class, VMConfig.readBool("no-hand-swing-v1", false)); | ||
noFoodSwing = new ConfigSettings<>(Boolean.class, VMConfig.readBool("no-food-swing", false)); | ||
noHandRender = new ConfigSettings<>(Boolean.class, VMConfig.readBool("no-hand-render", false)); | ||
/*No Swing Logic*/ | ||
if (noHandSwingV2.getVal() && (noHandSwingV1.getVal())) { | ||
VMConfig.write("no-hand-swing", false); | ||
VMConfig.write("no-hand-swing-v2", false); | ||
ChatUtils.sendMessage(PREFIX + Formatting.RED + "CHOOSE ONE OPTION!"); | ||
} | ||
} | ||
} |
50 changes: 0 additions & 50 deletions
50
src/main/java/net/i_no_am/viewmodel/config/ConfigManager.java
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
src/main/java/net/i_no_am/viewmodel/config/SettingStructure.java
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
src/main/java/net/i_no_am/viewmodel/config/settings/ConfigSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package net.i_no_am.viewmodel.config.settings; | ||
|
||
public class ConfigSettings<T> { | ||
private final T value; | ||
|
||
public ConfigSettings(Class<T> type, T value) { | ||
this.value = value; | ||
} | ||
|
||
public T getVal() { | ||
return value; | ||
} | ||
} |
31 changes: 0 additions & 31 deletions
31
src/main/java/net/i_no_am/viewmodel/config/settings/SettingsManager.java
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
src/main/java/net/i_no_am/viewmodel/config/settings/ViewModelSettings.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.