-
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.
Add use and attack blacklist, add LibGUI to dependencies, refactor so…
…me things
- Loading branch information
Showing
14 changed files
with
177 additions
and
127 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
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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package nichrosia.nobreak.content.type | ||
|
||
interface Content { | ||
fun load() | ||
} |
56 changes: 56 additions & 0 deletions
56
src/main/kotlin/nichrosia/nobreak/ext/NBClothConfigSettings.kt
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,56 @@ | ||
package nichrosia.nobreak.ext | ||
|
||
import me.shedaniel.clothconfig2.api.ConfigBuilder | ||
import me.shedaniel.clothconfig2.api.ConfigCategory | ||
import net.minecraft.client.gui.screen.Screen | ||
import net.minecraft.text.TranslatableText | ||
import nichrosia.nobreak.content.NBSettings | ||
|
||
object NBClothConfigSettings { | ||
fun build(parent: Screen): Screen { | ||
val builder = ConfigBuilder.create() | ||
.setParentScreen(parent) | ||
.setTitle(TranslatableText("title.nobreak.config")) | ||
.setSavingRunnable { | ||
|
||
} | ||
|
||
addCategories(builder) | ||
|
||
return builder.build() | ||
} | ||
|
||
private fun addCategories(builder: ConfigBuilder) { | ||
val general = builder.getOrCreateCategory(TranslatableText("category.nobreak.general")) | ||
|
||
addEntries(builder, general) | ||
} | ||
|
||
private fun addEntries(builder: ConfigBuilder, general: ConfigCategory) { | ||
val entryBuilder = builder.entryBuilder() | ||
|
||
general.addEntry(entryBuilder.startBooleanToggle( | ||
TranslatableText("setting.nobreak.do_break"), | ||
NBSettings.allowBreakage) | ||
.setSaveConsumer { NBSettings.allowBreakage = it } | ||
.build()) | ||
|
||
general.addEntry(entryBuilder.startBooleanToggle( | ||
TranslatableText("setting.nobreak.do_feedback"), | ||
NBSettings.notifyUser) | ||
.setSaveConsumer { NBSettings.notifyUser = it } | ||
.build()) | ||
|
||
general.addEntry(entryBuilder.startBooleanToggle( | ||
TranslatableText("setting.nobreak.diamond+_tools_can_break"), | ||
NBSettings.diamondPlusToolsCanBreak) | ||
.setSaveConsumer { NBSettings.diamondPlusToolsCanBreak = it } | ||
.build()) | ||
|
||
general.addEntry(entryBuilder.startBooleanToggle( | ||
TranslatableText("setting.nobreak.enchanted_tools_can_break"), | ||
NBSettings.enchantedToolsCanBreak) | ||
.setSaveConsumer { NBSettings.enchantedToolsCanBreak = it } | ||
.build()) | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...break/integration/NBModMenuIntegration.kt → ...ichrosia/nobreak/ext/NBModMenuSettings.kt
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,11 +1,11 @@ | ||
package nichrosia.nobreak.integration | ||
package nichrosia.nobreak.ext | ||
|
||
import com.terraformersmc.modmenu.api.ConfigScreenFactory | ||
import com.terraformersmc.modmenu.api.ModMenuApi | ||
|
||
@Suppress("unused") | ||
object NBModMenuIntegration : ModMenuApi { | ||
object NBModMenuSettings : ModMenuApi { | ||
override fun getModConfigScreenFactory(): ConfigScreenFactory<*> { | ||
return ConfigScreenFactory(NBClothConfigIntegration::build) | ||
return ConfigScreenFactory(NBClothConfigSettings::build) | ||
} | ||
} |
68 changes: 0 additions & 68 deletions
68
src/main/kotlin/nichrosia/nobreak/integration/NBClothConfigIntegration.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.