123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- local stone_carving_table_functions = simplecrafting_lib.generate_table_functions('stone_carving', {
- show_guides = true,
- alphabetize_items = true,}
- )
- local stone_carving_table_def = {
- description = 'Stone Carving',
- drawtype = 'mesh',
- mesh = 'stations_stone_carving.obj',
- tiles = {'stations_stone_carving.png'},
- use_texture_alpha = 'opaque',
- sounds = default.node_sound_wood_defaults(),
- paramtype2 = 'facedir',
- paramtype = 'light',
- selection_box = {
- type = 'fixed',
- fixed = {-.4, -.5, -.4, .4, 1.25, .4},
- },
- collision_box = {
- type = 'fixed',
- fixed = {-.4, -.5, -.4, .4, 1.25, .4},
- },
- groups = {oddly_breakable_by_hand = 1, cracky=3},
- after_place_node = function(pos, placer, itemstack)
- if not epic.space_on_top(pos) then
- minetest.remove_node(pos)
- return itemstack
- end
- local meta = minetest.get_meta(pos)
- meta:set_string('infotext', 'Stone Carving')
- end,
- after_dig_node = function(pos, oldnode, oldmetadata, digger)
- epic.remove_top_node(pos, oldnode)
- end,
- }
- for k, v in pairs(stone_carving_table_functions) do
- stone_carving_table_def[k] = v
- end
- minetest.register_node('stations:stone_carving', stone_carving_table_def)
- local stone_carving_locked_functions = simplecrafting_lib.generate_table_functions('stone_carving', {
- show_guides = true,
- alphabetize_items = true,
- protect_inventory = true,}
- )
- local stone_carving_locked_def = {
- description = 'Stone Carving (locked)',
- drawtype = 'mesh',
- mesh = 'stations_stone_carving.obj',
- tiles = {'stations_stone_carving.png'},
- use_texture_alpha = 'opaque',
- sounds = default.node_sound_wood_defaults(),
- paramtype2 = 'facedir',
- paramtype = 'light',
- selection_box = {
- type = 'fixed',
- fixed = {-.4, -.5, -.4, .4, 1.25, .4},
- },
- collision_box = {
- type = 'fixed',
- fixed = {-.4, -.5, -.4, .4, 1.25, .4},
- },
- groups = {oddly_breakable_by_hand = 1, cracky=3},
- after_place_node = function(pos, placer, itemstack)
- if not epic.space_on_top(pos) then
- minetest.remove_node(pos)
- return itemstack
- end
- local meta = minetest.get_meta(pos)
- meta:set_string('infotext', 'Stone Carving (Locked)')
- end,
- after_dig_node = function(pos, oldnode, oldmetadata, digger)
- epic.remove_top_node(pos, oldnode)
- end,
- }
- for k, v in pairs(stone_carving_locked_functions) do
- stone_carving_locked_def[k] = v
- end
- minetest.register_node('stations:stone_carving_locked', stone_carving_locked_def)
- local is_uninv = minetest.global_exists("unified_inventory") or false
- if is_uninv then
- unified_inventory.register_craft_type("stone_carving", {
- description = "Stone Carving",
- icon = 'stations_stone_carving_icon.png',
- width = 4,
- height = 2,
- uses_crafting_grid = false
- })
- end
|