rock crusher, tweaks
parent
92892b273b
commit
75947e833f
|
@ -147,7 +147,7 @@ minetest.register_node("bitumen:cement_mixer", {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {choppy=1, petroleum_fixture=1},
|
groups = {cracky=1, petroleum_fixture=1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
|
|
11
crafts.lua
11
crafts.lua
|
@ -306,7 +306,7 @@ minetest.register_craft({
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
--
|
-- misc machines
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "bitumen:kerosene_light",
|
output = "bitumen:kerosene_light",
|
||||||
|
@ -316,3 +316,12 @@ minetest.register_craft({
|
||||||
{"", "bitumen:drum_extractor", ""},
|
{"", "bitumen:drum_extractor", ""},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "bitumen:rock_crusher",
|
||||||
|
recipe = {
|
||||||
|
{"", "bitumen:galv_steel_sheet", ""},
|
||||||
|
{"bitumen:galv_steel_sheet", "bitumen:rock_crusher_blueprint", "bitumen:galv_steel_sheet"},
|
||||||
|
{"", "bitumen:galv_steel_sheet", ""},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
1
init.lua
1
init.lua
|
@ -104,6 +104,7 @@ dofile(modpath.."/cylinder_tank.lua")
|
||||||
dofile(modpath.."/sphere_tank.lua")
|
dofile(modpath.."/sphere_tank.lua")
|
||||||
dofile(modpath.."/refinery.lua")
|
dofile(modpath.."/refinery.lua")
|
||||||
dofile(modpath.."/lights.lua")
|
dofile(modpath.."/lights.lua")
|
||||||
|
dofile(modpath.."/rock_crusher.lua")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
14
ore_gen.lua
14
ore_gen.lua
|
@ -85,23 +85,25 @@ minetest.register_ore({
|
||||||
minetest.register_ore({
|
minetest.register_ore({
|
||||||
ore_type = "blob",
|
ore_type = "blob",
|
||||||
ore = "bitumen:chalk",
|
ore = "bitumen:chalk",
|
||||||
wherein = {"default:stone"},
|
wherein = {"default:stone", "default:sand"},
|
||||||
clust_scarcity = 32 * 32 * 32,
|
clust_scarcity = 48 * 48 * 48,
|
||||||
clust_size = 6,
|
clust_size = 14,
|
||||||
y_min = 2,
|
y_min = 2,
|
||||||
y_max = 30,
|
y_max = 30,
|
||||||
noise_threshold = 0.0,
|
noise_threshold = 0.0,
|
||||||
noise_params = {
|
noise_params = {
|
||||||
offset = 0.5,
|
offset = 0.5,
|
||||||
scale = 0.2,
|
scale = 0.2,
|
||||||
spread = {x = 5, y = 5, z = 5},
|
spread = {x = 10, y = 5, z = 7},
|
||||||
seed = -343,
|
seed = -343,
|
||||||
octaves = 1,
|
octaves = 1,
|
||||||
persist = 0.0
|
persist = 0.1
|
||||||
},
|
},
|
||||||
biomes = {"savanna", "savanna_shore", "savanna_ocean",
|
biomes = {"savanna", "savanna_shore", "savanna_ocean",
|
||||||
"rainforest", "rainforest_swamp", "rainforest_ocean", "underground",
|
"rainforest", "rainforest_swamp", "rainforest_ocean", "underground",
|
||||||
"floatland_coniferous_forest", "floatland_coniferous_forest_ocean"}
|
"floatland_coniferous_forest", "floatland_coniferous_forest_ocean"
|
||||||
|
-- ,"grassland", "desert", "sandstone_desert"
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
108
rock_crusher.lua
108
rock_crusher.lua
|
@ -68,12 +68,12 @@ local rock_crusher_formspec =
|
||||||
|
|
||||||
local function take_gas(itemstack, amount)
|
local function take_gas(itemstack, amount)
|
||||||
|
|
||||||
if st:get_name() ~= "bitumen:oil_drum_filled" end
|
if itemstack:get_name() ~= "bitumen:oil_drum_filled" then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
local smeta = st:get_meta()
|
local smeta = itemstack:get_meta()
|
||||||
if smeta:get_float("fluid") ~= "bitumen:gasoline" then
|
if smeta:get_string("fluid") ~= "bitumen:gasoline" then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -88,6 +88,62 @@ local function take_gas(itemstack, amount)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function crushtimer(pos, elapsed)
|
||||||
|
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
|
||||||
|
local fuel = meta:get_float("fuel") or 0.0
|
||||||
|
|
||||||
|
if fuel <= 0 then
|
||||||
|
-- try to get some fuel
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
|
||||||
|
local st = inv:get_stack("main", 1)
|
||||||
|
|
||||||
|
if take_gas(st, 1) then
|
||||||
|
inv:set_stack("main", 1, st);
|
||||||
|
fuel = fuel + 1
|
||||||
|
else
|
||||||
|
-- out of fuel, turn off
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
fuel = fuel - .1
|
||||||
|
meta:set_float("fuel", fuel)
|
||||||
|
|
||||||
|
-- try to grind some rocks
|
||||||
|
pos.y = pos.y + 1
|
||||||
|
-- local tnode = minetest.get_node(pos)
|
||||||
|
|
||||||
|
local tmeta = minetest.get_meta(pos)
|
||||||
|
local tinv = tmeta:get_inventory()
|
||||||
|
local cob = tinv:remove_item("main", "default:cobble 1")
|
||||||
|
if cob:get_count() <= 0 then
|
||||||
|
cob = tinv:remove_item("main", "default:desert_cobble 1")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if cob:get_count() > 0 then
|
||||||
|
pos.y = pos.y - 2
|
||||||
|
local bmeta = minetest.get_meta(pos)
|
||||||
|
local binv = bmeta:get_inventory()
|
||||||
|
|
||||||
|
binv:add_item("main", "default:gravel 1")
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node("bitumen:rock_crusher", {
|
minetest.register_node("bitumen:rock_crusher", {
|
||||||
description = "Small Gas Rock Crusher",
|
description = "Small Gas Rock Crusher",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
|
@ -120,40 +176,13 @@ minetest.register_node("bitumen:rock_crusher", {
|
||||||
|
|
||||||
on_punch = function(pos)
|
on_punch = function(pos)
|
||||||
swap_node(pos, "bitumen:rock_crusher_on")
|
swap_node(pos, "bitumen:rock_crusher_on")
|
||||||
try_turn_on(pos)
|
minetest.get_node_timer(pos):start(2.0)
|
||||||
|
--try_turn_on(pos)
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_timer = function(pos)
|
||||||
|
return false
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_timer = function(pos, elapsed)
|
|
||||||
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
|
|
||||||
local fuel = meta:get_float("fuel") or 0.0
|
|
||||||
|
|
||||||
if fuel <= 0 then
|
|
||||||
-- try to get some fuel
|
|
||||||
local inv = meta:get_inventory()
|
|
||||||
|
|
||||||
local st = inv:get_stack("main", 1)
|
|
||||||
|
|
||||||
if take_gas(st, 1) then
|
|
||||||
inv:set_stack("main", 1, st);
|
|
||||||
fuel = fuel + 1
|
|
||||||
else
|
|
||||||
-- out of fuel, turn off
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
fuel = fuel - .1
|
|
||||||
meta:set_float("fuel", fuel)
|
|
||||||
|
|
||||||
-- try to grind some rocks
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -190,11 +219,16 @@ minetest.register_node("bitumen:rock_crusher_on", {
|
||||||
|
|
||||||
on_punch = function(pos)
|
on_punch = function(pos)
|
||||||
swap_node(pos, "bitumen:rock_crusher")
|
swap_node(pos, "bitumen:rock_crusher")
|
||||||
destruct_light(pos)
|
-- destruct_light(pos)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
on_timer = crushtimer,
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
bitumen.register_blueprint({
|
||||||
|
name="bitumen:rock_crusher",
|
||||||
|
no_constructor_craft = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue