2016-07-24 13:18:42 +02:00
|
|
|
local settings = Settings(minetest.get_modpath("quartz").."/settings.txt")
|
2013-11-16 23:11:09 +01:00
|
|
|
|
2017-03-01 03:05:46 +01:00
|
|
|
-- internationalization boilerplate
|
|
|
|
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
|
|
local S, NS = dofile(MP.."/intllib.lua")
|
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
--
|
|
|
|
-- Item Registration
|
|
|
|
--
|
2013-05-15 17:50:35 +02:00
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
-- Quartz Crystal
|
2013-05-15 17:50:35 +02:00
|
|
|
minetest.register_craftitem("quartz:quartz_crystal", {
|
2017-03-01 03:05:46 +01:00
|
|
|
description = S("Quartz Crystal"),
|
2013-05-15 17:50:35 +02:00
|
|
|
inventory_image = "quartz_crystal_full.png",
|
|
|
|
})
|
2013-06-09 16:01:25 +02:00
|
|
|
minetest.register_craftitem("quartz:quartz_crystal_piece", {
|
2017-03-01 03:05:46 +01:00
|
|
|
description = S("Quartz Crystal Piece"),
|
2013-06-09 16:01:25 +02:00
|
|
|
inventory_image = "quartz_crystal_piece.png",
|
|
|
|
})
|
2013-05-15 17:50:35 +02:00
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
--
|
|
|
|
-- Node Registration
|
|
|
|
--
|
|
|
|
|
|
|
|
-- Ore
|
2013-05-15 17:50:35 +02:00
|
|
|
minetest.register_node("quartz:quartz_ore", {
|
2017-03-01 03:05:46 +01:00
|
|
|
description = S("Quartz Ore"),
|
2016-01-09 18:52:10 +01:00
|
|
|
tiles = {"default_stone.png^quartz_ore.png"},
|
|
|
|
groups = {cracky=3, stone=1},
|
|
|
|
drop = 'quartz:quartz_crystal',
|
|
|
|
sounds = default.node_sound_stone_defaults(),
|
2013-05-15 17:50:35 +02:00
|
|
|
})
|
2016-01-09 18:52:10 +01:00
|
|
|
|
2013-05-15 17:50:35 +02:00
|
|
|
minetest.register_ore({
|
2016-01-09 18:52:10 +01:00
|
|
|
ore_type = "scatter",
|
|
|
|
ore = "quartz:quartz_ore",
|
|
|
|
wherein = "default:stone",
|
|
|
|
clust_scarcity = 10*10*10,
|
|
|
|
clust_num_ores = 6,
|
|
|
|
clust_size = 5,
|
|
|
|
y_min = -31000,
|
|
|
|
y_max = -5,
|
2013-05-15 17:50:35 +02:00
|
|
|
})
|
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
-- Quartz Block
|
2013-05-15 17:50:35 +02:00
|
|
|
minetest.register_node("quartz:block", {
|
2017-03-01 03:05:46 +01:00
|
|
|
description = S("Quartz Block"),
|
2013-05-15 17:50:35 +02:00
|
|
|
tiles = {"quartz_block.png"},
|
2013-06-19 14:40:17 +02:00
|
|
|
groups = {cracky=3, oddly_breakable_by_hand=1},
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
2013-05-15 17:50:35 +02:00
|
|
|
})
|
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
-- Chiseled Quartz
|
2013-05-15 17:50:35 +02:00
|
|
|
minetest.register_node("quartz:chiseled", {
|
2017-03-01 03:05:46 +01:00
|
|
|
description = S("Chiseled Quartz"),
|
2013-05-15 17:50:35 +02:00
|
|
|
tiles = {"quartz_chiseled.png"},
|
2013-06-19 14:40:17 +02:00
|
|
|
groups = {cracky=3, oddly_breakable_by_hand=1},
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
2013-05-15 17:50:35 +02:00
|
|
|
})
|
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
-- Quartz Pillar
|
2013-05-15 17:50:35 +02:00
|
|
|
minetest.register_node("quartz:pillar", {
|
2017-03-01 03:05:46 +01:00
|
|
|
description = S("Quartz Pillar"),
|
2013-11-08 22:16:46 +01:00
|
|
|
paramtype2 = "facedir",
|
2019-03-01 05:13:58 +01:00
|
|
|
tiles = {"quartz_pillar_top.png", "quartz_pillar_top.png",
|
|
|
|
"quartz_pillar_side.png"},
|
2013-06-19 14:40:17 +02:00
|
|
|
groups = {cracky=3, oddly_breakable_by_hand=1},
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
2013-11-08 22:16:46 +01:00
|
|
|
on_place = minetest.rotate_node
|
2013-05-15 17:50:35 +02:00
|
|
|
})
|
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
-- Stairs & Slabs
|
2013-05-15 17:50:35 +02:00
|
|
|
stairs.register_stair_and_slab("quartzblock", "quartz:block",
|
2013-06-19 14:40:17 +02:00
|
|
|
{cracky=3, oddly_breakable_by_hand=1},
|
2013-05-15 17:50:35 +02:00
|
|
|
{"quartz_block.png"},
|
2017-03-01 03:05:46 +01:00
|
|
|
S("Quartz stair"),
|
|
|
|
S("Quartz slab"),
|
2013-06-19 14:40:17 +02:00
|
|
|
default.node_sound_glass_defaults())
|
2013-05-15 17:50:35 +02:00
|
|
|
|
2017-03-01 03:05:46 +01:00
|
|
|
stairs.register_stair_and_slab("quartzstair", "quartz:pillar",
|
2013-06-19 14:40:17 +02:00
|
|
|
{cracky=3, oddly_breakable_by_hand=1},
|
2019-03-01 05:13:58 +01:00
|
|
|
{"quartz_pillar_top.png", "quartz_pillar_top.png",
|
|
|
|
"quartz_pillar_side.png"},
|
2017-03-01 03:05:46 +01:00
|
|
|
S("Quartz Pillar stair"),
|
|
|
|
S("Quartz Pillar slab"),
|
2016-01-09 18:52:10 +01:00
|
|
|
default.node_sound_glass_defaults())
|
2013-05-15 17:50:35 +02:00
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
--
|
|
|
|
-- Crafting
|
|
|
|
--
|
2013-05-15 17:50:35 +02:00
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
-- Quartz Crystal Piece
|
2013-06-09 16:01:25 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
output = '"quartz:quartz_crystal_piece" 3',
|
|
|
|
recipe = {
|
|
|
|
{'quartz:quartz_crystal'}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
-- Quartz Block
|
2013-05-15 17:50:35 +02:00
|
|
|
minetest.register_craft({
|
2013-11-15 22:51:44 +01:00
|
|
|
output = '"quartz:block" 4',
|
2013-05-15 17:50:35 +02:00
|
|
|
recipe = {
|
|
|
|
{'quartz:quartz_crystal', 'quartz:quartz_crystal', ''},
|
|
|
|
{'quartz:quartz_crystal', 'quartz:quartz_crystal', ''},
|
|
|
|
{'', '', ''}
|
|
|
|
}
|
|
|
|
})
|
2016-01-09 18:52:10 +01:00
|
|
|
|
|
|
|
-- Chiseled Quartz
|
2013-05-15 17:50:35 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
output = 'quartz:chiseled 2',
|
|
|
|
recipe = {
|
|
|
|
{'stairs:slab_quartzblock', '', ''},
|
|
|
|
{'stairs:slab_quartzblock', '', ''},
|
|
|
|
{'', '', ''},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
-- Chiseled Quartz (for stairsplus)
|
2013-11-17 00:08:33 +01:00
|
|
|
minetest.register_craft({
|
|
|
|
output = 'quartz:chiseled 2',
|
|
|
|
recipe = {
|
|
|
|
{'quartz:slab_block', '', ''},
|
|
|
|
{'quartz:slab_block', '', ''},
|
|
|
|
{'', '', ''},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
-- Quartz Pillar
|
2013-05-15 17:50:35 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
output = 'quartz:pillar 2',
|
|
|
|
recipe = {
|
|
|
|
{'quartz:block', '', ''},
|
|
|
|
{'quartz:block', '', ''},
|
|
|
|
{'', '', ''},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
--
|
|
|
|
-- ABMS
|
|
|
|
--
|
|
|
|
|
|
|
|
local dirs2 = {12, 9, 18, 7, 12}
|
2013-11-15 22:51:44 +01:00
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
-- Replace all instances of the horizontal quartz pillar with the
|
2013-11-15 22:51:44 +01:00
|
|
|
minetest.register_abm({
|
2016-01-09 18:52:10 +01:00
|
|
|
nodenames = {"quartz:pillar_horizontal"},
|
2013-11-15 22:51:44 +01:00
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
local fdir = node.param2 or 0
|
|
|
|
nfdir = dirs2[fdir+1]
|
|
|
|
minetest.add_node(pos, {name = "quartz:pillar", param2 = nfdir})
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
2016-01-09 18:52:10 +01:00
|
|
|
--
|
|
|
|
-- Compatibility with stairsplus
|
|
|
|
--
|
|
|
|
|
2019-03-01 05:12:55 +01:00
|
|
|
if minetest.global_exists("stairsplus") then
|
|
|
|
stairsplus:register_all("quartz", "block", "quartz:block", {
|
|
|
|
description = "Quartz Block",
|
|
|
|
tiles = {"quartz_block.png"},
|
|
|
|
groups = {cracky=3},
|
|
|
|
sounds = default.node_sound_glass_defaults()
|
|
|
|
})
|
|
|
|
|
|
|
|
stairsplus:register_all("quartz", "chiseled", "quartz:chiseled", {
|
|
|
|
description = "Chiseled Quartz",
|
|
|
|
tiles = {"quartz_chiseled.png"},
|
|
|
|
groups = {cracky=3},
|
|
|
|
sounds = default.node_sound_glass_defaults()
|
|
|
|
})
|
|
|
|
|
|
|
|
stairsplus:register_all("quartz", "pillar", "quartz:pillar", {
|
|
|
|
description = "Quartz Pillar",
|
2019-03-01 05:13:58 +01:00
|
|
|
tiles = {"quartz_pillar_top.png", "quartz_pillar_top.png",
|
|
|
|
"quartz_pillar_side.png"},
|
2019-03-01 05:12:55 +01:00
|
|
|
groups = {cracky=3},
|
|
|
|
sounds = default.node_sound_glass_defaults()
|
|
|
|
})
|
2016-01-09 18:52:10 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Deprecated
|
|
|
|
--
|
2013-11-15 22:51:44 +01:00
|
|
|
|
2016-07-24 13:18:42 +02:00
|
|
|
if settings:get_bool("ENABLE_HORIZONTAL_PILLAR") then
|
2016-01-09 18:52:10 +01:00
|
|
|
-- Quartz Pillar (horizontal)
|
2013-11-17 20:15:44 +01:00
|
|
|
minetest.register_node("quartz:pillar_horizontal", {
|
|
|
|
description = "Quartz Pillar Horizontal",
|
2019-03-01 05:13:58 +01:00
|
|
|
tiles = {"quartz_pillar_side.png", "quartz_pillar_side.png",
|
|
|
|
"quartz_pillar_side.png^[transformR90",
|
|
|
|
"quartz_pillar_side.png^[transformR90", "quartz_pillar_top.png",
|
|
|
|
"quartz_pillar_top.png"},
|
2013-11-17 20:15:44 +01:00
|
|
|
paramtype2 = "facedir",
|
|
|
|
drop = 'quartz:pillar',
|
2019-03-01 05:13:58 +01:00
|
|
|
groups = {cracky=3, oddly_breakable_by_hand=1,
|
|
|
|
not_in_creative_inventory=1},
|
2013-11-17 20:15:44 +01:00
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
})
|
|
|
|
end
|