-
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.
- Loading branch information
1 parent
0037040
commit ef75382
Showing
5 changed files
with
49 additions
and
0 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
4 changes: 4 additions & 0 deletions
4
src/main/java/io/github/ItsMaddieNow/building_tweaks/BuildingTweaks.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
7 changes: 7 additions & 0 deletions
7
src/main/java/io/github/ItsMaddieNow/building_tweaks/config/AbstractConfig.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,7 @@ | ||
package io.github.ItsMaddieNow.building_tweaks.config; | ||
|
||
public abstract class AbstractConfig { | ||
public boolean flowersEnabled = true; | ||
public boolean bonemealEnabled = true; | ||
public boolean potsEnabled = true; | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/io/github/ItsMaddieNow/building_tweaks/config/BTQuiltConfig.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,33 @@ | ||
package io.github.ItsMaddieNow.building_tweaks.config; | ||
|
||
import io.github.ItsMaddieNow.building_tweaks.BuildingTweaks; | ||
import org.quiltmc.config.api.ReflectiveConfig; | ||
import org.quiltmc.config.api.annotations.Comment; | ||
import org.quiltmc.config.api.values.TrackedValue; | ||
import org.quiltmc.loader.api.config.v2.QuiltConfig; | ||
|
||
public class BTQuiltConfig extends AbstractConfig { | ||
public static final BTReflectiveConfig CONFIG = QuiltConfig.create(BuildingTweaks.ID, "config", BTReflectiveConfig.class); | ||
public BTQuiltConfig(){ | ||
update(); | ||
CONFIG.registerCallback(config -> this.update()); | ||
} | ||
|
||
public void update(){ | ||
flowersEnabled = CONFIG.flowerConfig.enabled.value(); | ||
bonemealEnabled = CONFIG.flowerConfig.enable_bonemeal.value(); | ||
potsEnabled = CONFIG.enable_pots.value(); | ||
} | ||
|
||
public static class BTReflectiveConfig extends ReflectiveConfig{ | ||
@Comment("Settings Related To Flowers") | ||
public final FlowerConfig flowerConfig = new FlowerConfig(); | ||
public final TrackedValue<Boolean> enable_pots = this.value(true); | ||
|
||
public static class FlowerConfig extends Section{ | ||
public final TrackedValue<Boolean> enabled = this.value(true); | ||
public final TrackedValue<Boolean> enable_bonemeal = this.value(true); | ||
} | ||
|
||
} | ||
} |