Skip to content

Commit

Permalink
update 1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
SymoHTL committed Apr 16, 2024
1 parent 4cbb404 commit 9ec62e6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn_mappings=1.20.4+build.3
loader_version=0.15.9

# Mod Properties
mod_version=1.0.5
mod_version=1.0.6
maven_group=dev.symo.finz
archives_base_name=finz

Expand Down
14 changes: 1 addition & 13 deletions src/client/java/dev/symo/finz/FinZClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ public class FinZClient implements ClientModInitializer {
public static EventManager eventManager = new EventManager();
public static List<ModContainer> MODS = new ArrayList<>();

public static boolean isConfigOpen = false;
private static ConfigScreen configScreen;

public static final MinecraftClient mc = MinecraftClient.getInstance();

public static Path FinZPath = FabricLoader.getInstance().getConfigDir().resolve("finz");
Expand Down Expand Up @@ -60,16 +57,7 @@ private void createFinZFolder() {
}

public static void showConfigScreen() {
System.out.println("showConfigScreen");
if (isConfigOpen) {
configScreen.close();
configScreen = null;
isConfigOpen = false;
return;
}
configScreen = new ConfigScreen();
mc.setScreen(configScreen);
isConfigOpen = true;
mc.setScreen(new ConfigScreen());
//ConfigManager.build();
//Screen screen = ConfigManager.configBuilder.build();
//mc.setScreen(screen);
Expand Down
14 changes: 11 additions & 3 deletions src/client/java/dev/symo/finz/config/FinZSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public void load() {
var json = JsonParser.parseReader(reader).getAsJsonObject();

if (!json.get("version").getAsString().equals(FinZClient.CONFIG_VERSION)) {
Files.copy(path, Path.of(this.path + ".bak"));
Files.delete(path);
backupAndDelete();
return;
}

Expand All @@ -42,10 +41,19 @@ public void load() {
module.checkEnabled();
});
} catch (IOException e) {
throw new RuntimeException(e);
try {
backupAndDelete();
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
}

private void backupAndDelete() throws IOException {
Files.copy(Path.of(path), Path.of(path + ".bak"));
Files.delete(Path.of(path));
}

public void save() {
JsonObject json = new JsonObject();
json.addProperty("version", FinZClient.CONFIG_VERSION);
Expand Down
2 changes: 2 additions & 0 deletions src/client/java/dev/symo/finz/modules/impl/AntiKnockback.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public AntiKnockback() {
super("AntiKnockback", Category.MOVEMENT);
addSetting(_horizontal);
addSetting(_vertical);
addSetting(_everyNth);
}

@Override
Expand All @@ -36,6 +37,7 @@ public void onKnockback(KnockbackEvent event) {
@Override
public void onEnable() {
EVENTS.add(KnockbackListener.class, this);
_hitCount = 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class ItemESP extends AModule implements TickListener, WorldRenderListene
private final ArrayList<Entity> items = new ArrayList<>();

private final BoolSetting renderItemSprite = new BoolSetting("Render Sprite", "Render the item sprite",
true);
false);

private final IntSetting itemEspRange = new IntSetting("Range", "Range to scan for items",
50, 1, 100);
Expand Down

0 comments on commit 9ec62e6

Please sign in to comment.