Skip to content

Commit a962e35

Browse files
committed
hotfix: add support for simplyswords
1 parent 625b511 commit a962e35

68 files changed

Lines changed: 1414 additions & 208 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ dependencies {
181181
runtimeOnly fg.deobf("maven.modrinth:jupiter:ZmYt4jjp")
182182
runtimeOnly fg.deobf("maven.modrinth:architectury-api:9.2.14+forge")
183183
runtimeOnly fg.deobf("maven.modrinth:one-enough-item:TkHRus8b")
184-
184+
runtimeOnly fg.deobf("maven.modrinth:cloth-config:${cloth_config_version}")
185+
runtimeOnly fg.deobf("maven.modrinth:lychee:${lychee_version}")
186+
185187
runtimeOnly fg.deobf("maven.modrinth:jei:${jei_version}")
186188
implementation fg.deobf("maven.modrinth:moonlight:${moonlight_version}")
187189

@@ -205,6 +207,7 @@ dependencies {
205207
implementation fg.deobf("maven.modrinth:overgeared:${overgeared_version}")
206208
implementation fg.deobf("maven.modrinth:no-tree-punching:${notreepunching_version}")
207209
implementation fg.deobf("maven.modrinth:create-ironworks:${create_ironworks_version}")
210+
implementation fg.deobf("maven.modrinth:simply-swords:${simply_swords_version}")
208211
}
209212

210213
tasks.named('processResources', ProcessResources).configure {
@@ -226,6 +229,7 @@ tasks.named('processResources', ProcessResources).configure {
226229
metallurgy_version : metallurgy_version,
227230
overgeared_version : overgeared_version,
228231
create_ironworks_version: create_ironworks_version,
232+
simply_swords_version : simply_swords_version
229233
]
230234

231235
inputs.properties replaceProperties

data/source/simplyswords.pkl

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
amends "./@base.pkl"
2+
3+
import "../utils.pkl" as utils
4+
5+
local const WeaponPatterns = new Mapping<String, Listing<String>> {
6+
["longsword"] {
7+
"/ "
8+
" = "
9+
" ="
10+
}
11+
12+
["twinblade"] {
13+
" ="
14+
" / "
15+
"= "
16+
}
17+
18+
["rapier"] {
19+
" ="
20+
" = "
21+
"/ "
22+
}
23+
24+
["katana"] {
25+
" "
26+
"/=="
27+
" "
28+
}
29+
30+
["sai"] {
31+
" ="
32+
"/ "
33+
}
34+
35+
["spear"] {
36+
" ="
37+
" / "
38+
"/ "
39+
}
40+
41+
["glaive"] {
42+
" ="
43+
" /="
44+
"/ "
45+
}
46+
47+
["warglaive"] {
48+
" * "
49+
"=/="
50+
}
51+
52+
["cutlass"] {
53+
" * "
54+
"== "
55+
"/ "
56+
}
57+
58+
["claymore"] {
59+
" *="
60+
"*=*"
61+
"/* "
62+
}
63+
64+
["greathammer"] {
65+
"==="
66+
"***"
67+
" / "
68+
}
69+
70+
["greataxe"] {
71+
"==="
72+
"*/*"
73+
" / "
74+
}
75+
76+
["chakram"] {
77+
"*=*"
78+
"= ="
79+
"*/*"
80+
}
81+
82+
["scythe"] {
83+
"==/"
84+
"=/ "
85+
"/ "
86+
}
87+
88+
["halberd"] {
89+
" =*"
90+
"=/="
91+
"/ "
92+
}
93+
}
94+
95+
local const Materials = List(
96+
utils.AllMaterials["iron"],
97+
utils.AllMaterials["gold"]
98+
)
99+
100+
recipes {
101+
for (weapon, pat in WeaponPatterns) {
102+
for (material in Materials) {
103+
["\(material.name)_\(weapon)"] {
104+
type = "overgeared:forging"
105+
category = "tools"
106+
hammering = 1 + hammering(pat)
107+
has_polishing = false
108+
has_quality = true
109+
110+
key {
111+
["/"] { item = "minecraft:stick" }
112+
["="] { item = if (material.needsHeat()) material.heated() else material.ingot }
113+
114+
when (has(pat, "*")) {
115+
["*"] { item = material.nugget() }
116+
}
117+
}
118+
119+
minimum_quality = "poor"
120+
need_quenching = false
121+
needs_minigame = true
122+
requires_blueprint = false
123+
pattern = pat
124+
125+
result {
126+
item = "simplyswords:\(material.name)_\(weapon)"
127+
}
128+
}
129+
}
130+
131+
["diamond_\(weapon)"] {
132+
type = "minecraft:smithing_transform"
133+
template { item = "overgeared:diamond_upgrade_smithing_template" }
134+
base { item = "simplyswords:iron_\(weapon)" }
135+
addition { item = "minecraft:diamond" }
136+
result { item = "simplyswords:diamond_\(weapon)" }
137+
}
138+
}
139+
}
140+
141+
local function has(pattern: Listing<String>, search: String): Boolean =
142+
pattern.any((s) -> s.contains(search))
143+
144+
local function hammering(pattern: Listing<String>): Int =
145+
pattern.join("").trim().split("").map((s) -> if (s == "=") 1 else 0).reduce((a, b) -> a + b)

data/source/toolworking.pkl

Lines changed: 40 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import "../utils.pkl" as utils
55
local tools = List("axe", "hoe", "shovel", "pickaxe", "sword", "hammer", "paxel")
66

77
local basicRecipes = new {
8-
for (name, material in utils.Materials) {
8+
for (name, material in utils.AllMaterials) {
99
["forging/\(name)_sheet"] {
1010
type = "overgeared:forging"
1111
category = "misc"
@@ -87,28 +87,36 @@ local basicRecipes = new {
8787
category = "misc"
8888

8989
ingredients {
90-
new { item = "minecraft:water_bucket" }
90+
new {
91+
new { item = "minecraft:water_bucket" }
92+
new { item = "notreepunching:ceramic_water_bucket" }
93+
}
94+
9195
new { item = "minecraft:clay" }
9296
new { item = "minecraft:sand" }
9397
}
9498

9599
result {
96100
item = "createmetallurgy:refractory_mortar"
101+
count = 2
97102
}
98103
}
99104

100-
["refractory_mortar_with_ceramic_bucket"] {
101-
type = "minecraft:crafting_shapeless"
105+
["mixing/refractory_mortar"] = new {
106+
type = "create:mixing"
102107
category = "misc"
103-
108+
heatRequirement = "none"
104109
ingredients {
105-
new { item = "notreepunching:ceramic_water_bucket" }
106110
new { item = "minecraft:clay" }
107-
new { item = "minecraft:sand" }
111+
new { tag = "minecraft:sand" }
112+
new { fluid = "minecraft:water" amount = 250 nbt = new {} }
108113
}
109114

110-
result {
111-
item = "createmetallurgy:refractory_mortar"
115+
results {
116+
new {
117+
item = "createmetallurgy:refractory_mortar"
118+
count = 2
119+
}
112120
}
113121
}
114122

@@ -136,44 +144,6 @@ local basicRecipes = new {
136144
}
137145
}
138146
}
139-
140-
["crafting/processed_clay"] = new {
141-
type = "minecraft:crafting_shapeless"
142-
category = "misc"
143-
ingredients {
144-
new { item = "minecraft:clay" }
145-
new { item = "minecraft:dried_kelp" }
146-
new { tag = "minecraft:sand" }
147-
148-
new {
149-
new { item = "minecraft:water_bucket" }
150-
new { item = "notreepunching:ceramic_water_bucket" }
151-
}
152-
}
153-
154-
result {
155-
item = "toolworking:processed_clay"
156-
}
157-
}
158-
159-
["mixing/processed_clay"] = new {
160-
type = "create:mixing"
161-
category = "misc"
162-
heatRequirement = "none"
163-
ingredients {
164-
new { item = "minecraft:clay" }
165-
new { item = "minecraft:dried_kelp" }
166-
new { tag = "minecraft:sand" }
167-
new { fluid = "minecraft:water" amount = 250 nbt = new {} }
168-
}
169-
170-
results {
171-
new {
172-
item = "toolworking:processed_clay"
173-
count = 2
174-
}
175-
}
176-
}
177147
}
178148

179149
local toolRecipeFromPart = new {
@@ -282,12 +252,20 @@ recipes {
282252

283253
for (tool in tools) {
284254
["mold/\(tool)_mold"] {
285-
type = "minecraft:crafting_shapeless"
255+
type = "minecraft:crafting_shaped"
286256
category = "misc"
287257

288-
ingredients {
289-
new { item = "toolworking:processed_clay" }
290-
new { tag = "toolworking:\(tool)_part" }
258+
when (tool == "axe") { pattern { " ==" " /=" " / " } }
259+
when (tool == "hoe") { pattern { "== " " / " " / " } }
260+
when (tool == "shovel") { pattern { " = " " / " " / " } }
261+
when (tool == "pickaxe") { pattern { "===" " / " " / " } }
262+
when (tool == "sword") { pattern { " = " " = " " / " } }
263+
when (tool == "hammer") { pattern { "===" "=/=" " / " } }
264+
when (tool == "paxel") { pattern { "===" " /=" " / " } }
265+
266+
key {
267+
["="] { item = "createmetallurgy:refractory_mortar" }
268+
["/"] { item = "minecraft:stick" }
291269
}
292270

293271
result {
@@ -297,20 +275,25 @@ recipes {
297275
}
298276

299277
["mold/ingot_mold"] {
300-
type = "minecraft:crafting_shapeless"
278+
type = "lychee:crafting"
301279
category = "misc"
302280

303-
ingredients {
304-
new { item = "toolworking:processed_clay" }
305-
new { tag = "forge:ingots" }
281+
pattern {
282+
" "
283+
" = "
284+
" "
285+
}
286+
287+
key {
288+
["="] { item = "createmetallurgy:refractory_mortar" }
306289
}
307290

308291
result {
309292
item = "toolworking:clay_ingot_mold"
310293
}
311294
}
312295

313-
for (name, material in utils.Materials) {
296+
for (name, material in utils.AllMaterials) {
314297
["casting_in_table/\(name)/ingot"] {
315298
type = "createmetallurgy:casting_in_table"
316299

@@ -364,7 +347,7 @@ tags {
364347
["items/\(tool)_part"] {
365348
replace = false
366349
values {
367-
for (material in utils.Materials.keys.filter((s) -> s != "tin")) {
350+
for (material in utils.AllMaterials.keys.filter((s) -> s != "tin")) {
368351
when (material == "gold") {
369352
"toolworking:golden_\(tool)_part"
370353
} else {

data/utils.pkl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ class Material {
55

66
function source() = ingot.split(":").first
77
function raw() = "\(source()):raw_\(name)"
8+
function nugget() = "\(source()):\(name)_nugget"
89
function molten() = "createmetallurgy:molten_\(name)"
910
function heated() = "overgeared:heated_\(name)_ingot"
1011
function needsHeat() = List("iron", "steel").contains(name)
1112
}
1213

13-
const Materials = new Mapping<String, Material> {
14+
const AllMaterials = new Mapping<String, Material> {
1415
["copper"] = new Material {
1516
name = "copper"
1617
ingot = "minecraft:copper_ingot"

gradle.properties

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ mapping_version=1.20.1
1414
mod_id=toolworking
1515
mod_name=Create Toolworking
1616
mod_license=Apache 2.0
17-
mod_version=0.1.6-ALPHA
17+
mod_version=0.1.7-ALPHA
1818
mod_group_id=dev.jodevnull
1919
mod_authors=jo-devnull
2020
mod_description=Toolmaking is harder and more realistic
@@ -25,6 +25,8 @@ embeddium_version=0.3.31+mc1.20.1
2525
ponder_version = 1.0.80
2626
flywheel_version = 1.0.4
2727
registrate_version = MC1.20-1.3.3
28+
cloth_config_version=11.1.136+forge
29+
lychee_version=5.1.22+forge
2830

2931
emi_version=1.1.22+1.20.1+forge
3032
jei_version=zzpNSbJZ
@@ -37,4 +39,6 @@ create_version = 6.0.6-150
3739
lowheated_version=1.20.1-6.0.6-4
3840
metallurgy_version=0.0.7-HF-1.20.1
3941
overgeared_version=1.4.10
40-
create_ironworks_version=3.5.0
42+
create_ironworks_version=3.5.0
43+
44+
simply_swords_version=1.56.0-1.20.1
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"type": "minecraft:smithing_transform",
3+
"template": {
4+
"item": "overgeared:diamond_upgrade_smithing_template"
5+
},
6+
"base": {
7+
"item": "simplyswords:iron_chakram"
8+
},
9+
"addition": {
10+
"item": "minecraft:diamond"
11+
},
12+
"result": {
13+
"item": "simplyswords:diamond_chakram"
14+
}
15+
}

0 commit comments

Comments
 (0)