Clean up buckets and cauldrons a little bit
This commit is contained in:
parent
685cba6821
commit
3a7022ab66
|
@ -29,15 +29,15 @@ local is_creative_enabled = minetest.is_creative_enabled
|
||||||
local is_protected = minetest.is_protected
|
local is_protected = minetest.is_protected
|
||||||
local record_protection_violation = minetest.record_protection_violation
|
local record_protection_violation = minetest.record_protection_violation
|
||||||
|
|
||||||
if mod_mcl_core then
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "mcl_buckets:bucket_empty 1",
|
output = "mcl_buckets:bucket_empty 1",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"mcl_core:iron_ingot", "", "mcl_core:iron_ingot"},
|
{"mcl_core:iron_ingot", "", "mcl_core:iron_ingot"},
|
||||||
{"", "mcl_core:iron_ingot", ""},
|
{"", "mcl_core:iron_ingot", ""},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
|
||||||
|
|
||||||
mcl_buckets = {
|
mcl_buckets = {
|
||||||
liquids = {},
|
liquids = {},
|
||||||
|
@ -88,9 +88,7 @@ end
|
||||||
local pointable_sources = {}
|
local pointable_sources = {}
|
||||||
|
|
||||||
local function bucket_raycast(user)
|
local function bucket_raycast(user)
|
||||||
--local pos = user:get_pos()
|
|
||||||
local pos = user:get_pos()
|
local pos = user:get_pos()
|
||||||
--local pos = vector.add(user:get_pos(), user:get_bone_position("Head_Control"))
|
|
||||||
pos.y = pos.y + user:get_properties().eye_height
|
pos.y = pos.y + user:get_properties().eye_height
|
||||||
local look_dir = user:get_look_dir()
|
local look_dir = user:get_look_dir()
|
||||||
look_dir = vector.multiply(look_dir, 5)
|
look_dir = vector.multiply(look_dir, 5)
|
||||||
|
@ -100,7 +98,6 @@ local function bucket_raycast(user)
|
||||||
if ray then
|
if ray then
|
||||||
for pointed_thing in ray do
|
for pointed_thing in ray do
|
||||||
if pointed_thing and pointable_sources[get_node(pointed_thing.above).name] then
|
if pointed_thing and pointable_sources[get_node(pointed_thing.above).name] then
|
||||||
--minetest.chat_send_all("found!")
|
|
||||||
return {under=pointed_thing.under,above=pointed_thing.above}
|
return {under=pointed_thing.under,above=pointed_thing.above}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -242,7 +239,6 @@ local function on_place_bucket_empty(itemstack, user, pointed_thing)
|
||||||
if liquid_name then
|
if liquid_name then
|
||||||
local liquid_def = mcl_buckets.liquids[liquid_name]
|
local liquid_def = mcl_buckets.liquids[liquid_name]
|
||||||
if liquid_def then
|
if liquid_def then
|
||||||
--minetest.chat_send_all("test")
|
|
||||||
-- Fill bucket, but not in Creative Mode
|
-- Fill bucket, but not in Creative Mode
|
||||||
-- FIXME: remove this line
|
-- FIXME: remove this line
|
||||||
--if not is_creative_enabled(user:get_player_name()) then
|
--if not is_creative_enabled(user:get_player_name()) then
|
||||||
|
@ -372,7 +368,6 @@ minetest.register_craftitem("mcl_buckets:bucket_empty", {
|
||||||
_doc_items_longdesc = S("A bucket can be used to collect and release liquids."),
|
_doc_items_longdesc = S("A bucket can be used to collect and release liquids."),
|
||||||
_doc_items_usagehelp = S("Punch a liquid source to collect it. You can then use the filled bucket to place the liquid somewhere else."),
|
_doc_items_usagehelp = S("Punch a liquid source to collect it. You can then use the filled bucket to place the liquid somewhere else."),
|
||||||
_tt_help = S("Collects liquids"),
|
_tt_help = S("Collects liquids"),
|
||||||
--liquids_pointable = true,
|
|
||||||
inventory_image = "bucket.png",
|
inventory_image = "bucket.png",
|
||||||
stack_max = 16,
|
stack_max = 16,
|
||||||
_on_dispense = function(stack, pos, droppos, dropnode, dropdir)
|
_on_dispense = function(stack, pos, droppos, dropnode, dropdir)
|
||||||
|
|
|
@ -10,13 +10,6 @@ local function sound_place(itemname, pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[local sound_take = function(itemname, pos)
|
|
||||||
local def = minetest.registered_nodes[itemname]
|
|
||||||
if def and def.sounds and def.sounds.dug then
|
|
||||||
minetest.sound_play(def.sounds.dug, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true)
|
|
||||||
end
|
|
||||||
end]]
|
|
||||||
|
|
||||||
if mod_mcl_core then
|
if mod_mcl_core then
|
||||||
-- Lava bucket
|
-- Lava bucket
|
||||||
mcl_buckets.register_liquid({
|
mcl_buckets.register_liquid({
|
||||||
|
|
|
@ -36,8 +36,6 @@ local function create_cauldron_nodebox(water_level)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Empty cauldron
|
-- Empty cauldron
|
||||||
minetest.register_node("mcl_cauldrons:cauldron", {
|
minetest.register_node("mcl_cauldrons:cauldron", {
|
||||||
description = S("Cauldron"),
|
description = S("Cauldron"),
|
||||||
|
@ -105,18 +103,12 @@ local function register_filled_cauldron(water_level, description, liquid)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Filled cauldrons (3 levels)
|
-- Filled cauldrons (3 levels)
|
||||||
register_filled_cauldron(1, S("Cauldron (1/3 Water)"))
|
for i=1,3 do
|
||||||
register_filled_cauldron(2, S("Cauldron (2/3 Water)"))
|
register_filled_cauldron(i, S("Cauldron (" ..i .. "/3 Water)"))
|
||||||
register_filled_cauldron(3, S("Cauldron (3/3 Water)"))
|
register_filled_cauldron(i, S("Cauldron (" ..i .. "/3 Water)"),"lava")
|
||||||
|
if minetest.get_modpath("mclx_core") then
|
||||||
register_filled_cauldron(1, S("Cauldron (1/3 Lava)"),"lava")
|
register_filled_cauldron(i, S("Cauldron (" ..i .. "/3 Water)"),"river_water")
|
||||||
register_filled_cauldron(2, S("Cauldron (2/3 Lava)"),"lava")
|
end
|
||||||
register_filled_cauldron(3, S("Cauldron (3/3 Lava)"),"lava")
|
|
||||||
|
|
||||||
if minetest.get_modpath("mclx_core") then
|
|
||||||
register_filled_cauldron(1, S("Cauldron (1/3 River Water)"),"river_water")
|
|
||||||
register_filled_cauldron(2, S("Cauldron (2/3 River Water)"),"river_water")
|
|
||||||
register_filled_cauldron(3, S("Cauldron (3/3 River Water)"),"river_water")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
|
Loading…
Reference in New Issue
Block a user