Skip to content
This repository has been archived by the owner on Dec 24, 2023. It is now read-only.

Commit

Permalink
1.2.0
Browse files Browse the repository at this point in the history
Fixes a bug that made the HUD editor not save the position of the HUD
  • Loading branch information
Wyvest committed Apr 13, 2021
1 parent 6410d0c commit e8a3bc6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}
apply plugin: 'net.minecraftforge.gradle.forge'

version = "1.1.1"
version = "1.2.0"
group= "net.wyvest.timer"
archivesBaseName = "Timer Mod"

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/wyvest/timer/TimerMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class TimerMod {
private boolean latestVersion;
private boolean running;
public KeyBinding keyTimer = new KeyBinding("Toggle MeasureTimer", 25, "MeasureTimer");
private final TimerConfig config = new TimerConfig();
public final TimerConfig config = new TimerConfig();

public static TimerMod getInstance() {
if (INSTANCE == null)
Expand Down Expand Up @@ -75,4 +75,5 @@ public boolean isLatestVersion() {
return latestVersion;
}


}
5 changes: 3 additions & 2 deletions src/main/java/net/wyvest/timer/command/TimerCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import club.sk1er.mods.core.util.MinecraftUtils;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.wyvest.timer.TimerMod;
import net.wyvest.timer.config.TimerConfig;
import net.wyvest.timer.overlay.GUI;

Expand All @@ -22,7 +23,7 @@ public String getCommandUsage(ICommandSender sender) {
@Override
public void processCommand(ICommandSender sender, String[] args) {
if (args.length <= 0) {
ModCore.getInstance().getGuiHandler().open(new TimerConfig().gui());
ModCore.getInstance().getGuiHandler().open(TimerMod.getInstance().config.gui());
return;
}
switch (args[0].toLowerCase()) {
Expand All @@ -36,7 +37,7 @@ public void processCommand(ICommandSender sender, String[] args) {
MinecraftUtils.sendMessage(ChatColor.GREEN + "[Timer Mod] ", ChatColor.LIGHT_PURPLE + "Command Help\n" + "/timermod - Open Config Menu\n" + "/timermod help - Shows help for command usage\n" + "/timermod hud - Opens a GUI to configure where the timer is rendered.\n" + "/timermod config - Open Config Menu");
break;
case "config":
ModCore.getInstance().getGuiHandler().open(new TimerConfig().gui());
ModCore.getInstance().getGuiHandler().open(TimerMod.getInstance().config.gui());
}
}

Expand Down
7 changes: 4 additions & 3 deletions src/main/java/net/wyvest/timer/overlay/GUI.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package net.wyvest.timer.overlay;

import net.minecraft.client.gui.GuiScreen;
import net.wyvest.timer.TimerMod;
import net.wyvest.timer.config.TimerConfig;

import java.io.IOException;

/**
* @author Filip & Wyvest
* @author Filip, modified by Wyvest
*/
public class GUI extends GuiScreen {
private boolean dragging;
Expand Down Expand Up @@ -56,9 +57,9 @@ public boolean doesGuiPauseGame() {

@Override
public void onGuiClosed() {
TimerMod.getInstance().config.markDirty();
TimerMod.getInstance().config.writeData();
super.onGuiClosed();
new TimerConfig().markDirty();
new TimerConfig().writeData();
}

}

0 comments on commit e8a3bc6

Please sign in to comment.