Skip to content

Commit

Permalink
archex compat ig
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver-makes-code committed Jul 13, 2023
1 parent e423da6 commit df7ae03
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 4 deletions.
12 changes: 9 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ archivesBaseName = project.archives_base_name
version = "${project.version}+${libs.versions.minecraft.get()}"
group = project.maven_group

def test_compat = false
def test_compat = true

repositories {
maven {
Expand Down Expand Up @@ -42,7 +42,9 @@ dependencies {
modImplementation include("com.github.glitchfiend:TerraBlender-fabric:1.20.1-3.0.0.167")

if (test_compat) {
modRuntimeOnly "maven.modrinth:arch-ex:2.1.0+1.19"
modRuntimeOnly "maven.modrinth:arch-ex:CjW2XopS"
modImplementation "maven.modrinth:static-data:1.0.1+1.20"
modImplementation "maven.modrinth:suspicious-shapes:1.0.0+1.20.1"
}
}

Expand Down Expand Up @@ -70,6 +72,10 @@ def loot(String input, String output) {
generate("loot", input, output)
}

def archex(String output) {
generate("archex", output)
}

tasks.register("generateData") {
doFirst {
generate("lang", "assets/wwizardry/lang")
Expand All @@ -79,7 +85,7 @@ tasks.register("generateData") {
transpile("loot", "data/wwizardry/loot_tables")
transpile("world", "data/wwizardry/worldgen")
transpile("mod", "")
// transpile("archex", "staticdata/architecture_extensions")
archex("staticdata/architecture_extensions")
}
}

Expand Down
3 changes: 3 additions & 0 deletions data/archex/basalt_bricks.fennec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind = "brick"
id = "wwizardry:basalt_bricks"
color = "gray"
3 changes: 3 additions & 0 deletions data/archex/basalt_tiles.fennec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind = "brick"
id = "wwizardry:basalt_tiles"
color = "gray"
3 changes: 3 additions & 0 deletions data/archex/chiseled_basalt.fennec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind = "brick"
id = "wwizardry:chiseled_basalt"
color = "gray"
4 changes: 4 additions & 0 deletions data/archex/denia.fennec
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kind = "wood"
name = "denia"
id = "wwizardry:denia_log"
color = "ice"
5 changes: 5 additions & 0 deletions data/archex/mycha.fennec
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind = "wood"
name = "mycha"
id = "wwizardry:mycha_stem"
color = "purple"
-stem
8 changes: 8 additions & 0 deletions data/lang/en_us.fennec
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,11 @@
denia = "Denia"
mycha = "Mycha"
}

"architecture_extensions.grouped_block" {
denia = "Denia"
mycha = "Mycha"
basalt_bricks = "Basalt Bricks"
basalt_tiles = "Basalt Tiles"
chiseled_basalt = "Chiseled Basalt"
}
74 changes: 74 additions & 0 deletions scripts/command/archex.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import fennec from "https://oliver-makes-code.github.io/FennecConfig/impl/typescript/mod.ts"
import { getAllFiles } from "./common.ts"

type ArchExFennec = {
kind: "brick"|"wood"
name?: string
id: string
color: string
stem?: boolean
}

type ArchExJson = {
name?: string
base_block: string
textures: string
recipes: string
map_color: string
types_to_generate: string[]
}

export default function generateArchEx(inputDir: string, outputDir: string) {
for (const file of getAllFiles(inputDir, outputDir)) {
const inputFile = inputDir+"/"+file+".fennec"
const outputFile = outputDir+"/"+file+".json"

const read = fennecToJson(fennec.parse(Deno.readTextFileSync(inputFile)))
Deno.writeTextFileSync(outputFile, JSON.stringify(read))

console.log(inputFile + " -> " + outputFile)
}
}

function fennecToJson(fennec: ArchExFennec): ArchExJson {
if (fennec.kind == "brick") {
return {
name: fennec.name,
base_block: fennec.id,
textures: fennec.id.replace(":", ":block/"),
recipes: "stonecutting",
map_color: fennec.color,
types_to_generate: [
"arch",
"octagonal_column",
"round_arch",
"roof",
"wall_column",
"wall_post",
"facade",
"rod",
]
}
}
return {
name: fennec.name,
base_block: fennec.id,
textures: fennec.stem ? "wood_with_stem" : "wood_with_log",
recipes: "sawing",
map_color: fennec.color,
types_to_generate: [
"facade",
"round_fence_post",
"round_arch",
"octagonal_column",
"beam",
"fence_post",
"joist",
"crown_molding",
"post_cap",
"post_lantern",
"lattice",
"transom",
]
}
}
6 changes: 6 additions & 0 deletions scripts/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import generateLang from "./command/lang.ts";
import genericTranspile from "./command/transpile.ts";
import generateTags from "./command/tags.ts";
import loot from "./command/loot.ts";
import generateArchEx from "./command/archex.ts"

const cli = new CLI();

Expand All @@ -26,6 +27,11 @@ cli.register(
args: [literal("loot"), named(Builtin.STRING, "Input"), named(Builtin.STRING, "Output")],
call: loot,
description: "Generates simple loot tables for a list of blocks"
},
{
args: [literal("archex"), named(Builtin.STRING, "Input"), named(Builtin.STRING, "Output")],
call: generateArchEx,
description: "Generates arch-ex staticdata"
}
)

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/wwizardry/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"itemGroup.wwizardry.items":"Wandering Wizardry Items","block.wwizardry.rose_quartz_ore":"Rose Quartz Ore","block.wwizardry.deepslate_rose_quartz_ore":"Deepslate Rose Quartz Ore","block.wwizardry.rose_quartz_block":"Block Of Rose Quartz","block.wwizardry.crystalline_sculk_block":"Crystalline Sculk Block","block.wwizardry.reinforced_glass":"Reinforced Glass","block.wwizardry.reinforced_glass_pane":"Reinforced Glass Pane","block.wwizardry.sculk_resonator":"Resonating Sculk Shrieker","block.wwizardry.camera":"Camera","block.wwizardry.redstone_lantern":"Redstone Lantern","block.wwizardry.wall_holder":"Wall Holder","block.wwizardry.modulo_comparator":"Modulo Comparator","block.wwizardry.redstone_stepper":"Redstone Stepper","block.wwizardry.sculkflower":"Sculkflower","block.wwizardry.indigo_caeruleum":"Indigo Caeruleum","block.wwizardry.mycelial_sand":"Mycelial Sand","block.wwizardry.altar_pedestal":"Altar Pedestal","block.wwizardry.altar_catalyzer":"Altar Catalyzer","block.wwizardry.stripped_denia_log":"Stripped Denia Log","block.wwizardry.denia_log":"Denia Log","block.wwizardry.stripped_denia_wood":"Stripped Denia Wood","block.wwizardry.denia_wood":"Denia Wood","block.wwizardry.denia_planks":"Denia Planks","block.wwizardry.denia_stairs":"Denia Stairs","block.wwizardry.denia_slab":"Denia Slab","block.wwizardry.denia_button":"Denia Button","block.wwizardry.denia_pressure_plate":"Denia Pressure Plate","block.wwizardry.denia_door":"Denia Door","block.wwizardry.denia_trapdoor":"Denia Trapdoor","block.wwizardry.denia_sign":"Denia Sign","block.wwizardry.denia_hanging_sign":"Denia Hanging Sign","block.wwizardry.denia_fence":"Denia Fence","block.wwizardry.denia_fence_gate":"Denia Fence Gate","block.wwizardry.denia_leaves":"Denia Leaves","block.wwizardry.denia_sapling":"Denia Sapling","block.wwizardry.denia_boat":"Denia Boat","block.wwizardry.denia_chest_boat":"Denia Boat With Chest","block.wwizardry.stripped_mycha_stem":"Stripped Mycha Stem","block.wwizardry.mycha_stem":"Mycha Stem","block.wwizardry.stripped_mycha_hyphae":"Stripped Mycha Hyphae","block.wwizardry.mycha_hyphae":"Mycha Hyphae","block.wwizardry.mycha_planks":"Mycha Planks","block.wwizardry.mycha_stairs":"Mycha Stairs","block.wwizardry.mycha_slab":"Mycha Slab","block.wwizardry.mycha_button":"Mycha Button","block.wwizardry.mycha_pressure_plate":"Mycha Pressure Plate","block.wwizardry.mycha_door":"Mycha Door","block.wwizardry.mycha_trapdoor":"Mycha Trapdoor","block.wwizardry.mycha_sign":"Mycha Sign","block.wwizardry.mycha_hanging_sign":"Mycha Hanging Sign","block.wwizardry.mycha_fence":"Mycha Fence","block.wwizardry.mycha_fence_gate":"Mycha Fence Gate","block.wwizardry.mycha_wart":"Mycha Wart","block.wwizardry.mycha_fungus":"Mycha Fungus","block.wwizardry.chiseled_basalt":"Chiseled Basalt","block.wwizardry.chiseled_basalt_stairs":"Chiseled Basalt Stairs","block.wwizardry.chiseled_basalt_slab":"Chiseled Basalt Slab","block.wwizardry.chiseled_basalt_wall":"Chiseled Basalt Wall","block.wwizardry.basalt_bricks":"Basalt Bricks","block.wwizardry.basalt_brick_stairs":"Basalt Brick Stairs","block.wwizardry.basalt_brick_slab":"Basalt Brick Slab","block.wwizardry.basalt_brick_wall":"Basalt Brick Wall","block.wwizardry.basalt_tiles":"Basalt Tiles","block.wwizardry.basalt_tile_stairs":"Basalt Tile Stairs","block.wwizardry.basalt_tile_slab":"Basalt Tile Slab","block.wwizardry.basalt_tile_wall":"Basalt Tile Wall","item.wwizardry.crystalline_sculk":"Crystalline Sculk","item.wwizardry.rose_quartz":"Rose Quartz","item.wwizardry.denia_boat":"Denia Boat","item.wwizardry.denia_chest_boat":"Denia Boat with Chest","aurorasdeco.wood_type.wwizardry.denia":"Denia","aurorasdeco.wood_type.wwizardry.mycha":"Mycha"}
{"itemGroup.wwizardry.items":"Wandering Wizardry Items","block.wwizardry.rose_quartz_ore":"Rose Quartz Ore","block.wwizardry.deepslate_rose_quartz_ore":"Deepslate Rose Quartz Ore","block.wwizardry.rose_quartz_block":"Block Of Rose Quartz","block.wwizardry.crystalline_sculk_block":"Crystalline Sculk Block","block.wwizardry.reinforced_glass":"Reinforced Glass","block.wwizardry.reinforced_glass_pane":"Reinforced Glass Pane","block.wwizardry.sculk_resonator":"Resonating Sculk Shrieker","block.wwizardry.camera":"Camera","block.wwizardry.redstone_lantern":"Redstone Lantern","block.wwizardry.wall_holder":"Wall Holder","block.wwizardry.modulo_comparator":"Modulo Comparator","block.wwizardry.redstone_stepper":"Redstone Stepper","block.wwizardry.sculkflower":"Sculkflower","block.wwizardry.indigo_caeruleum":"Indigo Caeruleum","block.wwizardry.mycelial_sand":"Mycelial Sand","block.wwizardry.altar_pedestal":"Altar Pedestal","block.wwizardry.altar_catalyzer":"Altar Catalyzer","block.wwizardry.stripped_denia_log":"Stripped Denia Log","block.wwizardry.denia_log":"Denia Log","block.wwizardry.stripped_denia_wood":"Stripped Denia Wood","block.wwizardry.denia_wood":"Denia Wood","block.wwizardry.denia_planks":"Denia Planks","block.wwizardry.denia_stairs":"Denia Stairs","block.wwizardry.denia_slab":"Denia Slab","block.wwizardry.denia_button":"Denia Button","block.wwizardry.denia_pressure_plate":"Denia Pressure Plate","block.wwizardry.denia_door":"Denia Door","block.wwizardry.denia_trapdoor":"Denia Trapdoor","block.wwizardry.denia_sign":"Denia Sign","block.wwizardry.denia_hanging_sign":"Denia Hanging Sign","block.wwizardry.denia_fence":"Denia Fence","block.wwizardry.denia_fence_gate":"Denia Fence Gate","block.wwizardry.denia_leaves":"Denia Leaves","block.wwizardry.denia_sapling":"Denia Sapling","block.wwizardry.denia_boat":"Denia Boat","block.wwizardry.denia_chest_boat":"Denia Boat With Chest","block.wwizardry.stripped_mycha_stem":"Stripped Mycha Stem","block.wwizardry.mycha_stem":"Mycha Stem","block.wwizardry.stripped_mycha_hyphae":"Stripped Mycha Hyphae","block.wwizardry.mycha_hyphae":"Mycha Hyphae","block.wwizardry.mycha_planks":"Mycha Planks","block.wwizardry.mycha_stairs":"Mycha Stairs","block.wwizardry.mycha_slab":"Mycha Slab","block.wwizardry.mycha_button":"Mycha Button","block.wwizardry.mycha_pressure_plate":"Mycha Pressure Plate","block.wwizardry.mycha_door":"Mycha Door","block.wwizardry.mycha_trapdoor":"Mycha Trapdoor","block.wwizardry.mycha_sign":"Mycha Sign","block.wwizardry.mycha_hanging_sign":"Mycha Hanging Sign","block.wwizardry.mycha_fence":"Mycha Fence","block.wwizardry.mycha_fence_gate":"Mycha Fence Gate","block.wwizardry.mycha_wart":"Mycha Wart","block.wwizardry.mycha_fungus":"Mycha Fungus","block.wwizardry.chiseled_basalt":"Chiseled Basalt","block.wwizardry.chiseled_basalt_stairs":"Chiseled Basalt Stairs","block.wwizardry.chiseled_basalt_slab":"Chiseled Basalt Slab","block.wwizardry.chiseled_basalt_wall":"Chiseled Basalt Wall","block.wwizardry.basalt_bricks":"Basalt Bricks","block.wwizardry.basalt_brick_stairs":"Basalt Brick Stairs","block.wwizardry.basalt_brick_slab":"Basalt Brick Slab","block.wwizardry.basalt_brick_wall":"Basalt Brick Wall","block.wwizardry.basalt_tiles":"Basalt Tiles","block.wwizardry.basalt_tile_stairs":"Basalt Tile Stairs","block.wwizardry.basalt_tile_slab":"Basalt Tile Slab","block.wwizardry.basalt_tile_wall":"Basalt Tile Wall","item.wwizardry.crystalline_sculk":"Crystalline Sculk","item.wwizardry.rose_quartz":"Rose Quartz","item.wwizardry.denia_boat":"Denia Boat","item.wwizardry.denia_chest_boat":"Denia Boat with Chest","aurorasdeco.wood_type.wwizardry.denia":"Denia","aurorasdeco.wood_type.wwizardry.mycha":"Mycha","architecture_extensions.grouped_block.denia":"Denia","architecture_extensions.grouped_block.mycha":"Mycha","architecture_extensions.grouped_block.basalt_bricks":"Basalt Bricks","architecture_extensions.grouped_block.basalt_tiles":"Basalt Tiles","architecture_extensions.grouped_block.chiseled_basalt":"Chiseled Basalt"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"base_block":"wwizardry:basalt_bricks","textures":"wwizardry:block/basalt_bricks","recipes":"stonecutting","map_color":"gray","types_to_generate":["arch","octagonal_column","round_arch","roof","wall_column","wall_post","facade","rod"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"base_block":"wwizardry:basalt_tiles","textures":"wwizardry:block/basalt_tiles","recipes":"stonecutting","map_color":"gray","types_to_generate":["arch","octagonal_column","round_arch","roof","wall_column","wall_post","facade","rod"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"base_block":"wwizardry:chiseled_basalt","textures":"wwizardry:block/chiseled_basalt","recipes":"stonecutting","map_color":"gray","types_to_generate":["arch","octagonal_column","round_arch","roof","wall_column","wall_post","facade","rod"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"denia","base_block":"wwizardry:denia_log","textures":"wood_with_log","recipes":"sawing","map_color":"ice","types_to_generate":["facade","round_fence_post","round_arch","octagonal_column","beam","fence_post","joist","crown_molding","post_cap","post_lantern","lattice","transom"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"mycha","base_block":"wwizardry:mycha_stem","textures":"wood_with_stem","recipes":"sawing","map_color":"purple","types_to_generate":["facade","round_fence_post","round_arch","octagonal_column","beam","fence_post","joist","crown_molding","post_cap","post_lantern","lattice","transom"]}

0 comments on commit df7ae03

Please sign in to comment.