Merge branch 'master' into dyable-leather-armor

This commit is contained in:
AFCMS 2022-05-02 09:56:11 +02:00
commit 1504d64647
Signed by untrusted user: AFCMS
GPG Key ID: 8720389A25B652E3
27 changed files with 211 additions and 75 deletions

View File

@ -41,6 +41,7 @@ Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times
* `flammable=-1` Does not get destroyed by fire * `flammable=-1` Does not get destroyed by fire
* `fire_encouragement`: How quickly this block catches fire * `fire_encouragement`: How quickly this block catches fire
* `fire_flammability`: How fast the block will burn away * `fire_flammability`: How fast the block will burn away
* `path_creation_possible=1`: Node can be turned into grass path by using a shovel on it
* `spreading_dirt_type=1`: A dirt-type block with a cover (e.g. grass) which may spread to neighbor dirt blocks * `spreading_dirt_type=1`: A dirt-type block with a cover (e.g. grass) which may spread to neighbor dirt blocks
* `dirtifies_below_solid=1`: This node turns into dirt immediately when a solid or dirtifier node is placed on top * `dirtifies_below_solid=1`: This node turns into dirt immediately when a solid or dirtifier node is placed on top
* `dirtifier=1`: This node turns nodes the above group into dirt when placed above * `dirtifier=1`: This node turns nodes the above group into dirt when placed above

View File

@ -2,7 +2,7 @@
An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils. An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils.
Developed by many people. Not developed or endorsed by Mojang AB. Developed by many people. Not developed or endorsed by Mojang AB.
Version: 0.74 (in development) Version: 0.75 (in development)
### Gameplay ### Gameplay
You start in a randomly-generated world made entirely of cubes. You can explore You start in a randomly-generated world made entirely of cubes. You can explore

View File

@ -395,8 +395,9 @@ mobs:register_mob("mobs_mc:enderman", {
local node = minetest.get_node(take_pos) local node = minetest.get_node(take_pos)
-- Don't destroy protected stuff. -- Don't destroy protected stuff.
if not minetest.is_protected(take_pos, "") then if not minetest.is_protected(take_pos, "") then
local dug = minetest.dig_node(take_pos) minetest.remove_node(take_pos)
if dug then local dug = minetest.get_node_or_nil(take_pos)
if dug and dug.name == "air" then
if mobs_mc.enderman_replace_on_take[node.name] then if mobs_mc.enderman_replace_on_take[node.name] then
self._taken_node = mobs_mc.enderman_replace_on_take[node.name] self._taken_node = mobs_mc.enderman_replace_on_take[node.name]
else else

View File

@ -124,6 +124,10 @@ mobs:register_mob("mobs_mc:snowman", {
local pos = self.object:get_pos() local pos = self.object:get_pos()
minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true) minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true)
if minetest.registered_items["mcl_farming:pumpkin_face"] then
minetest.add_item({x=pos.x, y=pos.y+1.4, z=pos.z}, "mcl_farming:pumpkin_face")
end
-- Wear out -- Wear out
if not minetest.is_creative_enabled(clicker:get_player_name()) then if not minetest.is_creative_enabled(clicker:get_player_name()) then
item:add_wear(mobs_mc.misc.shears_wear) item:add_wear(mobs_mc.misc.shears_wear)

View File

@ -74,7 +74,7 @@ local professions = {
}, },
{ {
{ { "mcl_farming:pumpkin_face", 8, 13 }, E1 }, { { "mcl_farming:pumpkin", 8, 13 }, E1 },
{ E1, { "mcl_farming:pumpkin_pie", 2, 3} }, { E1, { "mcl_farming:pumpkin_pie", 2, 3} },
}, },

View File

@ -31,6 +31,14 @@ doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
return "" return ""
end) end)
-- usable by shovels
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
if def.groups.path_creation_possible then
return S("This block can be turned into grass path with a shovel.")
end
return ""
end)
-- soil -- soil
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def) doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
local datastring = "" local datastring = ""

View File

@ -1,9 +1,32 @@
local stereotype_frame = 18
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
mcl_compass = {} mcl_compass = {}
local compass_frames = 32 local compass_frames = 32
local function get_far_node(pos, itemstack) --code from minetest dev wiki: https://dev.minetest.net/minetest.get_node, some edits have been made to add a cooldown for force loads
local node = minetest.get_node(pos)
if node.name == "ignore" then
tstamp = tonumber(itemstack:get_meta():get_string("last_forceload"))
if tstamp == nil then --this is only relevant for new lodestone compasses, the ones that have never performes a forceload yet
itemstack:get_meta():set_string("last_forceload", tostring(os.time(os.date("!*t"))))
tstamp = tonumber(os.time(os.date("!*t")))
end
if tonumber(os.time(os.date("!*t"))) - tstamp > 180 then --current time in secounds - old time in secounds, if it is over 180 (3 mins): forceload
itemstack:get_meta():set_string("last_forceload", tostring(os.time(os.date("!*t"))))
minetest.get_voxel_manip():read_from_map(pos, pos)
node = minetest.get_node(pos)
else
node = {name="mcl_compass:lodestone"} --cooldown not over yet, pretend like there is something...
end
end
return node
end
--Not sure spawn point should be dymanic (is it in mc?) --Not sure spawn point should be dymanic (is it in mc?)
--local default_spawn_settings = minetest.settings:get("static_spawnpoint") --local default_spawn_settings = minetest.settings:get("static_spawnpoint")
@ -13,10 +36,34 @@ local random_timer_trigger = 0.5 -- random compass spinning tick in seconds. Inc
local random_frame = math.random(0, compass_frames-1) local random_frame = math.random(0, compass_frames-1)
function mcl_compass.get_compass_image(pos, dir) function mcl_compass.get_compass_image(pos, dir, itemstack)
-- Compasses do not work in certain zones if not itemstack then
if mcl_worlds.compass_works(pos) then minetest.log("WARNING: mcl_compass.get_compass_image() was called without itemstack, returning random frame!")
local spawn = {x=0,y=0,z=0} return random_frame
end
local lodestone_pos = minetest.string_to_pos(itemstack:get_meta():get_string("pointsto"))
if lodestone_pos then --lodestone meta present
local _, dim = mcl_worlds.y_to_layer(lodestone_pos.y)
local _, playerdim = mcl_worlds.y_to_layer(pos.y)
if dim == playerdim then --Check if player and compass target are in the same dimension, above check is just if the diemension is valid for the non lodestone compass
if get_far_node(lodestone_pos, itemstack).name == "mcl_compass:lodestone" then --check if lodestone still exists
local angle_north = math.deg(math.atan2(lodestone_pos.x - pos.x, lodestone_pos.z - pos.z))
if angle_north < 0 then angle_north = angle_north + 360 end
local angle_dir = -math.deg(dir)
local angle_relative = (angle_north - angle_dir + 180) % 360
return math.floor((angle_relative/11.25) + 0.5) % compass_frames .. "_lodestone"
else -- lodestone got destroyed
return random_frame .. "_lodestone"
end
else
return random_frame .. "_lodestone"
end
else --no lodestone meta, normal compass....
local spawn = {x = 0, y=0, z=0} --before you guys tell me that the normal compass no points to real spawn, it always pointed to 0 0
local ssp = minetest.setting_get_pos("static_spawnpoint") local ssp = minetest.setting_get_pos("static_spawnpoint")
if ssp then if ssp then
spawn = ssp spawn = ssp
@ -24,13 +71,17 @@ function mcl_compass.get_compass_image(pos, dir)
spawn = {x=0,y=0,z=0} spawn = {x=0,y=0,z=0}
end end
end end
local angle_north = math.deg(math.atan2(spawn.x - pos.x, spawn.z - pos.z))
if angle_north < 0 then angle_north = angle_north + 360 end if mcl_worlds.compass_works(pos) then --is the player in the overworld?
local angle_dir = -math.deg(dir) local angle_north = math.deg(math.atan2(spawn.x - pos.x, spawn.z - pos.z))
local angle_relative = (angle_north - angle_dir + 180) % 360 if angle_north < 0 then angle_north = angle_north + 360 end
return math.floor((angle_relative/11.25) + 0.5) % compass_frames local angle_dir = -math.deg(dir)
else local angle_relative = (angle_north - angle_dir + 180) % 360
return random_frame return math.floor((angle_relative/11.25) + 0.5) % compass_frames
else
return random_frame
end
end end
end end
@ -41,7 +92,7 @@ minetest.register_globalstep(function(dtime)
random_frame = (random_frame + math.random(-1, 1)) % compass_frames random_frame = (random_frame + math.random(-1, 1)) % compass_frames
random_timer = 0 random_timer = 0
end end
for i,player in pairs(minetest.get_connected_players()) do for _,player in pairs(minetest.get_connected_players()) do
local function has_compass(player) local function has_compass(player)
for _,stack in pairs(player:get_inventory():get_list("main")) do for _,stack in pairs(player:get_inventory():get_list("main")) do
if minetest.get_item_group(stack:get_name(), "compass") ~= 0 then if minetest.get_item_group(stack:get_name(), "compass") ~= 0 then
@ -52,15 +103,18 @@ minetest.register_globalstep(function(dtime)
end end
if has_compass(player) then if has_compass(player) then
local pos = player:get_pos() local pos = player:get_pos()
local compass_image = mcl_compass.get_compass_image(pos, player:get_look_horizontal())
for j,stack in pairs(player:get_inventory():get_list("main")) do for j,stack in pairs(player:get_inventory():get_list("main")) do
if minetest.get_item_group(stack:get_name(), "compass") ~= 0 and if minetest.get_item_group(stack:get_name(), "compass") ~= 0 then
minetest.get_item_group(stack:get_name(), "compass")-1 ~= compass_image then local compass_image = mcl_compass.get_compass_image(pos, player:get_look_horizontal(), stack)
local itemname = "mcl_compass:"..compass_image if minetest.get_item_group(stack:get_name(), "compass")-1 ~= compass_image and minetest.get_item_group(stack:get_name(), "compass")-1 .. "_lodestone" ~=compass_image then --Explaination: First check for normal compasses, secound check for lodestone ones
stack:set_name(itemname) local itemname = "mcl_compass:"..compass_image
player:get_inventory():set_stack("main", j, stack) --minetest.log(os.time(os.date("!*t")))
stack:set_name(itemname)
player:get_inventory():set_stack("main", j, stack)
end
end end
end end
end end
end end
@ -74,15 +128,14 @@ end
local doc_mod = minetest.get_modpath("doc") local doc_mod = minetest.get_modpath("doc")
local stereotype_frame = 18
for i,img in ipairs(images) do for i,img in ipairs(images) do
local inv = 1 local inv = 1
if i == stereotype_frame then if i == stereotype_frame then
inv = 0 inv = 0
end end
local use_doc, longdesc, tt local use_doc, longdesc, tt
--Why is there no usage help? This should be fixed. --Why is there no usage help? This should be fixed.
--local usagehelp --local usagehelp
use_doc = i == stereotype_frame use_doc = i == stereotype_frame
if use_doc then if use_doc then
tt = S("Points to the world origin") tt = S("Points to the world origin")
@ -101,6 +154,18 @@ for i,img in ipairs(images) do
groups = {not_in_creative_inventory=inv, compass=i, tool=1, disable_repair=1 } groups = {not_in_creative_inventory=inv, compass=i, tool=1, disable_repair=1 }
}) })
minetest.register_craftitem(itemstring .. "_lodestone", {
description = S("Lodestone Compass"),
_tt_help = tt,
_doc_items_create_entry = use_doc,
_doc_items_longdesc = longdesc,
--_doc_items_usagehelp = usagehelp,
inventory_image = img .. "^[colorize:purple:50",
wield_image = img .. "^[colorize:purple:50",
stack_max = 64,
groups = {not_in_creative_inventory=1, compass=i, tool=1, disable_repair=1 }
})
-- Help aliases. Makes sure the lookup tool works correctly -- Help aliases. Makes sure the lookup tool works correctly
if not use_doc and doc_mod then if not use_doc and doc_mod then
doc.add_entry_alias("craftitems", "mcl_compass:"..(stereotype_frame-1), "craftitems", itemstring) doc.add_entry_alias("craftitems", "mcl_compass:"..(stereotype_frame-1), "craftitems", itemstring)
@ -116,9 +181,40 @@ minetest.register_craft({
} }
}) })
minetest.register_craft({
output = "mcl_compass:lodestone",
recipe = {
{"mcl_core:stonebrickcarved","mcl_core:stonebrickcarved","mcl_core:stonebrickcarved"},
{"mcl_core:stonebrickcarved", "mcl_core:diamondblock", "mcl_core:stonebrickcarved"},
{"mcl_core:stonebrickcarved", "mcl_core:stonebrickcarved", "mcl_core:stonebrickcarved"}
}
})
minetest.register_alias("mcl_compass:compass", "mcl_compass:"..stereotype_frame) minetest.register_alias("mcl_compass:compass", "mcl_compass:"..stereotype_frame)
-- Export stereotype item for other mods to use -- Export stereotype item for other mods to use
mcl_compass.stereotype = "mcl_compass:"..tostring(stereotype_frame) mcl_compass.stereotype = "mcl_compass:"..tostring(stereotype_frame)
minetest.register_node("mcl_compass:lodestone",{
description=S("Lodestone"),
on_rightclick = function(pos, node, player, itemstack)
if itemstack.get_name(itemstack).match(itemstack.get_name(itemstack),"mcl_compass:") then
if itemstack.get_name(itemstack) ~= "mcl_compass:lodestone" then
itemstack:get_meta():set_string("pointsto", minetest.pos_to_string(pos))
end
end
end,
tiles = {
"lodestone_top.png",
"lodestone_bottom.png",
"lodestone_side1.png",
"lodestone_side2.png",
"lodestone_side3.png",
"lodestone_side4.png"
},
groups = {pickaxey=1, material_stone=1},
_mcl_hardness = 1.5,
_mcl_blast_resistance = 6,
sounds = mcl_sounds.node_sound_stone_defaults()
})

View File

@ -1,4 +1,4 @@
name = mcl_compass name = mcl_compass
description = A compass item which points towards the world origin. description = A compass item which points towards the world origin.
depends = mcl_core, mcl_worlds, mesecons depends = mcl_core, mcl_worlds, mesecons, mcl_sounds
optional_depends = doc optional_depends = doc

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -382,8 +382,14 @@ minetest.register_craft({
} }
}) })
-- TODO: Add crafting recipe: 9 ice → 1 packed ice minetest.register_craft({
-- Add it when silk touch tools work. output = 'mcl_core:packed_ice 1',
recipe = {
{'mcl_core:ice', 'mcl_core:ice', 'mcl_core:ice'},
{'mcl_core:ice', 'mcl_core:ice', 'mcl_core:ice'},
{'mcl_core:ice', 'mcl_core:ice', 'mcl_core:ice'},
}
})
-- --
-- Crafting (tool repair) -- Crafting (tool repair)

View File

@ -620,6 +620,30 @@ function mcl_core.generate_spruce_tree(pos)
minetest.place_schematic({ x = pos.x - 3, y = pos.y - 1, z = pos.z - 3 }, path, "0", nil, false) minetest.place_schematic({ x = pos.x - 3, y = pos.y - 1, z = pos.z - 3 }, path, "0", nil, false)
end end
local function find_necorner(p)
local n=minetest.get_node_or_nil(vector.offset(p,0,1,1))
local e=minetest.get_node_or_nil(vector.offset(p,1,1,0))
if n and n.name == "mcl_core:sprucetree" then
p=vector.offset(p,0,0,1)
end
if e and e.name == "mcl_core:sprucetree" then
p=vector.offset(p,1,0,0)
end
return p
end
local function generate_spruce_podzol(ps)
local pos=find_necorner(ps)
local pos1=vector.offset(pos,-6,-6,-6)
local pos2=vector.offset(pos,6,6,6)
local nn=minetest.find_nodes_in_area_under_air(pos1, pos2, {"group:dirt"})
for k,v in pairs(nn) do
if math.random(vector.distance(pos,v)) < 4 and not (math.abs(pos.x-v.x) == 6 and math.abs(pos.z-v.z) == 6) then --leave out the corners
minetest.set_node(v,{name="mcl_core:podzol"})
end
end
end
function mcl_core.generate_huge_spruce_tree(pos) function mcl_core.generate_huge_spruce_tree(pos)
local r1 = math.random(1, 2) local r1 = math.random(1, 2)
local r2 = math.random(1, 4) local r2 = math.random(1, 4)
@ -636,6 +660,7 @@ function mcl_core.generate_huge_spruce_tree(pos)
path = modpath.."/schematics/mcl_core_spruce_huge_up_"..r2..".mts" path = modpath.."/schematics/mcl_core_spruce_huge_up_"..r2..".mts"
end end
minetest.place_schematic(vector.add(pos, offset), path, "0", nil, false) minetest.place_schematic(vector.add(pos, offset), path, "0", nil, false)
generate_spruce_podzol(pos)
end end
-- END of spruce tree functions -- -- END of spruce tree functions --
@ -1673,4 +1698,3 @@ function mcl_core.after_snow_destruct(pos)
local node = minetest.get_node(npos) local node = minetest.get_node(npos)
mcl_core.clear_snow_dirt(npos, node) mcl_core.clear_snow_dirt(npos, node)
end end

View File

@ -372,7 +372,7 @@ minetest.register_node("mcl_core:dirt_with_grass", {
handy = 1, shovely = 1, dirt = 2, grass_block = 1, grass_block_no_snow = 1, handy = 1, shovely = 1, dirt = 2, grass_block = 1, grass_block_no_snow = 1,
soil = 1, soil_sapling = 2, soil_sugarcane = 1, cultivatable = 2, soil = 1, soil_sapling = 2, soil_sugarcane = 1, cultivatable = 2,
spreading_dirt_type = 1, enderman_takable = 1, building_block = 1, spreading_dirt_type = 1, enderman_takable = 1, building_block = 1,
compostability = 30 compostability = 30, path_creation_possible=1
}, },
drop = "mcl_core:dirt", drop = "mcl_core:dirt",
sounds = mcl_sounds.node_sound_dirt_defaults({ sounds = mcl_sounds.node_sound_dirt_defaults({
@ -426,7 +426,7 @@ minetest.register_node("mcl_core:mycelium", {
tiles = {"mcl_core_mycelium_top.png", "default_dirt.png", {name="mcl_core_mycelium_side.png", tileable_vertical=false}}, tiles = {"mcl_core_mycelium_top.png", "default_dirt.png", {name="mcl_core_mycelium_side.png", tileable_vertical=false}},
is_ground_content = true, is_ground_content = true,
stack_max = 64, stack_max = 64,
groups = {handy=1,shovely=1, dirt=2,spreading_dirt_type=1, enderman_takable=1, building_block=1}, groups = { handy = 1, shovely = 1, dirt = 2, spreading_dirt_type = 1, enderman_takable = 1, building_block = 1, soil_sapling = 2, path_creation_possible=1},
drop = "mcl_core:dirt", drop = "mcl_core:dirt",
sounds = mcl_sounds.node_sound_dirt_defaults({ sounds = mcl_sounds.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.1}, footstep = {name="default_grass_footstep", gain=0.1},
@ -446,7 +446,7 @@ minetest.register_node("mcl_core:podzol", {
tiles = {"mcl_core_dirt_podzol_top.png", "default_dirt.png", {name="mcl_core_dirt_podzol_side.png", tileable_vertical=false}}, tiles = {"mcl_core_dirt_podzol_top.png", "default_dirt.png", {name="mcl_core_dirt_podzol_side.png", tileable_vertical=false}},
is_ground_content = true, is_ground_content = true,
stack_max = 64, stack_max = 64,
groups = {handy=1,shovely=3, dirt=2,soil=1, soil_sapling=2, soil_sugarcane=1, enderman_takable=1, building_block=1}, groups = {handy=1,shovely=3, dirt=2,soil=1, soil_sapling=2, soil_sugarcane=1, enderman_takable=1, building_block=1,path_creation_possible=1},
drop = "mcl_core:dirt", drop = "mcl_core:dirt",
sounds = mcl_sounds.node_sound_dirt_defaults(), sounds = mcl_sounds.node_sound_dirt_defaults(),
on_construct = mcl_core.on_snowable_construct, on_construct = mcl_core.on_snowable_construct,
@ -464,7 +464,7 @@ minetest.register_node("mcl_core:dirt", {
tiles = {"default_dirt.png"}, tiles = {"default_dirt.png"},
is_ground_content = true, is_ground_content = true,
stack_max = 64, stack_max = 64,
groups = {handy=1,shovely=1, dirt=1,soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, enderman_takable=1, building_block=1}, groups = {handy=1,shovely=1, dirt=1,soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, enderman_takable=1, building_block=1, path_creation_possible=1},
sounds = mcl_sounds.node_sound_dirt_defaults(), sounds = mcl_sounds.node_sound_dirt_defaults(),
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 0.5, _mcl_hardness = 0.5,
@ -476,7 +476,7 @@ minetest.register_node("mcl_core:coarse_dirt", {
tiles = {"mcl_core_coarse_dirt.png"}, tiles = {"mcl_core_coarse_dirt.png"},
is_ground_content = true, is_ground_content = true,
stack_max = 64, stack_max = 64,
groups = {handy=1,shovely=1, dirt=3,soil=1, soil_sugarcane=1, cultivatable=1, enderman_takable=1, building_block=1}, groups = { handy = 1,shovely = 1, dirt = 3, soil = 1, soil_sugarcane = 1, cultivatable = 1, enderman_takable = 1, building_block = 1, soil_sapling = 2, path_creation_possible=1},
sounds = mcl_sounds.node_sound_dirt_defaults(), sounds = mcl_sounds.node_sound_dirt_defaults(),
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 0.5, _mcl_hardness = 0.5,
@ -1073,4 +1073,3 @@ if minetest.get_modpath("doc") then
doc.add_entry_alias("nodes", "mcl_core:water_source", "nodes", "mcl_core:water_flowing") doc.add_entry_alias("nodes", "mcl_core:water_source", "nodes", "mcl_core:water_flowing")
doc.add_entry_alias("nodes", "mcl_core:lava_source", "nodes", "mcl_core:lava_flowing") doc.add_entry_alias("nodes", "mcl_core:lava_source", "nodes", "mcl_core:lava_flowing")
end end

View File

@ -201,9 +201,9 @@ local function register_sapling(subname, description, longdesc, tt_help, texture
local node_below = minetest.get_node_or_nil({x=pos.x,y=pos.y-1,z=pos.z}) local node_below = minetest.get_node_or_nil({x=pos.x,y=pos.y-1,z=pos.z})
if not node_below then return false end if not node_below then return false end
local nn = node_below.name local nn = node_below.name
return ((minetest.get_item_group(nn, "grass_block") == 1) or return minetest.get_item_group(nn, "grass_block") == 1 or
nn=="mcl_core:podzol" or nn=="mcl_core:podzol_snow" or nn == "mcl_core:podzol" or nn == "mcl_core:podzol_snow" or
nn=="mcl_core:dirt") nn == "mcl_core:dirt" or nn == "mcl_core:mycelium" or nn == "mcl_core:coarse_dirt"
end), end),
node_placement_prediction = "", node_placement_prediction = "",
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,

View File

@ -166,18 +166,20 @@ minetest.register_node("mcl_end:dragon_egg", {
selection_box = { selection_box = {
type = "regular", type = "regular",
}, },
groups = {handy=1, falling_node = 1, deco_block = 1, not_in_creative_inventory = 1, dig_by_piston = 1 }, groups = {handy = 1, falling_node = 1, deco_block = 1, not_in_creative_inventory = 1, dig_by_piston = 1 },
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 9, _mcl_blast_resistance = 9,
_mcl_hardness = 3, _mcl_hardness = 3,
on_punch = function(pos, node) on_punch = function(pos, node, puncher)
local max_dist = vector.new(15, 7, 15) if not minetest.is_protected(pos, puncher:get_player_name()) then
local positions = minetest.find_nodes_in_area(vector.subtract(pos, max_dist), vector.add(pos, max_dist), "air", false) local max_dist = vector.new(15, 7, 15)
if #positions > 0 then local positions = minetest.find_nodes_in_area(vector.subtract(pos, max_dist), vector.add(pos, max_dist), "air", false)
local tpos = positions[math.random(#positions)] if #positions > 0 then
minetest.remove_node(pos) local tpos = positions[math.random(#positions)]
minetest.set_node(tpos, node) minetest.remove_node(pos)
minetest.check_for_falling(tpos) minetest.set_node(tpos, node)
minetest.check_for_falling(tpos)
end
end end
end, end,
}) })

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -108,7 +108,6 @@ local pumpkin_base_def = {
_mcl_blast_resistance = 1, _mcl_blast_resistance = 1,
_mcl_hardness = 1, _mcl_hardness = 1,
} }
minetest.register_node("mcl_farming:pumpkin", pumpkin_base_def)
local pumpkin_face_base_def = table.copy(pumpkin_base_def) local pumpkin_face_base_def = table.copy(pumpkin_base_def)
pumpkin_face_base_def.description = S("Pumpkin") pumpkin_face_base_def.description = S("Pumpkin")
@ -121,9 +120,16 @@ pumpkin_face_base_def.groups.armor_head=1
pumpkin_face_base_def.groups.non_combat_armor_head=1 pumpkin_face_base_def.groups.non_combat_armor_head=1
pumpkin_face_base_def._mcl_armor_mob_range_factor = 0 pumpkin_face_base_def._mcl_armor_mob_range_factor = 0
pumpkin_face_base_def._mcl_armor_mob_range_mob = "mobs_mc:enderman" pumpkin_face_base_def._mcl_armor_mob_range_mob = "mobs_mc:enderman"
pumpkin_face_base_def._mcl_armor_element = "head" pumpkin_face_base_def._mcl_armor_element = "head"
pumpkin_face_base_def._mcl_armor_texture = "mcl_farming_pumpkin_face.png" pumpkin_face_base_def._mcl_armor_texture = "mcl_farming_pumpkin_face.png"
pumpkin_face_base_def.on_construct = function(pos)
-- Attempt to spawn iron golem or snow golem
mobs_mc.tools.check_iron_golem_summon(pos)
mobs_mc.tools.check_snow_golem_summon(pos)
end
if minetest.get_modpath("mcl_armor") then if minetest.get_modpath("mcl_armor") then
local pumpkin_hud = {} local pumpkin_hud = {}
local function add_pumpkin_hud(player) local function add_pumpkin_hud(player)
@ -177,12 +183,11 @@ end
mcl_farming:add_plant("plant_pumpkin_stem", "mcl_farming:pumpkintige_unconnect", {"mcl_farming:pumpkin_1", "mcl_farming:pumpkin_2", "mcl_farming:pumpkin_3", "mcl_farming:pumpkin_4", "mcl_farming:pumpkin_5", "mcl_farming:pumpkin_6", "mcl_farming:pumpkin_7"}, 30, 5) mcl_farming:add_plant("plant_pumpkin_stem", "mcl_farming:pumpkintige_unconnect", {"mcl_farming:pumpkin_1", "mcl_farming:pumpkin_2", "mcl_farming:pumpkin_3", "mcl_farming:pumpkin_4", "mcl_farming:pumpkin_5", "mcl_farming:pumpkin_6", "mcl_farming:pumpkin_7"}, 30, 5)
-- Register actual pumpkin, connected stems and stem-to-pumpkin growth -- Register actual pumpkin, connected stems and stem-to-pumpkin growth
mcl_farming:add_gourd("mcl_farming:pumpkintige_unconnect", "mcl_farming:pumpkintige_linked", "mcl_farming:pumpkintige_unconnect", stem_def, stem_drop, "mcl_farming:pumpkin_face", pumpkin_face_base_def, 30, 15, "mcl_farming_pumpkin_stem_connected.png^[colorize:#FFA800:127", mcl_farming:add_gourd("mcl_farming:pumpkintige_unconnect", "mcl_farming:pumpkintige_linked", "mcl_farming:pumpkintige_unconnect", stem_def, stem_drop, "mcl_farming:pumpkin", pumpkin_base_def, 30, 15, "mcl_farming_pumpkin_stem_connected.png^[colorize:#FFA800:127")
function(pos)
-- Attempt to spawn iron golem or snow golem -- Steal function to properly disconnect a carved pumpkin
mobs_mc.tools.check_iron_golem_summon(pos) pumpkin_face_base_def.after_destruct = minetest.registered_nodes["mcl_farming:pumpkin"].after_destruct
mobs_mc.tools.check_snow_golem_summon(pos) minetest.register_node("mcl_farming:pumpkin_face", pumpkin_face_base_def)
end)
-- Jack o'Lantern -- Jack o'Lantern
minetest.register_node("mcl_farming:pumpkin_face_light", { minetest.register_node("mcl_farming:pumpkin_face_light", {
@ -219,11 +224,6 @@ minetest.register_craft({
recipe = {{"mcl_farming:pumpkin"}} recipe = {{"mcl_farming:pumpkin"}}
}) })
minetest.register_craft({
output = "mcl_farming:pumpkin_seeds 4",
recipe = {{"mcl_farming:pumpkin_face"}}
})
minetest.register_craftitem("mcl_farming:pumpkin_pie", { minetest.register_craftitem("mcl_farming:pumpkin_pie", {
description = S("Pumpkin Pie"), description = S("Pumpkin Pie"),
_doc_items_longdesc = S("A pumpkin pie is a tasty food item which can be eaten."), _doc_items_longdesc = S("A pumpkin pie is a tasty food item which can be eaten."),
@ -241,11 +241,6 @@ minetest.register_craft({
output = "mcl_farming:pumpkin_pie", output = "mcl_farming:pumpkin_pie",
recipe = {"mcl_farming:pumpkin", "mcl_core:sugar", "mcl_throwing:egg"}, recipe = {"mcl_farming:pumpkin", "mcl_core:sugar", "mcl_throwing:egg"},
}) })
minetest.register_craft({
type = "shapeless",
output = "mcl_farming:pumpkin_pie",
recipe = {"mcl_farming:pumpkin_face", "mcl_core:sugar", "mcl_throwing:egg"},
})
if minetest.get_modpath("doc") then if minetest.get_modpath("doc") then

View File

@ -185,7 +185,7 @@ end
- stem_def: Partial node definition of the fully-grown unconnected stem node. Many fields are already defined. You need to add `tiles` and `description` at minimum. Don't define on_construct without good reason - stem_def: Partial node definition of the fully-grown unconnected stem node. Many fields are already defined. You need to add `tiles` and `description` at minimum. Don't define on_construct without good reason
- stem_drop: Drop probability table for all stem - stem_drop: Drop probability table for all stem
- gourd_itemstring: Desired itemstring of the full gourd node - gourd_itemstring: Desired itemstring of the full gourd node
- gourd_def: (almost) full definition of the gourd node. This function will add on_construct and after_dig_node to the definition for unconnecting any connected stems - gourd_def: (almost) full definition of the gourd node. This function will add on_construct and after_destruct to the definition for unconnecting any connected stems
- grow_interval: Will attempt to grow a gourd periodically at this interval in seconds - grow_interval: Will attempt to grow a gourd periodically at this interval in seconds
- grow_chance: Chance of 1/grow_chance to grow a gourd next to the full unconnected stem after grow_interval has passed. Must be a natural number - grow_chance: Chance of 1/grow_chance to grow a gourd next to the full unconnected stem after grow_interval has passed. Must be a natural number
- connected_stem_texture: Texture of the connected stem - connected_stem_texture: Texture of the connected stem
@ -235,8 +235,8 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
end end
-- Register gourd -- Register gourd
if not gourd_def.after_dig_node then if not gourd_def.after_destruct then
function gourd_def.after_dig_node(blockpos, oldnode, oldmetadata, user) gourd_def.after_destruct = function(blockpos, oldnode)
-- Disconnect any connected stems, turning them back to normal stems -- Disconnect any connected stems, turning them back to normal stems
for n=1, #neighbors do for n=1, #neighbors do
local offset = neighbors[n] local offset = neighbors[n]

View File

@ -386,8 +386,8 @@ add_large_plant("sunflower", S("Sunflower"), S("A sunflower is a large plant whi
local longdesc_grass = S("Double tallgrass a variant of tall grass and occupies two blocks. It can be harvested for wheat seeds.") local longdesc_grass = S("Double tallgrass a variant of tall grass and occupies two blocks. It can be harvested for wheat seeds.")
local longdesc_fern = S("Large fern is a variant of fern and occupies two blocks. It can be harvested for wheat seeds.") local longdesc_fern = S("Large fern is a variant of fern and occupies two blocks. It can be harvested for wheat seeds.")
add_large_plant("double_grass", S("Double Tallgrass"), longdesc_grass, "mcl_flowers_double_plant_grass_bottom.png", "mcl_flowers_double_plant_grass_top.png", "mcl_flowers_double_plant_grass_inv.png", 6/16, 4/16, wheat_seed_drop, {"mcl_flowers:tallgrass 2"}, false, true, nil, fortune_wheat_seed_drop) add_large_plant("double_grass", S("Double Tallgrass"), longdesc_grass, "mcl_flowers_double_plant_grass_bottom.png", "mcl_flowers_double_plant_grass_top.png", "mcl_flowers_double_plant_grass_inv.png", 6/16, 4/16, wheat_seed_drop, {"mcl_flowers:tallgrass 2"}, false, true, fortune_wheat_seed_drop)
add_large_plant("double_fern", S("Large Fern"), longdesc_fern, "mcl_flowers_double_plant_fern_bottom.png", "mcl_flowers_double_plant_fern_top.png", "mcl_flowers_double_plant_fern_inv.png", 5/16, 5/16, wheat_seed_drop, {"mcl_flowers:fern 2"}, false, true, nil, fortune_wheat_seed_drop) add_large_plant("double_fern", S("Large Fern"), longdesc_fern, "mcl_flowers_double_plant_fern_bottom.png", "mcl_flowers_double_plant_fern_top.png", "mcl_flowers_double_plant_fern_inv.png", 5/16, 5/16, wheat_seed_drop, {"mcl_flowers:fern 2"}, false, true, fortune_wheat_seed_drop)
minetest.register_abm({ minetest.register_abm({
label = "Pop out flowers", label = "Pop out flowers",

View File

@ -222,7 +222,7 @@ minetest.register_node("mcl_itemframes:item_frame",{
put_itemstack:set_count(1) put_itemstack:set_count(1)
local itemname = put_itemstack:get_name() local itemname = put_itemstack:get_name()
if minetest.get_item_group(itemname, "compass") > 0 then if minetest.get_item_group(itemname, "compass") > 0 then
put_itemstack:set_name("mcl_compass:" .. mcl_compass.get_compass_image(pos, minetest.dir_to_yaw(minetest.facedir_to_dir(node.param2)))) put_itemstack:set_name("mcl_compass:" .. mcl_compass.get_compass_image(pos, minetest.dir_to_yaw(minetest.facedir_to_dir(node.param2)), put_itemstack))
end end
if minetest.get_item_group(itemname, "clock") > 0 then if minetest.get_item_group(itemname, "clock") > 0 then
minetest.get_node_timer(pos):start(1.0) minetest.get_node_timer(pos):start(1.0)

View File

@ -191,7 +191,7 @@ local function make_grass_path(itemstack, placer, pointed_thing)
return itemstack return itemstack
end end
if (minetest.get_item_group(node.name, "grass_block") == 1) then if (minetest.get_item_group(node.name, "path_creation_possible") == 1) then
local above = table.copy(pointed_thing.under) local above = table.copy(pointed_thing.under)
above.y = above.y + 1 above.y = above.y + 1
if minetest.get_node(above).name == "air" then if minetest.get_node(above).name == "air" then
@ -238,7 +238,7 @@ if minetest.get_modpath("mcl_farming") then
minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = pointed_thing.above}, true) minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = pointed_thing.above}, true)
local dir = vector.subtract(pointed_thing.under, pointed_thing.above) local dir = vector.subtract(pointed_thing.under, pointed_thing.above)
local param2 = minetest.dir_to_facedir(dir) local param2 = minetest.dir_to_facedir(dir)
minetest.swap_node(pointed_thing.under, {name="mcl_farming:pumpkin_face", param2 = param2}) minetest.set_node(pointed_thing.under, {name="mcl_farming:pumpkin_face", param2 = param2})
minetest.add_item(pointed_thing.above, "mcl_farming:pumpkin_seeds 4") minetest.add_item(pointed_thing.above, "mcl_farming:pumpkin_seeds 4")
end end
return itemstack return itemstack

View File

@ -3538,7 +3538,7 @@ local function register_decorations()
-- Pumpkin -- Pumpkin
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
decoration = "mcl_farming:pumpkin_face", decoration = "mcl_farming:pumpkin",
param2 = 0, param2 = 0,
param2_max = 3, param2_max = 3,
place_on = {"group:grass_block_no_snow"}, place_on = {"group:grass_block_no_snow"},

View File

@ -828,7 +828,7 @@ local function register_mgv6_decorations()
-- Pumpkin -- Pumpkin
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
decoration = "mcl_farming:pumpkin_face", decoration = "mcl_farming:pumpkin",
param2 = 0, param2 = 0,
param2_max = 3, param2_max = 3,
place_on = {"group:grass_block_no_snow"}, place_on = {"group:grass_block_no_snow"},