Skip to content

Commit

Permalink
Artisan Benches modpack: extract cauldron. Relates to #1798
Browse files Browse the repository at this point in the history
  • Loading branch information
alek13 committed Dec 5, 2024
1 parent 237276d commit 029fb87
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 45 deletions.
4 changes: 3 additions & 1 deletion mods/lord/Blocks/ArtisanBenches/cauldron/init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@


minetest.mod(function(mod)
--require("cauldron").init(mod)
require('cauldron').init(mod)

dofile(mod.path .. '/legacy.lua')
end)
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@ minetest.register_alias('lottpotion:cauldron_two_third_full', 'lord_artisan_benc
minetest.register_alias('lottpotion:cauldron_one_third_full', 'lord_artisan_benches:cauldron_1_3')
minetest.register_alias('lottpotion:cauldron_empty', 'lord_artisan_benches:cauldron_0_3')

minetest.register_alias('lord_artisan_benches:cauldron_3_3', 'cauldron:cauldron_3_3')
minetest.register_alias('lord_artisan_benches:cauldron_2_3', 'cauldron:cauldron_2_3')
minetest.register_alias('lord_artisan_benches:cauldron_1_3', 'cauldron:cauldron_1_3')
minetest.register_alias('lord_artisan_benches:cauldron_0_3', 'cauldron:cauldron_0_3')

-- DEFAULTS (Ghost blocks)
minetest.register_alias('defaults:lottpotion_cauldron_full', 'defaults:lord_artisan_benches_cauldron_3_3')
minetest.register_alias('defaults:lottpotion_cauldron_two_third_full', 'defaults:lord_artisan_benches_cauldron_2_3')
minetest.register_alias('defaults:lottpotion_cauldron_one_third_full', 'defaults:lord_artisan_benches_cauldron_1_3')
minetest.register_alias('defaults:lottpotion_cauldron_empty', 'defaults:lord_artisan_benches_cauldron_0_3')

minetest.register_alias('defaults:lord_artisan_benches_cauldron_3_3', 'defaults:cauldron_cauldron_3_3')
minetest.register_alias('defaults:lord_artisan_benches_cauldron_2_3', 'defaults:cauldron_cauldron_2_3')
minetest.register_alias('defaults:lord_artisan_benches_cauldron_1_3', 'defaults:cauldron_cauldron_1_3')
minetest.register_alias('defaults:lord_artisan_benches_cauldron_0_3', 'defaults:cauldron_cauldron_0_3')
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# textdomain: cauldron

Filled Cauldron=Filled Cauldron
Two Third Filled Cauldron=Two Third Filled Cauldron
One Third Filled Cauldron=One Third Filled Cauldron
Empty Cauldron=Empty Cauldron
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# textdomain: cauldron

Filled Cauldron=Полный котёл
Two Third Filled Cauldron=Котёл, заполненный на 2/3
One Third Filled Cauldron=Котёл, заполненный на 1/3
Empty Cauldron=Пустой котёл
2 changes: 1 addition & 1 deletion mods/lord/Blocks/ArtisanBenches/cauldron/mod.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name = cauldron
depends = builtin
depends = builtin, default
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
local SL = minetest.get_mod_translator()
local S = minetest.get_mod_translator()


local px = 1/16

local common_definition = {
drawtype = "nodebox",
drawtype = 'nodebox',
tiles = {
"benches_cauldron_top.png", "benches_cauldron_side.png", "benches_cauldron_side.png",
"benches_cauldron_side.png", "benches_cauldron_side.png", "benches_cauldron_side.png",
'benches_cauldron_top.png', 'benches_cauldron_side.png', 'benches_cauldron_side.png',
'benches_cauldron_side.png', 'benches_cauldron_side.png', 'benches_cauldron_side.png',
},
use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "facedir",
use_texture_alpha = 'blend',
paramtype = 'light',
paramtype2 = 'facedir',
groups = { cracky = 1 },
node_box = {
type = "fixed",
type = 'fixed',
fixed = {
{ -8*px, -8*px, -8*px, -6*px, 8*px, -6*px },
{ 6*px, -8*px, -8*px, 8*px, 8*px, -6*px },
Expand All @@ -35,62 +35,70 @@ local common_definition = {
local function fill_bottle(player, position, change_to)
local player_inv = player:get_inventory()
local itemstack = player:get_wielded_item()
if itemstack:get_name() == "vessels:glass_bottle" then
if itemstack:get_name() == 'vessels:glass_bottle' then
minetest.set_node(position, { name = change_to })
if player_inv:room_for_item("main", 1) then
if player_inv:room_for_item('main', 1) then
itemstack:take_item(1)
player_inv:add_item("main", "lord_vessels:glass_bottle_water")
player_inv:add_item('main', 'lord_vessels:glass_bottle_water')
end
player:set_wielded_item(itemstack)
end
end

minetest.register_node("lord_artisan_benches:cauldron_3_3", table.merge(common_definition, {
description = SL("Filled Cauldron"),
minetest.register_node('cauldron:cauldron_3_3', table.merge(common_definition, {
description = S('Filled Cauldron'),
node_box = { fixed = { [10] = { -6*px, 4*px, -6*px, 6*px, 5*px, 6*px }, } },
on_punch = function(pos, node, player)
fill_bottle(player, pos, "lord_artisan_benches:cauldron_2_3")
fill_bottle(player, pos, 'cauldron:cauldron_2_3')
end,
}))
minetest.register_node("lord_artisan_benches:cauldron_2_3", table.merge(common_definition, {
description = SL("Two Third Filled Cauldron"),
minetest.register_node('cauldron:cauldron_2_3', table.merge(common_definition, {
description = S('Two Third Filled Cauldron'),
groups = { not_in_creative_inventory = 1 },
node_box = { fixed = { [10] = { -6*px, 1*px, -6*px, 6*px, 2*px, 6*px }, } },
on_punch = function(pos, node, player)
fill_bottle(player, pos, "lord_artisan_benches:cauldron_1_3")
fill_bottle(player, pos, 'cauldron:cauldron_1_3')
end,
}))
minetest.register_node("lord_artisan_benches:cauldron_1_3", table.merge(common_definition, {
description = SL("One Third Filled Cauldron"),
minetest.register_node('cauldron:cauldron_1_3', table.merge(common_definition, {
description = S('One Third Filled Cauldron'),
groups = { not_in_creative_inventory = 1 },
node_box = { fixed = { [10] = { -6*px, -2*px, -6*px, 6*px, -1*px, 6*px }, } },
on_punch = function(pos, node, player)
fill_bottle(player, pos, "lord_artisan_benches:cauldron_0_3")
fill_bottle(player, pos, 'cauldron:cauldron_0_3')
end,
}))

common_definition.tiles = nil
minetest.register_node("lord_artisan_benches:cauldron_0_3", table.merge(common_definition, {
description = SL("Empty Cauldron"),
minetest.register_node('cauldron:cauldron_0_3', table.merge(common_definition, {
description = S('Empty Cauldron'),
tiles = {
"benches_cauldron_top_empty.png", "benches_cauldron_side.png", "benches_cauldron_side.png",
"benches_cauldron_side.png", "benches_cauldron_side.png", "benches_cauldron_side.png",
'benches_cauldron_top_empty.png', 'benches_cauldron_side.png', 'benches_cauldron_side.png',
'benches_cauldron_side.png', 'benches_cauldron_side.png', 'benches_cauldron_side.png',
},
groups = { level = 2 },
node_box = { fixed = { [10] = { -6*px, -2*px, -6*px, 6*px, -4*px, 6*px }, }, },
on_rightclick = function(pos, node, clicker, itemstack)
if itemstack:get_name() == "bucket:bucket_water" then
minetest.set_node(pos, { name = "lord_artisan_benches:cauldron_3_3" })
return { name = "bucket:bucket_empty" }
if itemstack:get_name() == 'bucket:bucket_water' then
minetest.set_node(pos, { name = 'cauldron:cauldron_3_3' })
return { name = 'bucket:bucket_empty' }
end
end
}))

minetest.register_craft({
output = 'lord_artisan_benches:cauldron_0_3',
output = 'cauldron:cauldron_0_3',
recipe = {
{ 'default:steel_ingot', '', 'default:steel_ingot' },
{ 'default:steel_ingot', '', 'default:steel_ingot' },
{ 'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot' },
}
})


return {
--- @param mod minetest.Mod
init = function(mod)
-- all things done upper
end,
}
2 changes: 0 additions & 2 deletions mods/lord/Blocks/lord_artisan_benches/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

minetest.mod(function(mod)
require('artisan_benches').init()

dofile(mod.path..'/legacy.lua')
end)
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ Ingredients:=Ingredients:
Result:=Result:


### Cauldron ###
Filled Cauldron=Filled Cauldron
Two Third Filled Cauldron=Two Third Filled Cauldron
One Third Filled Cauldron=One Third Filled Cauldron
Empty Cauldron=Empty Cauldron

### Barrel ###
Barrel=Barrel

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ Ingredients:=Ингредиенты:
Result:=Результат:


### Cauldron ###
Filled Cauldron=Полный котёл
Two Third Filled Cauldron=Котёл, заполненный на 2/3
One Third Filled Cauldron=Котёл, заполненный на 1/3
Empty Cauldron=Пустой котёл

### Barrel ###
Barrel=Бочка

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ return {
--- @param mod minetest.Mod
init = function(mod)
require('artisan_benches.barrel')
require('artisan_benches.cauldron')
require('artisan_benches.laboratory')
end
}

0 comments on commit 029fb87

Please sign in to comment.