-
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.
Update to 1.20, change to autoconfig
- Loading branch information
1 parent
d187b03
commit 3c4cb86
Showing
13 changed files
with
96 additions
and
246 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
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,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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
21 changes: 0 additions & 21 deletions
21
src/main/java/net/seakerman/rangefinderhud/config/Config.java
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
src/main/java/net/seakerman/rangefinderhud/config/ModConfig.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,30 @@ | ||
package net.seakerman.rangefinderhud.config; | ||
|
||
import me.shedaniel.autoconfig.ConfigData; // autoconfig is better for settings menu | ||
import me.shedaniel.autoconfig.annotation.Config; // easy-to-read code and less files | ||
import me.shedaniel.autoconfig.annotation.ConfigEntry; | ||
|
||
@Config(name = "rangefinderhud") | ||
public class ModConfig implements ConfigData { | ||
|
||
@ConfigEntry.Gui.Tooltip | ||
public boolean onOff = true; | ||
|
||
@ConfigEntry.Gui.Tooltip | ||
public int x = 50; | ||
@ConfigEntry.Gui.Tooltip | ||
public int y = 50; | ||
|
||
@ConfigEntry.Gui.Tooltip | ||
public int offset = 10; | ||
|
||
@ConfigEntry.Gui.Tooltip | ||
public int precision = 2; | ||
|
||
@ConfigEntry.ColorPicker(allowAlpha = true) //color picker entry type | ||
public int color1 = 0xFF00C832; //#ARGB format | ||
|
||
@ConfigEntry.ColorPicker(allowAlpha = true) | ||
public int color2 = 0xFFC8C8C8; | ||
|
||
} |
113 changes: 0 additions & 113 deletions
113
src/main/java/net/seakerman/rangefinderhud/config/RFHConfigScreen.java
This file was deleted.
Oops, something went wrong.
13 changes: 3 additions & 10 deletions
13
src/main/java/net/seakerman/rangefinderhud/config/RFHModMenu.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 |
---|---|---|
@@ -1,25 +1,18 @@ | ||
package net.seakerman.rangefinderhud.config; | ||
|
||
import me.shedaniel.autoconfig.AutoConfig; | ||
import com.terraformersmc.modmenu.api.ConfigScreenFactory; | ||
import com.terraformersmc.modmenu.api.ModMenuApi; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.client.MinecraftClient; | ||
import org.apache.logging.log4j.LogManager; | ||
|
||
@Environment(EnvType.CLIENT) | ||
public class RFHModMenu implements ModMenuApi | ||
{ | ||
@Override | ||
public ConfigScreenFactory<?> getModConfigScreenFactory() { | ||
try { | ||
RFHConfigScreen configGUI = new RFHConfigScreen(); | ||
return parent -> configGUI.getConfigScreen(parent, MinecraftClient.getInstance().world != null); | ||
} catch (NoClassDefFoundError e) { | ||
//I definitely didn't catch an error, you saw nothing... | ||
LogManager.getLogger().warn("[Rangefinder HUD]: Mod settings cannot be edited in Mod Menu without cloth config"); | ||
return null; | ||
} | ||
|
||
return screen -> AutoConfig.getConfigScreen(ModConfig.class, screen).get(); | ||
|
||
} | ||
} |
Oops, something went wrong.