Skip to content

Commit

Permalink
1.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Quplet committed Jun 14, 2024
1 parent e6dee6e commit a8add89
Show file tree
Hide file tree
Showing 40 changed files with 1,628 additions and 784 deletions.
14 changes: 9 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ repositories {
// for more information about repositories.
maven { url 'https://jitpack.io' }
maven { url "https://maven.shedaniel.me/" }
maven { url = 'https://maven.terraformersmc.com/releases/' }
maven {
name = "Terraformers"
url = "https://maven.terraformersmc.com/"
}
maven {
name 'Xander Maven'
url 'https://maven.isxander.dev/releases'
}
}

dependencies {
Expand All @@ -40,10 +47,7 @@ dependencies {
exclude(group: "net.fabricmc.fabric-api")
}

modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
include "me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}"
modImplementation("dev.isxander:yet-another-config-lib:${project.yet_another_config_lib_version}")
}

loom {
Expand Down
14 changes: 2 additions & 12 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
1.3.9-alpha.2-1.20.6
1.3.9-1.20.6

Fixes/Changes:
- Updated to 1.20.5/6
- Updated dependencies
- Fixed Compound Enchantments not showing up in enchanting tables even if enabled

Alpha.2:
- Fixed crash that didn't occur in development environment (#16)

1.20.5/6 made many drastic changes to how enchantments work in the game resulting in a massive overhaul of many of the mod's systems. Because of this, this release is an alpha and should be considered unstable.
Please report any bugs/crashes. Ideally, make an issue on the mod's Github: https://github.com/Quplet/Qu-Enchantments

Currently known broken systems:
- Enabling/disabling specific enchantments

In the future I intend to replace Cloth config with an alternative config library. The full release of 1.3.9 should have this.
- Changed configuration library from Cloth Config to YetAnotherConfigLib
82 changes: 57 additions & 25 deletions generateDefaultOptions.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,70 @@
import sys


def main():
name = sys.argv[1]
fname = format_name(name)
formatted_name = format_name(name)

with open('desc.txt', 'w') as f:

f.writelines([
f' // {formatted_name} options\n',
' @SerialEntry\n',
f' public boolean {name}Enabled = true;\n',
' @SerialEntry\n',
f' public boolean {name}RandomSelection = true;\n',
' @SerialEntry\n',
f' public boolean {name}EnchantingTable = true;\n',
' @SerialEntry\n',
f' public boolean {name}BookOffer = true;\n\n'
])

f.writelines([
f' private static final Collection<Option<?>> {name}Options = ImmutableList.of(\n',
' baseEnabled.binding(\n',
' true,\n'
f' () -> NewModConfig.CONFIG_HANDLER.instance().{name}Enabled,\n',
f' newVal -> NewModConfig.CONFIG_HANDLER.instance().{name}Enabled = newVal\n',
' )\n',
' .build(),\n\n',

' baseRandomSelection.binding(\n',
' true,\n'
f' () -> NewModConfig.CONFIG_HANDLER.instance().{name}RandomSelection,\n',
f' newVal -> NewModConfig.CONFIG_HANDLER.instance().{name}RandomSelection = newVal\n',
' )\n',
' .build(),\n\n',

f = open('desc.txt', 'w')
' baseEnchantingTable.binding(\n',
' true,\n'
f' () -> NewModConfig.CONFIG_HANDLER.instance().{name}EnchantingTable,\n',
f' newVal -> NewModConfig.CONFIG_HANDLER.instance().{name}EnchantingTable = newVal\n',
' )\n',
' .build(),\n\n',

f.writelines([f'"text.autoconfig.qu-enchantments.option.{name}": "{fname}",\n',
f'"text.autoconfig.qu-enchantments.option.{name}.isEnabled": "Is Enabled: ",\n',
f'"text.autoconfig.qu-enchantments.option.{name}.randomSelection": "Spawn As Loot: ",\n',
f'"text.autoconfig.qu-enchantments.option.{name}.enchantingTable": "Available On Enchanting Table: '
'",\n',
f'"text.autoconfig.qu-enchantments.option.{name}.bookOffer": "Is Tradable: ",\n\n'])
f.writelines([f'public static class {name[0].upper() + name[1:]} {{\n',
'\tpublic boolean isEnabled = true;\n',
'\tpublic boolean randomSelection = true;\n',
'\tpublic boolean enchantingTable = true;\n',
'\tpublic boolean bookOffer = true;\n}\n\n'])
f.writelines(['@ConfigEntry.Gui.CollapsibleObject\n',
f'public static final {name[0].upper() + name[1:]} {name} = new {name[0].upper() + name[1:]}();\n'])
' baseBookOffer.binding(\n',
' true,\n'
f' () -> NewModConfig.CONFIG_HANDLER.instance().{name}BookOffer,\n',
f' newVal -> NewModConfig.CONFIG_HANDLER.instance().{name}BookOffer = newVal\n',
' )\n',
' .build()\n',
' );\n\n',

f.close()

f' createOptionsGroup("{name}", {name}Options)\n\n',


f'"qu-enchantments.config.{name}.group.title": "{formatted_name} Options",\n',
f'"qu-enchantments.config.{name}.group.desc": "Configuration options for the {formatted_name} Enchantment",\n'
])

def format_name(name):
string = ''
n = 0
for i in range(len(name)):
if name[i].isupper():
string += name[n:i] + ' '
n = i
string += name[n:]
return string[0].upper() + string[1:]
new_str = ''

for char in name:
new_str += f' {char}' if char.isupper() else char

return new_str.title()



if __name__ == '__main__':
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ org.gradle.parallel=true
loader_version=0.15.11

# Mod Properties
mod_version = 1.3.9-alpha.2-1.20.6
mod_version = 1.3.9-1.20.6
maven_group = qu
archives_base_name = qu-enchantments

# Dependencies
fabric_version=0.99.0+1.20.6
mixin_extras_version = 0.3.6
mod_menu_version = 10.0.0-beta.1
cloth_config_version = 14.0.126
yet_another_config_lib_version = 3.4.4+1.20.6-fabric
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![Qu Enchantments Banner](https://i.imgur.com/rkXBNCN.png)

# Qu Enchantments Mod (For Fabric/Quilt)

Welcome! This is a mod adding various enchantments that ~~in my opinion~~ add much needed variation to the enchantments
Expand Down Expand Up @@ -101,5 +103,3 @@ Thanks to [E_Leven](https://www.instagram.com/evan_cdg/) for all the textures I
## 📜 License

Copyright 2022 Quplet, Apache License 2.0. Please credit if you use or distribute my work.

For the web graphics, Copyright 2023 E_Leven, All Rights Reserved.
Loading

0 comments on commit a8add89

Please sign in to comment.