1
0
mirror of https://github.com/Sokomine/cottages.git synced 2025-07-16 14:40:25 +02:00

refactor, cleanup, API, bugfixes (#1)

This commit is contained in:
fluxionary
2022-10-09 14:13:47 -07:00
committed by flux
parent dbe69bcfaf
commit 846308ef5a
106 changed files with 5594 additions and 4596 deletions

77
resources/craftitems.lua Normal file
View File

@ -0,0 +1,77 @@
local has = cottages.has
local resolve_item = futil.resolve_item
local ci = {}
ci.stick = "group:stick"
ci.wood = "group:wood"
ci.tree = "group:tree"
if has.default then
ci.chest_locked = resolve_item("default:chest_locked")
ci.clay_brick = resolve_item("default:clay_brick")
ci.clay = resolve_item("default:clay")
ci.coal_lump = resolve_item("default:coal_lump")
ci.dirt = resolve_item("default:dirt")
ci.fence = resolve_item("default:fence_wood")
ci.glass = resolve_item("default:glass")
ci.iron = resolve_item("default:iron_lump")
ci.junglewood = resolve_item("default:junglewood")
ci.ladder = resolve_item("default:ladder")
ci.paper = resolve_item("default:paper")
ci.papyrus = resolve_item("default:papyrus")
ci.rail = resolve_item("default:rail")
ci.sand = resolve_item("default:sand")
ci.steel = resolve_item("default:steel_ingot")
ci.stone = resolve_item("default:stone")
end
if has.bucket then
ci.bucket = resolve_item("bucket:bucket_empty")
ci.bucket_filled = resolve_item("bucket:bucket_river_water")
end
if has.carts then
ci.rail = resolve_item("carts:rail")
end
if has.doors then
ci.door = resolve_item("doors:door_wood")
end
if has.farming then
ci.barley = resolve_item("farming:barley")
ci.cotton = resolve_item("farming:cotton")
ci.flour = resolve_item("farming:flour")
ci.oat = resolve_item("farming:oat")
ci.rice = resolve_item("farming:rice")
ci.rice_flour = resolve_item("farming:rice_flour")
ci.rye = resolve_item("farming:rye")
ci.seed_barley = resolve_item("farming:seed_barley")
ci.seed_oat = resolve_item("farming:seed_oat")
ci.seed_rye = resolve_item("farming:seed_rye")
ci.seed_wheat = resolve_item("farming:seed_wheat")
ci.string = resolve_item("farming:string")
ci.wheat = resolve_item("farming:wheat")
end
if has.stairsplus and has.default then
ci.slab_wood = resolve_item("default:slab_wood_8")
elseif has.moreblocks and resolve_item("moreblocks:slab_wood") then
ci.slab_wood = resolve_item("moreblocks:slab_wood")
elseif has.stairs then
ci.slab_wood = resolve_item("stairs:slab_wood")
end
if has.wool then
ci.wool = resolve_item("wool:white")
else
ci.wool = "cottages:wool"
end
ci.straw_mat = "cottages:straw_mat"
cottages.craftitems = ci

3
resources/init.lua Normal file
View File

@ -0,0 +1,3 @@
cottages.dofile("resources", "craftitems")
cottages.dofile("resources", "sounds")
cottages.dofile("resources", "textures")

28
resources/sounds.lua Normal file
View File

@ -0,0 +1,28 @@
local has = cottages.has
local sounds = {}
if has.default then
sounds.wood = default.node_sound_wood_defaults()
sounds.dirt = default.node_sound_dirt_defaults()
sounds.stone = default.node_sound_stone_defaults()
sounds.leaves = default.node_sound_leaves_defaults()
sounds.metal = default.node_sound_metal_defaults()
sounds.water_empty = "default_water_footstep"
sounds.water_fill = "default_water_footstep"
sounds.tool_breaks = "default_tool_breaks"
sounds.use_thresher = "default_grass_footstep"
sounds.use_quern = "default_gravel_footstep"
end
if has.env_sounds then
sounds.water_empty = sounds.water_empty or "env_sounds_water"
sounds.water_fill = "env_sounds_water"
sounds.lava_fill = "env_sounds_lava"
sounds.lava_empty = "env_sounds_lava"
end
cottages.sounds = sounds

36
resources/textures.lua Normal file
View File

@ -0,0 +1,36 @@
local has = cottages.has
local check_exists = futil.check_exists
local textures = {}
if has.default then
textures.furniture = "default_wood.png"
textures.roof_sides = "default_wood.png"
textures.stick = "default_stick.png"
textures.roof_wood = "default_tree.png"
textures.tree = "default_tree.png"
textures.tree_top = "default_tree_top.png"
textures.dust = "default_item_smoke.png"
else
textures.furniture = "cottages_minimal_wood.png"
textures.roof_sides = "cottages_minimal_wood.png"
textures.stick = "cottages_minimal_wood.png"
textures.roof_wood = "cottages_minimal_wood.png"
textures.tree = "cottages_minimal_wood.png"
textures.tree_top = "cottages_minimal_wood.png"
end
textures.straw = "cottages_darkage_straw.png"
if has.farming then
textures.wheat_seed = "farming_wheat_seed.png"
textures.wheat = "farming_wheat.png"
if cottages.settings.roof.use_farming_straw_stairs and check_exists("farming:straw") then
textures.straw = "farming_straw.png"
end
end
cottages.textures = textures