1
0
Fork 0

Merge branch 'master' into cocoa_pod_fixes

This commit is contained in:
FossFanatic 2022-11-18 08:27:19 +00:00
commit dec2c2bade
57 changed files with 2710 additions and 1697 deletions

View File

@ -30,6 +30,8 @@ local DEFAULT_WALK_CHANCE = 33 -- chance to walk in percent, if no player nearby
local PLAYER_SCAN_INTERVAL = 5 -- every X seconds, villager looks for players nearby local PLAYER_SCAN_INTERVAL = 5 -- every X seconds, villager looks for players nearby
local PLAYER_SCAN_RADIUS = 4 -- scan radius for looking for nearby players local PLAYER_SCAN_RADIUS = 4 -- scan radius for looking for nearby players
local RESETTLE_DISTANCE = 100 -- If a mob is transported this far from home, it gives up bed and job and resettles
local PATHFINDING = "gowp" local PATHFINDING = "gowp"
--[=======[ TRADING ]=======] --[=======[ TRADING ]=======]
@ -885,11 +887,18 @@ local function has_golem(pos)
end end
end end
local function monsters_near(self)
for _,o in pairs(minetest.get_objects_inside_radius(self.object:get_pos(),10)) do
local l = o:get_luaentity()
if l and l.type =="monster" then return true end
end
end
local function has_summon_participants(self) local function has_summon_participants(self)
local r = 0 local r = 0
for _,o in pairs(minetest.get_objects_inside_radius(self.object:get_pos(),10)) do for _,o in pairs(minetest.get_objects_inside_radius(self.object:get_pos(),10)) do
local l = o:get_luaentity() local l = o:get_luaentity()
--TODO check for panicking or gossiping --TODO check for gossiping
if l and l.name == "mobs_mc:villager" then r = r + 1 end if l and l.name == "mobs_mc:villager" then r = r + 1 end
end end
return r > 2 return r > 2
@ -913,7 +922,8 @@ local function check_summon(self,dtime)
if self._summon_timer and self._summon_timer > 30 then if self._summon_timer and self._summon_timer > 30 then
local pos = self.object:get_pos() local pos = self.object:get_pos()
self._summon_timer = 0 self._summon_timer = 0
if has_golem(pos) then return false end if has_golem(pos) then return end
if not monsters_near(self) then return end
if not has_summon_participants(self) then return end if not has_summon_participants(self) then return end
summon_golem(self) summon_golem(self)
elseif self._summon_timer == nil then elseif self._summon_timer == nil then
@ -1089,15 +1099,8 @@ local function retrieve_my_jobsite (self)
return return
end end
local function validate_jobsite(self) local function remove_job (self)
if self._profession == "unemployed" then return false end
if not retrieve_my_jobsite (self) then
self._jobsite = nil self._jobsite = nil
if self.order == WORK then
self.order = nil
end
if not has_traded(self) then if not has_traded(self) then
mcl_log("Cannot retrieve my jobsite. I am now unemployed.") mcl_log("Cannot retrieve my jobsite. I am now unemployed.")
self._profession = "unemployed" self._profession = "unemployed"
@ -1106,8 +1109,28 @@ local function validate_jobsite(self)
else else
mcl_log("Cannot retrieve my jobsite but I've traded so only remove jobsite.") mcl_log("Cannot retrieve my jobsite but I've traded so only remove jobsite.")
end end
end
local function validate_jobsite(self)
if self._profession == "unemployed" then return false end
local job_block = retrieve_my_jobsite (self)
if not job_block then
if self.order == WORK then
self.order = nil
end
remove_job (self)
return false return false
else else
local resettle = vector.distance(self.object:get_pos(),self._jobsite) > RESETTLE_DISTANCE
mcl_log("Jobsite far, so resettle: " .. tostring(resettle))
if resettle then
local m = minetest.get_meta(self._jobsite)
m:set_string("villager", nil)
remove_job (self)
return false
end
return true return true
end end
end end
@ -1222,6 +1245,17 @@ local function validate_bed(self)
local bed_valid = true local bed_valid = true
local m = minetest.get_meta(self._bed) local m = minetest.get_meta(self._bed)
local resettle = vector.distance(self.object:get_pos(),self._bed) > RESETTLE_DISTANCE
mcl_log("Bed far, so resettle: " .. tostring(resettle))
if resettle then
mcl_log("Resettled. Ditch bed.")
m:set_string("villager", nil)
self._bed = nil
bed_valid = false
return false
end
local owned_by_player = m:get_string("player") local owned_by_player = m:get_string("player")
mcl_log("Player owner: " .. owned_by_player) mcl_log("Player owner: " .. owned_by_player)
if owned_by_player ~= "" then if owned_by_player ~= "" then
@ -1229,7 +1263,7 @@ local function validate_bed(self)
m:set_string("villager", nil) m:set_string("villager", nil)
self._bed = nil self._bed = nil
bed_valid = false bed_valid = false
return return false
end end
if m:get_string("villager") ~= self._id then if m:get_string("villager") ~= self._id then
@ -1245,6 +1279,10 @@ end
local function do_activity (self) local function do_activity (self)
-- Maybe just check we're pathfinding first? -- Maybe just check we're pathfinding first?
if self.following then
mcl_log("Following, so do not do activity.")
return
end
if not validate_bed(self) and self.state ~= PATHFINDING then if not validate_bed(self) and self.state ~= PATHFINDING then
if self.order == SLEEP then self.order = nil end if self.order == SLEEP then self.order = nil end

View File

@ -1,7 +1,11 @@
local mods_loaded = false local mods_loaded = false
local NIGHT_VISION_RATIO = 0.45 local NIGHT_VISION_RATIO = 0.45
local water_color = "#0b4880"
function mcl_weather.set_sky_box_clear(player) function mcl_weather.set_sky_box_clear(player)
local pos = player:get_pos()
if minetest.get_item_group(minetest.get_node(vector.new(pos.x,pos.y+1.5,pos.z)).name, "water") ~= 0 then return end
player:set_sky({ player:set_sky({
type = "regular", type = "regular",
sky_color = { sky_color = {
@ -16,6 +20,16 @@ function mcl_weather.set_sky_box_clear(player)
}) })
end end
function mcl_weather.set_sky_color(player, def)
local pos = player:get_pos()
if minetest.get_item_group(minetest.get_node(vector.new(pos.x,pos.y+1.5,pos.z)).name, "water") ~= 0 then return end
player:set_sky({
type = def.type,
sky_color = def.sky_color,
clouds = def.clouds,
})
end
mcl_weather.skycolor = { mcl_weather.skycolor = {
-- Should be activated before do any effect. -- Should be activated before do any effect.
active = true, active = true,
@ -96,6 +110,19 @@ mcl_weather.skycolor = {
local pos = player:get_pos() local pos = player:get_pos()
local dim = mcl_worlds.pos_to_dimension(pos) local dim = mcl_worlds.pos_to_dimension(pos)
local has_weather = (mcl_worlds.has_weather(pos) and (mcl_weather.state == "snow" or mcl_weather.state =="rain" or mcl_weather.state == "thunder") and mcl_weather.has_snow(pos)) or ((mcl_weather.state =="rain" or mcl_weather.state == "thunder") and mcl_weather.has_rain(pos)) local has_weather = (mcl_worlds.has_weather(pos) and (mcl_weather.state == "snow" or mcl_weather.state =="rain" or mcl_weather.state == "thunder") and mcl_weather.has_snow(pos)) or ((mcl_weather.state =="rain" or mcl_weather.state == "thunder") and mcl_weather.has_rain(pos))
if minetest.get_item_group(minetest.get_node(vector.new(pos.x,pos.y+1.5,pos.z)).name, "water") ~= 0 then
player:set_sky({ type = "regular",
sky_color = {
day_sky = water_color,
day_horizon = water_color,
dawn_sky = water_color,
dawn_horizon = water_color,
night_sky = water_color,
night_horizon = water_color,
},
clouds = true,
})
end
if dim == "overworld" then if dim == "overworld" then
if (mcl_weather.state == "none") then if (mcl_weather.state == "none") then
-- Clear weather -- Clear weather
@ -108,7 +135,8 @@ mcl_weather.skycolor = {
local day_color = mcl_weather.skycolor.get_sky_layer_color(0.15) local day_color = mcl_weather.skycolor.get_sky_layer_color(0.15)
local dawn_color = mcl_weather.skycolor.get_sky_layer_color(0.27) local dawn_color = mcl_weather.skycolor.get_sky_layer_color(0.27)
local night_color = mcl_weather.skycolor.get_sky_layer_color(0.1) local night_color = mcl_weather.skycolor.get_sky_layer_color(0.1)
player:set_sky({ type = "regular", mcl_weather.set_sky_color(player, {
type = "regular",
sky_color = { sky_color = {
day_sky = day_color, day_sky = day_color,
day_horizon = day_color, day_horizon = day_color,
@ -127,7 +155,8 @@ mcl_weather.skycolor = {
local day_color = mcl_weather.skycolor.get_sky_layer_color(0.5) local day_color = mcl_weather.skycolor.get_sky_layer_color(0.5)
local dawn_color = mcl_weather.skycolor.get_sky_layer_color(0.75) local dawn_color = mcl_weather.skycolor.get_sky_layer_color(0.75)
local night_color = mcl_weather.skycolor.get_sky_layer_color(0) local night_color = mcl_weather.skycolor.get_sky_layer_color(0)
player:set_sky({ type = "regular", mcl_weather.set_sky_color(player, {
type = "regular",
sky_color = { sky_color = {
day_sky = day_color, day_sky = day_color,
day_horizon = day_color, day_horizon = day_color,
@ -178,7 +207,7 @@ mcl_weather.skycolor = {
} }
local biometint = nether_sky[minetest.get_biome_name(minetest.get_biome_data(player:get_pos()).biome)] local biometint = nether_sky[minetest.get_biome_name(minetest.get_biome_data(player:get_pos()).biome)]
player:set_sky({ mcl_weather.set_sky_color(player, {
type = "regular", type = "regular",
sky_color = { sky_color = {
day_sky = "#300808", day_sky = "#300808",

View File

@ -389,6 +389,40 @@ awards.register_achievement("mcl:theEndAgain", {
group = "End", group = "End",
}) })
-- Triggered in mcl_beehives
awards.register_achievement("mcl:bee_our_guest", {
title = S("Bee Our Guest"),
description = S("Use a campfire to collect a bottle of honey from a beehive without aggrivating the bees inside."),
icon = "mcl_honey_honey_bottle.png",
type = "Advancement",
group = "Husbandry",
})
awards.register_achievement("mcl:total_beelocation", {
title = S("Total Beelocation"),
description = S("Move a bee nest, with 3 bees inside, using a silk touch enchanted tool."),
icon = "mcl_beehives_bee_nest_front_honey.png",
type = "Advancement",
group = "Husbandry",
})
-- Triggered in mcl_copper
awards.register_achievement("mcl:wax_on", {
title = S("Wax On"),
description = S("Apply honeycomb to a copper block to protect it from the elements."),
icon = "mcl_honey_honeycomb.png",
type = "Advancement",
group = "Husbandry",
})
awards.register_achievement("mcl:wax_off", {
title = S("Wax Off"),
description = S("Scrape wax off of a copper block."),
icon = "default_tool_stoneaxe.png",
type = "Advancement",
group = "Husbandry",
})
-- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.) -- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.)
if non_pc_achievements then if non_pc_achievements then

View File

@ -87,3 +87,11 @@ Sky's The Limit=
Find the elytra and prepare to fly above and beyond!= Find the elytra and prepare to fly above and beyond!=
Free the End= Free the End=
Kill the ender dragon. Good Luck!= Kill the ender dragon. Good Luck!=
Bee Our Guest=
Use a campfire to collect a bottle of honey from a beehive without aggrivating the bees inside.=
Total Beelocation=
Move a bee nest, with 3 bees inside, using a silk touch enchanted tool.=
Wax On=
Apply honeycomb to a copper block to protect it from the elements.=
Wax Off=
Scrape wax off of a copper block.=

View File

@ -364,7 +364,7 @@ function mesecon.mvps_move_objects(pos, dir, nodestack)
for _, r in ipairs(mesecon.rules.alldirs) do for _, r in ipairs(mesecon.rules.alldirs) do
local adjpos = vector.add(np, r) local adjpos = vector.add(np, r)
local adjnode = minetest.get_node(adjpos) local adjnode = minetest.get_node(adjpos)
if minetest.registered_nodes[adjnode.name] and minetest.registered_nodes[adjnode.name].mvps_sticky then if minetest.registered_nodes[adjnode.name] and minetest.registered_nodes[adjnode.name].mvps_sticky and adjnode.name == "mcl_core:slimeblock" then
local np = vector.add(obj:get_pos(), dir) local np = vector.add(obj:get_pos(), dir)
-- Reset acceleration of all objects before launching. -- Reset acceleration of all objects before launching.

View File

@ -0,0 +1,230 @@
------------------
---- Beehives ----
------------------
-- Variables
local S = minetest.get_translator(minetest.get_current_modname())
-- Function to allow harvesting honey and honeycomb from the beehive and bee nest.
local honey_harvest = function(pos, node, player, itemstack, pointed_thing)
local inv = player:get_inventory()
local shears = player:get_wielded_item():get_name() == "mcl_tools:shears"
local bottle = player:get_wielded_item():get_name() == "mcl_potions:glass_bottle"
local beehive = "mcl_beehives:beehive"
local is_creative = minetest.is_creative_enabled(player:get_player_name())
if node.name == "mcl_beehives:beehive_5" then
beehive = "mcl_beehives:beehive"
elseif node.name == "mcl_beehives:bee_nest_5" then
beehive = "mcl_beehives:bee_nest"
end
local campfire_area = vector.offset(pos, 0, -5, 0)
local campfire = minetest.find_nodes_in_area(pos, campfire_area, "group:lit_campfire")
if bottle then
local honey = "mcl_honey:honey_bottle"
if inv:room_for_item("main", honey) then
node.name = beehive
minetest.set_node(pos, node)
inv:add_item("main", "mcl_honey:honey_bottle")
if not is_creative then
itemstack:take_item()
end
if not campfire[1] then mcl_util.deal_damage(player, 10) else awards.unlock(player:get_player_name(), "mcl:bee_our_guest") end
end
elseif shears then
minetest.add_item(pos, "mcl_honey:honeycomb 3")
node.name = beehive
minetest.set_node(pos, node)
if not campfire[1] then mcl_util.deal_damage(player, 10) end
end
end
-- Dig Function for Beehives
local dig_hive = function(pos, node, oldmetadata, digger)
local wield_item = digger:get_wielded_item()
local beehive = string.find(node.name, "mcl_beehives:beehive")
local beenest = string.find(node.name, "mcl_beehives:bee_nest")
local silk_touch = mcl_enchanting.has_enchantment(wield_item, "silk_touch")
local is_creative = minetest.is_creative_enabled(digger:get_player_name())
if beehive then
minetest.add_item(pos, "mcl_beehives:beehive")
if not silk_touch and not is_creative then mcl_util.deal_damage(digger, 10) end
elseif beenest then
if silk_touch or is_creative then
minetest.add_item(pos, "mcl_beehives:bee_nest")
awards.unlock(digger:get_player_name(), "mcl:total_beelocation")
else
mcl_util.deal_damage(digger, 10)
end
end
end
-- Beehive
minetest.register_node("mcl_beehives:beehive", {
description = S("Beehive"),
_doc_items_longdesc = S("Artificial bee nest."),
tiles = {
"mcl_beehives_beehive_end.png", "mcl_beehives_beehive_end.png",
"mcl_beehives_beehive_side.png", "mcl_beehives_beehive_side.png",
"mcl_beehives_beehive_side.png", "mcl_beehives_beehive_front.png",
},
paramtype2 = "facedir",
groups = { axey = 1, deco_block = 1, flammable = 0, fire_flammability = 5, material_wood = 1, beehive = 1 },
_mcl_blast_resistance = 0.6,
_mcl_hardness = 0.6,
drop = "",
after_dig_node = dig_hive,
})
for l = 1, 4 do
minetest.register_node("mcl_beehives:beehive_" .. l, {
description = S("Beehive"),
_doc_items_longdesc = S("Artificial bee nest."),
tiles = {
"mcl_beehives_beehive_end.png", "mcl_beehives_beehive_end.png",
"mcl_beehives_beehive_side.png", "mcl_beehives_beehive_side.png",
"mcl_beehives_beehive_side.png", "mcl_beehives_beehive_front.png",
},
paramtype2 = "facedir",
groups = { axey = 1, deco_block = 1, flammable = 0, fire_flammability = 5, material_wood = 1, not_in_creative_inventory = 1, beehive = 1 },
_mcl_blast_resistance = 0.6,
_mcl_hardness = 0.6,
drop = "",
after_dig_node = dig_hive,
})
end
minetest.register_node("mcl_beehives:beehive_5", {
description = S("Beehive"),
_doc_items_longdesc = S("Artificial bee nest."),
tiles = {
"mcl_beehives_beehive_end.png", "mcl_beehives_beehive_end.png",
"mcl_beehives_beehive_side.png", "mcl_beehives_beehive_side.png",
"mcl_beehives_beehive_side.png", "mcl_beehives_beehive_front_honey.png",
},
paramtype2 = "facedir",
groups = { axey = 1, deco_block = 1, flammable = 0, fire_flammability = 5, material_wood = 1, not_in_creative_inventory = 1, beehive = 1 },
_mcl_blast_resistance = 0.6,
_mcl_hardness = 0.6,
on_rightclick = honey_harvest,
drop = "",
after_dig_node = dig_hive,
})
-- Bee Nest
minetest.register_node("mcl_beehives:bee_nest", {
description = S("Bee Nest"),
_doc_items_longdesc = S("A naturally generating block that houses bees and a tasty treat...if you can get it."),
tiles = {
"mcl_beehives_bee_nest_top.png", "mcl_beehives_bee_nest_bottom.png",
"mcl_beehives_bee_nest_side.png", "mcl_beehives_bee_nest_side.png",
"mcl_beehives_bee_nest_side.png", "mcl_beehives_bee_nest_front.png",
},
paramtype2 = "facedir",
groups = { axey = 1, deco_block = 1, flammable = 0, fire_flammability = 30, bee_nest = 1 },
_mcl_blast_resistance = 0.3,
_mcl_hardness = 0.3,
drop = "",
after_dig_node = dig_hive,
})
for i = 1, 4 do
minetest.register_node("mcl_beehives:bee_nest_"..i, {
description = S("Bee Nest"),
_doc_items_longdesc = S("A naturally generating block that houses bees and a tasty treat...if you can get it."),
tiles = {
"mcl_beehives_bee_nest_top.png", "mcl_beehives_bee_nest_bottom.png",
"mcl_beehives_bee_nest_side.png", "mcl_beehives_bee_nest_side.png",
"mcl_beehives_bee_nest_side.png", "mcl_beehives_bee_nest_front.png",
},
paramtype2 = "facedir",
groups = { axey = 1, deco_block = 1, flammable = 0, fire_flammability = 30, not_in_creative_inventory = 1, bee_nest = 1 },
_mcl_blast_resistance = 0.3,
_mcl_hardness = 0.3,
drop = "",
after_dig_node = dig_hive,
})
end
minetest.register_node("mcl_beehives:bee_nest_5", {
description = S("Bee Nest"),
_doc_items_longdesc = S("A naturally generating block that houses bees and a tasty treat...if you can get it."),
tiles = {
"mcl_beehives_bee_nest_top.png", "mcl_beehives_bee_nest_bottom.png",
"mcl_beehives_bee_nest_side.png", "mcl_beehives_bee_nest_side.png",
"mcl_beehives_bee_nest_side.png", "mcl_beehives_bee_nest_front_honey.png",
},
paramtype2 = "facedir",
groups = { axey = 1, deco_block = 1, flammable = 0, fire_flammability = 30, not_in_creative_inventory = 1, bee_nest = 1 },
_mcl_blast_resistance = 0.3,
_mcl_hardness = 0.3,
on_rightclick = honey_harvest,
drop = "",
after_dig_node = dig_hive,
})
-- Crafting
minetest.register_craft({
output = "mcl_beehives:beehive",
recipe = {
{ "group:wood", "group:wood", "group:wood" },
{ "mcl_honey:honeycomb", "mcl_honey:honeycomb", "mcl_honey:honeycomb" },
{ "group:wood", "group:wood", "group:wood" },
},
})
-- Temporary ABM to update honey levels
minetest.register_abm({
label = "Update Beehive Honey Levels",
nodenames = "group:beehive",
interval = 500,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local beehive = "mcl_beehives:beehive"
if node.name == beehive then
node.name = beehive.."_1"
minetest.set_node(pos, node)
elseif node.name == beehive.."_1" then
node.name = beehive.."_2"
minetest.set_node(pos, node)
elseif node.name == beehive.."_2" then
node.name = beehive.."_3"
minetest.set_node(pos, node)
elseif node.name == beehive.."_3" then
node.name = beehive.."_4"
minetest.set_node(pos, node)
elseif node.name == beehive.."_4" then
node.name = beehive.."_5"
minetest.set_node(pos, node)
end
end,
})
minetest.register_abm({
label = "Update Bee Nest Honey Levels",
nodenames = "group:bee_nest",
interval = 500,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local beehive = "mcl_beehives:bee_nest"
if node.name == beehive then
node.name = beehive.."_1"
minetest.set_node(pos, node)
elseif node.name == beehive.."_1" then
node.name = beehive.."_2"
minetest.set_node(pos, node)
elseif node.name == beehive.."_2" then
node.name = beehive.."_3"
minetest.set_node(pos, node)
elseif node.name == beehive.."_3" then
node.name = beehive.."_4"
minetest.set_node(pos, node)
elseif node.name == beehive.."_4" then
node.name = beehive.."_5"
minetest.set_node(pos, node)
end
end,
})

View File

@ -0,0 +1,4 @@
Beehive=
Artificial bee nest.=
Bee Nest=
A naturally generating block that houses bees and a tasty treat...if you can get it.=

View File

@ -0,0 +1,4 @@
name = mcl_beehives
author = PrairieWind
description = Adds beehives and bee nests to MineClone 2.
depends = mcl_util, mcl_enchanting

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -47,6 +47,17 @@ minetest.register_craft({
}, },
}) })
local waxable_blocks = { "block", "block_cut", "block_exposed", "block_exposed_cut", "block_weathered", "block_weathered_cut", "block_oxidized", "block_oxidized_cut" }
for _, w in ipairs(waxable_blocks) do
minetest.register_craft({
output = "mcl_copper:waxed_"..w,
recipe = {
{ "mcl_copper:"..w, "mcl_honey:honeycomb" },
},
})
end
minetest.register_craft({ minetest.register_craft({
output = "mcl_copper:copper_ingot 4", output = "mcl_copper:copper_ingot 4",
recipe = { recipe = {
@ -74,3 +85,10 @@ minetest.register_craft({
recipe = "mcl_copper:stone_with_copper", recipe = "mcl_copper:stone_with_copper",
cooktime = 10, cooktime = 10,
}) })
minetest.register_craft({
type = "cooking",
output = "mcl_copper:block",
recipe = "mcl_copper:block_raw",
cooktime = 90,
})

View File

@ -12,6 +12,34 @@ local function register_oxidation_abm(abm_name, node_name, oxidized_variant)
}) })
end end
function waxing_copper_block(pos, node, player, itemstack, convert_to)
if itemstack:get_name() == "mcl_honey:honeycomb" then
node.name = convert_to
minetest.set_node(pos, node)
awards.unlock(player:get_player_name(), "mcl:wax_on")
if not minetest.is_creative_enabled(player:get_player_name()) then
itemstack:take_item()
end
else
return true
end
end
function scraping_copper_block(pos, node, player, itemstack, convert_to)
if itemstack:get_name():find("axe") then
node.name = convert_to
minetest.set_node(pos, node)
awards.unlock(player:get_player_name(), "mcl:wax_off")
if not minetest.is_creative_enabled(player:get_player_name()) then
local tool = itemstack:get_name()
local wear = mcl_autogroup.get_wear(tool, "axey")
itemstack:add_wear(wear)
end
else
return true
end
end
--[[ --[[
local stairs = { local stairs = {
{"stair", "exposed", "_inner", "cut_inner"}, {"stair", "exposed", "_inner", "cut_inner"},

View File

@ -1,6 +1,6 @@
local path = minetest.get_modpath("mcl_copper") local path = minetest.get_modpath("mcl_copper")
dofile(path .. "/functions.lua")
dofile(path .. "/nodes.lua") dofile(path .. "/nodes.lua")
dofile(path .. "/items.lua") dofile(path .. "/items.lua")
dofile(path .. "/crafting.lua") dofile(path .. "/crafting.lua")
dofile(path .. "/functions.lua")

View File

@ -11,5 +11,5 @@ minetest.register_craftitem("mcl_copper:raw_copper", {
description = S("Raw Copper"), description = S("Raw Copper"),
_doc_items_longdesc = S("Raw Copper. Mine a Copper Ore to get it."), _doc_items_longdesc = S("Raw Copper. Mine a Copper Ore to get it."),
inventory_image = "mcl_copper_raw.png", inventory_image = "mcl_copper_raw.png",
groups = { craftitem = 1 }, groups = { craftitem = 1, blast_furnace_smeltable = 1 },
}) })

View File

@ -2,36 +2,56 @@
A block of copper is mostly a decorative block.= A block of copper is mostly a decorative block.=
A block used for compact raw copper storage.= A block used for compact raw copper storage.=
Block of Copper= Block of Copper=
Waxed Block of Copper=
Block of Raw Copper= Block of Raw Copper=
Copper Ingot= Copper Ingot=
Copper Ore= Copper Ore=
Cut copper is a decorative block.= Cut copper is a decorative block.=
Cut Copper= Cut Copper=
Waxed Cut Copper=
Double Slab of Cut Copper= Double Slab of Cut Copper=
Double Slab of Exposed Cut Copper= Double Slab of Exposed Cut Copper=
Double Slab of Oxidized Cut Copper= Double Slab of Oxidized Cut Copper=
Double Slab of Weathered Cut Copper= Double Slab of Weathered Cut Copper=
Waxed Double Slab of Cut Copper=
Waxed Double Slab of Exposed Cut Copper=
Waxed Double Slab of Oxidized Cut Copper=
Waxed Double Slab of Weathered Cut Copper=
Exposed copper is a decorative block.= Exposed copper is a decorative block.=
Exposed Copper= Exposed Copper=
Waxed Exposed Copper=
Exposed cut copper is a decorative block.= Exposed cut copper is a decorative block.=
Exposed Cut Copper= Exposed Cut Copper=
Waxed Exposed Cut Copper=
Molten Raw Copper. It is used to craft blocks.= Molten Raw Copper. It is used to craft blocks.=
Oxidized copper is a decorative block.= Oxidized copper is a decorative block.=
Oxidized Copper= Oxidized Copper=
Waxed Oxidized Copper=
Oxidized cut copper is a decorative block.= Oxidized cut copper is a decorative block.=
Oxidized Cut Copper= Oxidized Cut Copper=
Waxed Oxidized Cut Copper=
Raw Copper. Mine a Copper Ore to get it.= Raw Copper. Mine a Copper Ore to get it.=
Raw Copper= Raw Copper=
Slab of Cut Copper= Slab of Cut Copper=
Slab of Exposed Cut Copper= Slab of Exposed Cut Copper=
Slab of Oxidized Cut Copper= Slab of Oxidized Cut Copper=
Slab of Weathered Cut Copper= Slab of Weathered Cut Copper=
Waxed Slab of Cut Copper=
Waxed Slab of Exposed Cut Copper=
Waxed Slab of Oxidized Cut Copper=
Waxed Slab of Weathered Cut Copper=
Some copper contained in stone, it is pretty common and can be found below sea level.= Some copper contained in stone, it is pretty common and can be found below sea level.=
Stairs of Cut Copper= Stairs of Cut Copper=
Stairs of Exposed Cut Copper= Stairs of Exposed Cut Copper=
Stairs of Oxidized Cut Copper= Stairs of Oxidized Cut Copper=
Stairs of Weathered Cut Copper= Stairs of Weathered Cut Copper=
Waxed Stairs of Cut Copper=
Waxed Stairs of Exposed Cut Copper=
Waxed Stairs of Oxidized Cut Copper=
Waxed Stairs of Weathered Cut Copper=
Weathered copper is a decorative block.= Weathered copper is a decorative block.=
Weathered Copper= Weathered Copper=
Waxed Weathered Copper=
Weathered cut copper is a decorative block.= Weathered cut copper is a decorative block.=
Weathered Cut Copper= Weathered Cut Copper=
Waxed Weathered Cut Copper=

View File

@ -20,7 +20,7 @@ minetest.register_node("mcl_copper:block_raw", {
_doc_items_longdesc = S("A block used for compact raw copper storage."), _doc_items_longdesc = S("A block used for compact raw copper storage."),
tiles = {"mcl_copper_block_raw.png"}, tiles = {"mcl_copper_block_raw.png"},
is_ground_content = false, is_ground_content = false,
groups = {pickaxey = 2, building_block = 1}, groups = {pickaxey = 2, building_block = 1, blast_furnace_smeltable = 1 },
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 5, _mcl_hardness = 5,
@ -35,6 +35,19 @@ minetest.register_node("mcl_copper:block", {
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 3, _mcl_hardness = 3,
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block") end,
})
minetest.register_node("mcl_copper:waxed_block", {
description = S("Waxed Block of Copper"),
_doc_items_longdesc = S("A block of copper is mostly a decorative block."),
tiles = {"mcl_copper_block.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 3,
on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block") end,
}) })
minetest.register_node("mcl_copper:block_exposed", { minetest.register_node("mcl_copper:block_exposed", {
@ -47,18 +60,19 @@ minetest.register_node("mcl_copper:block_exposed", {
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 5, _mcl_hardness = 5,
_mcl_anti_oxidation_varient = "mcl_copper:block", _mcl_anti_oxidation_varient = "mcl_copper:block",
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block_exposed") end,
}) })
minetest.register_node("mcl_copper:block_oxidized", { minetest.register_node("mcl_copper:waxed_block_exposed", {
description = S("Oxidized Copper"), description = S("Waxed Exposed Copper"),
_doc_items_longdesc = S("Oxidized copper is a decorative block."), _doc_items_longdesc = S("Exposed copper is a decorative block."),
tiles = {"mcl_copper_oxidized.png"}, tiles = {"mcl_copper_exposed.png"},
is_ground_content = false, is_ground_content = false,
groups = {pickaxey = 2, building_block = 1}, groups = {pickaxey = 2, building_block = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 5, _mcl_hardness = 5,
_mcl_anti_oxidation_varient = "mcl_copper:block_weathered", on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block") end,
}) })
minetest.register_node("mcl_copper:block_weathered", { minetest.register_node("mcl_copper:block_weathered", {
@ -71,6 +85,44 @@ minetest.register_node("mcl_copper:block_weathered", {
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 5, _mcl_hardness = 5,
_mcl_anti_oxidation_varient = "mcl_copper:block_exposed", _mcl_anti_oxidation_varient = "mcl_copper:block_exposed",
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block_weathered") end,
})
minetest.register_node("mcl_copper:waxed_block_weathered", {
description = S("Waxed Weathered Copper"),
_doc_items_longdesc = S("Weathered copper is a decorative block."),
tiles = {"mcl_copper_weathered.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block_exposed") end,
})
minetest.register_node("mcl_copper:block_oxidized", {
description = S("Oxidized Copper"),
_doc_items_longdesc = S("Oxidized copper is a decorative block."),
tiles = {"mcl_copper_oxidized.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
_mcl_anti_oxidation_varient = "mcl_copper:block_weathered",
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block_oxidized") end,
})
minetest.register_node("mcl_copper:waxed_block_oxidized", {
description = S("Waxed Oxidized Copper"),
_doc_items_longdesc = S("Oxidized copper is a decorative block."),
tiles = {"mcl_copper_oxidized.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block_weather") end,
}) })
minetest.register_node("mcl_copper:block_cut", { minetest.register_node("mcl_copper:block_cut", {
@ -82,6 +134,19 @@ minetest.register_node("mcl_copper:block_cut", {
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 5, _mcl_hardness = 5,
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block_cut") end,
})
minetest.register_node("mcl_copper:waxed_block_cut", {
description = S("Waxed Cut Copper"),
_doc_items_longdesc = S("Cut copper is a decorative block."),
tiles = {"mcl_copper_block_cut.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block_cut") end,
}) })
minetest.register_node("mcl_copper:block_exposed_cut", { minetest.register_node("mcl_copper:block_exposed_cut", {
@ -94,18 +159,19 @@ minetest.register_node("mcl_copper:block_exposed_cut", {
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 5, _mcl_hardness = 5,
_mcl_anti_oxidation_varient = "mcl_copper:block_cut", _mcl_anti_oxidation_varient = "mcl_copper:block_cut",
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block_exposed_cut") end,
}) })
minetest.register_node("mcl_copper:block_oxidized_cut", { minetest.register_node("mcl_copper:waxed_block_exposed_cut", {
description = S("Oxidized Cut Copper"), description = S("Waxed Exposed Cut Copper"),
_doc_items_longdesc = S("Oxidized cut copper is a decorative block."), _doc_items_longdesc = S("Exposed cut copper is a decorative block."),
tiles = {"mcl_copper_oxidized_cut.png"}, tiles = {"mcl_copper_exposed_cut.png"},
is_ground_content = false, is_ground_content = false,
groups = {pickaxey = 2, building_block = 1}, groups = {pickaxey = 2, building_block = 1},
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 5, _mcl_hardness = 5,
_mcl_anti_oxidation_varient = "mcl_copper:block_weathered_cut", on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block_cut") end,
}) })
minetest.register_node("mcl_copper:block_weathered_cut", { minetest.register_node("mcl_copper:block_weathered_cut", {
@ -118,6 +184,44 @@ minetest.register_node("mcl_copper:block_weathered_cut", {
_mcl_blast_resistance = 6, _mcl_blast_resistance = 6,
_mcl_hardness = 5, _mcl_hardness = 5,
_mcl_anti_oxidation_varient = "mcl_copper:block_exposed_cut", _mcl_anti_oxidation_varient = "mcl_copper:block_exposed_cut",
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block_weathered_cut") end,
})
minetest.register_node("mcl_copper:waxed_block_weathered_cut", {
description = S("Waxed Weathered Cut Copper"),
_doc_items_longdesc = S("Weathered cut copper is a decorative block."),
tiles = {"mcl_copper_weathered_cut.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block_exposed_cut") end,
})
minetest.register_node("mcl_copper:block_oxidized_cut", {
description = S("Oxidized Cut Copper"),
_doc_items_longdesc = S("Oxidized cut copper is a decorative block."),
tiles = {"mcl_copper_oxidized_cut.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
_mcl_anti_oxidation_varient = "mcl_copper:block_weathered_cut",
on_rightclick = function(pos, node, player, itemstack) waxing_copper_block(pos, node, player, itemstack, "mcl_copper:waxed_block_oxidized_cut") end,
})
minetest.register_node("mcl_copper:waxed_block_oxidized_cut", {
description = S("Waxed Oxidized Cut Copper"),
_doc_items_longdesc = S("Oxidized cut copper is a decorative block."),
tiles = {"mcl_copper_oxidized_cut.png"},
is_ground_content = false,
groups = {pickaxey = 2, building_block = 1},
sounds = mcl_sounds.node_sound_metal_defaults(),
_mcl_blast_resistance = 6,
_mcl_hardness = 5,
on_rightclick = function(pos, node, player, itemstack) scraping_copper_block(pos, node, player, itemstack, "mcl_copper:block_weathered_cut") end,
}) })
mcl_stairs.register_slab("copper_cut", "mcl_copper:block_cut", mcl_stairs.register_slab("copper_cut", "mcl_copper:block_cut",
@ -127,6 +231,13 @@ mcl_stairs.register_slab("copper_cut", "mcl_copper:block_cut",
nil, nil, nil, nil, nil, nil,
S("Double Slab of Cut Copper")) S("Double Slab of Cut Copper"))
mcl_stairs.register_slab("waxed_copper_cut", "mcl_copper:waxed_block_cut",
{pickaxey = 2},
{"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"},
S("Waxed Slab of Cut Copper"),
nil, nil, nil,
S("Waxed Double Slab of Cut Copper"))
mcl_stairs.register_slab("copper_exposed_cut", "mcl_copper:block_exposed_cut", mcl_stairs.register_slab("copper_exposed_cut", "mcl_copper:block_exposed_cut",
{pickaxey = 2}, {pickaxey = 2},
{"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"}, {"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"},
@ -134,12 +245,12 @@ mcl_stairs.register_slab("copper_exposed_cut", "mcl_copper:block_exposed_cut",
nil, nil, nil, nil, nil, nil,
S("Double Slab of Exposed Cut Copper")) S("Double Slab of Exposed Cut Copper"))
mcl_stairs.register_slab("copper_oxidized_cut", "mcl_copper:block_oxidized_cut", mcl_stairs.register_slab("waxed_copper_exposed_cut", "mcl_copper:waxed_block_exposed_cut",
{pickaxey = 2}, {pickaxey = 2},
{"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"}, {"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"},
S("Slab of Oxidized Cut Copper"), S("Waxed Slab of Exposed Cut Copper"),
nil, nil, nil, nil, nil, nil,
S("Double Slab of Oxidized Cut Copper")) S("Waxed Double Slab of Exposed Cut Copper"))
mcl_stairs.register_slab("copper_weathered_cut", "mcl_copper:block_weathered_cut", mcl_stairs.register_slab("copper_weathered_cut", "mcl_copper:block_weathered_cut",
{pickaxey = 2}, {pickaxey = 2},
@ -148,6 +259,27 @@ mcl_stairs.register_slab("copper_weathered_cut", "mcl_copper:block_weathered_cut
nil, nil, nil, nil, nil, nil,
S("Double Slab of Weathered Cut Copper")) S("Double Slab of Weathered Cut Copper"))
mcl_stairs.register_slab("waxed_copper_weathered_cut", "mcl_copper:waxed_block_weathered_cut",
{pickaxey = 2},
{"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"},
S("Waxed Slab of Weathered Cut Copper"),
nil, nil, nil,
S("Waxed Double Slab of Weathered Cut Copper"))
mcl_stairs.register_slab("copper_oxidized_cut", "mcl_copper:block_oxidized_cut",
{pickaxey = 2},
{"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"},
S("Slab of Oxidized Cut Copper"),
nil, nil, nil,
S("Double Slab of Oxidized Cut Copper"))
mcl_stairs.register_slab("waxed_copper_oxidized_cut", "mcl_copper:waxed_block_oxidized_cut",
{pickaxey = 2},
{"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"},
S("Waxed Slab of Oxidized Cut Copper"),
nil, nil, nil,
S("Waxed Double Slab of Oxidized Cut Copper"))
mcl_stairs.register_stair("copper_cut", "mcl_copper:block_cut", mcl_stairs.register_stair("copper_cut", "mcl_copper:block_cut",
{pickaxey = 2}, {pickaxey = 2},
{"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"}, {"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"},
@ -155,6 +287,13 @@ mcl_stairs.register_stair("copper_cut", "mcl_copper:block_cut",
nil, 6, nil, nil, 6, nil,
"woodlike") "woodlike")
mcl_stairs.register_stair("waxed_copper_cut", "mcl_copper:waxed_block_cut",
{pickaxey = 2},
{"mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png", "mcl_copper_block_cut.png"},
S("Waxed Stairs of Cut Copper"),
nil, 6, nil,
"woodlike")
mcl_stairs.register_stair("copper_exposed_cut", "mcl_copper:block_exposed_cut", mcl_stairs.register_stair("copper_exposed_cut", "mcl_copper:block_exposed_cut",
{pickaxey = 2}, {pickaxey = 2},
{"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"}, {"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"},
@ -162,10 +301,10 @@ mcl_stairs.register_stair("copper_exposed_cut", "mcl_copper:block_exposed_cut",
nil, 6, nil, nil, 6, nil,
"woodlike") "woodlike")
mcl_stairs.register_stair("copper_oxidized_cut", "mcl_copper:block_oxidized_cut", mcl_stairs.register_stair("waxed_copper_exposed_cut", "mcl_copper:waxed_block_exposed_cut",
{pickaxey = 2}, {pickaxey = 2},
{"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"}, {"mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png", "mcl_copper_exposed_cut.png"},
S("Stairs of Oxidized Cut Copper"), S("Waxed Stairs of Exposed Cut Copper"),
nil, 6, nil, nil, 6, nil,
"woodlike") "woodlike")
@ -175,3 +314,24 @@ mcl_stairs.register_stair("copper_weathered_cut", "mcl_copper:block_weathered_cu
S("Stairs of Weathered Cut Copper"), S("Stairs of Weathered Cut Copper"),
nil, 6, nil, nil, 6, nil,
"woodlike") "woodlike")
mcl_stairs.register_stair("waxed_copper_weathered_cut", "mcl_copper:waxed_block_weathered_cut",
{pickaxey = 2},
{"mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png", "mcl_copper_weathered_cut.png"},
S("Waxed Stairs of Weathered Cut Copper"),
nil, 6, nil,
"woodlike")
mcl_stairs.register_stair("copper_oxidized_cut", "mcl_copper:block_oxidized_cut",
{pickaxey = 2},
{"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"},
S("Stairs of Oxidized Cut Copper"),
nil, 6, nil,
"woodlike")
mcl_stairs.register_stair("waxed_copper_oxidized_cut", "mcl_copper:waxed_block_oxidized_cut",
{pickaxey = 2},
{"mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png", "mcl_copper_oxidized_cut.png"},
S("Waxed Stairs of Oxidized Cut Copper"),
nil, 6, nil,
"woodlike")

View File

@ -50,7 +50,7 @@ minetest.register_node("mcl_core:water_flowing", {
liquid_viscosity = WATER_VISC, liquid_viscosity = WATER_VISC,
liquid_range = 7, liquid_range = 7,
waving = 3, waving = 3,
post_effect_color = {a=209, r=0x03, g=0x3C, b=0x5C}, post_effect_color = {a=20, r=0x03, g=0x3C, b=0x5C},
groups = { water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1, freezes=1, melt_around=1, dig_by_piston=1}, groups = { water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1, freezes=1, melt_around=1, dig_by_piston=1},
_mcl_blast_resistance = 100, _mcl_blast_resistance = 100,
-- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode -- Hardness intentionally set to infinite instead of 100 (Minecraft value) to avoid problems in creative mode
@ -95,7 +95,7 @@ S("• When water is directly below lava, the water turns into stone."),
liquid_alternative_source = "mcl_core:water_source", liquid_alternative_source = "mcl_core:water_source",
liquid_viscosity = WATER_VISC, liquid_viscosity = WATER_VISC,
liquid_range = 7, liquid_range = 7,
post_effect_color = {a=209, r=0x03, g=0x3C, b=0x5C}, post_effect_color = {a=60, r=0x03, g=0x3C, b=0x5C},
stack_max = 64, stack_max = 64,
groups = { water=3, liquid=3, puts_out_fire=1, freezes=1, not_in_creative_inventory=1, dig_by_piston=1}, groups = { water=3, liquid=3, puts_out_fire=1, freezes=1, not_in_creative_inventory=1, dig_by_piston=1},
_mcl_blast_resistance = 100, _mcl_blast_resistance = 100,

View File

@ -379,6 +379,8 @@ local function apply_bone_meal(pointed_thing,user)
return false return false
end end
mcl_dye.apply_bone_meal = apply_bone_meal
minetest.register_craftitem("mcl_dye:white", { minetest.register_craftitem("mcl_dye:white", {
inventory_image = "mcl_dye_white.png", inventory_image = "mcl_dye_white.png",
description = S("Bone Meal"), description = S("Bone Meal"),

View File

@ -1,16 +1,12 @@
===FARMING MOD for MINETEST-C55=== ===FARMING MOD for MINETEST-C55===
by PilzAdam by PilzAdam
Modified heavily by MineClone 2 Dev Team.
Introduction: Introduction:
This mod adds farming to Minetest. This mod adds farming to Minetest.
How to install: How to install see:
Unzip the archive an place it in minetest-base-directory/mods/minetest/
if you have a windows client or a linux run-in-place client. If you have
a linux system-wide instalation place it in ~/.minetest/mods/minetest/.
If you want to install this mod only in one world create the folder
worldmods/ in your worlddirectory.
For further information or help see:
http://wiki.minetest.com/wiki/Installing_Mods http://wiki.minetest.com/wiki/Installing_Mods
How to use the mod: How to use the mod:
@ -25,22 +21,8 @@ For further information or help see:
http://minetest.net/forum/viewtopic.php?id=2787 http://minetest.net/forum/viewtopic.php?id=2787
License: License:
Sourcecode: WTFPL (see below) Sourcecode: CC-BY-SA 4 (see below)
Graphics: WTFPL (see below) Graphics: CC-BY-SA 4 (see below)
See also: See also:
http://minetest.net/ http://minetest.net/
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

View File

@ -69,7 +69,7 @@ function mcl_farming:add_plant(identifier, full_grown, names, interval, chance)
interval = interval, interval = interval,
chance = chance, chance = chance,
action = function(pos, node) action = function(pos, node)
local low_speed = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name ~= "mcl_farming:soil_wet" local low_speed = minetest.get_node({ x = pos.x, y = pos.y - 1, z = pos.z }).name ~= "mcl_farming:soil_wet"
mcl_farming:grow_plant(identifier, pos, node, false, false, low_speed) mcl_farming:grow_plant(identifier, pos, node, false, false, low_speed)
end, end,
}) })
@ -130,7 +130,7 @@ function mcl_farming:grow_plant(identifier, pos, node, stages, ignore_light, low
stages = 1 stages = 1
end end
stages = stages + math.ceil(intervals_counter) stages = stages + math.ceil(intervals_counter)
local new_node = {name = plant_info.names[step+stages]} local new_node = { name = plant_info.names[step + stages] }
if new_node.name == nil then if new_node.name == nil then
new_node.name = plant_info.full_grown new_node.name = plant_info.full_grown
end end
@ -157,14 +157,14 @@ function mcl_farming:place_seed(itemstack, placer, pointed_thing, plantname)
end end
end end
local pos = {x=pt.above.x, y=pt.above.y-1, z=pt.above.z} local pos = { x = pt.above.x, y = pt.above.y - 1, z = pt.above.z }
local farmland = minetest.get_node(pos) local farmland = minetest.get_node(pos)
pos= {x=pt.above.x, y=pt.above.y, z=pt.above.z} pos = { x = pt.above.x, y = pt.above.y, z = pt.above.z }
local place_s = minetest.get_node(pos) local place_s = minetest.get_node(pos)
if string.find(farmland.name, "mcl_farming:soil") and string.find(place_s.name, "air") then if string.find(farmland.name, "mcl_farming:soil") and string.find(place_s.name, "air") then
minetest.sound_play(minetest.registered_nodes[plantname].sounds.place, {pos = pos}, true) minetest.sound_play(minetest.registered_nodes[plantname].sounds.place, { pos = pos }, true)
minetest.add_node(pos, {name=plantname, param2 = minetest.registered_nodes[plantname].place_param2}) minetest.add_node(pos, { name = plantname, param2 = minetest.registered_nodes[plantname].place_param2 })
--local intervals_counter = get_intervals_counter(pos, 1, 1) --local intervals_counter = get_intervals_counter(pos, 1, 1)
else else
return return
@ -179,7 +179,7 @@ end
--[[ Helper function to create a gourd (e.g. melon, pumpkin), the connected stem nodes as --[[ Helper function to create a gourd (e.g. melon, pumpkin), the connected stem nodes as
- full_unconnected_stem: itemstring of the full-grown but unconnceted stem node. This node must already be done - full_unconnected_stem: itemstring of the full-grown but unconnected stem node. This node must already be done
- connected_stem_basename: prefix of the itemstrings used for the 4 connected stem nodes to create - connected_stem_basename: prefix of the itemstrings used for the 4 connected stem nodes to create
- stem_itemstring: Desired itemstring of the fully-grown unconnected stem node - stem_itemstring: Desired itemstring of the fully-grown unconnected stem node
- 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
@ -202,10 +202,10 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
} }
local neighbors = { local neighbors = {
{ x=-1, y=0, z=0 }, { x = -1, y = 0, z = 0 },
{ x=1, y=0, z=0 }, { x = 1, y = 0, z = 0 },
{ x=0, y=0, z=-1 }, { x = 0, y = 0, z = -1 },
{ x=0, y=0, z=1 }, { x = 0, y = 0, z = 1 },
} }
-- Connect the stem at stempos to the first neighboring gourd block. -- Connect the stem at stempos to the first neighboring gourd block.
@ -215,19 +215,19 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
if stem.name ~= full_unconnected_stem then if stem.name ~= full_unconnected_stem then
return false return false
end end
for n=1, #neighbors do for n = 1, #neighbors do
local offset = neighbors[n] local offset = neighbors[n]
local blockpos = vector.add(stempos, offset) local blockpos = vector.add(stempos, offset)
local block = minetest.get_node(blockpos) local block = minetest.get_node(blockpos)
if block.name == gourd_itemstring then if block.name == gourd_itemstring then
if offset.x == 1 then if offset.x == 1 then
minetest.set_node(stempos, {name=connected_stem_names[1]}) minetest.set_node(stempos, { name = connected_stem_names[1] })
elseif offset.x == -1 then elseif offset.x == -1 then
minetest.set_node(stempos, {name=connected_stem_names[2]}) minetest.set_node(stempos, { name = connected_stem_names[2] })
elseif offset.z == 1 then elseif offset.z == 1 then
minetest.set_node(stempos, {name=connected_stem_names[3]}) minetest.set_node(stempos, { name = connected_stem_names[3] })
elseif offset.z == -1 then elseif offset.z == -1 then
minetest.set_node(stempos, {name=connected_stem_names[4]}) minetest.set_node(stempos, { name = connected_stem_names[4] })
end end
return true return true
end end
@ -238,13 +238,13 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
if not gourd_def.after_destruct then if not gourd_def.after_destruct then
gourd_def.after_destruct = function(blockpos, oldnode) 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]
local expected_stem = connected_stem_names[n] local expected_stem = connected_stem_names[n]
local stempos = vector.add(blockpos, offset) local stempos = vector.add(blockpos, offset)
local stem = minetest.get_node(stempos) local stem = minetest.get_node(stempos)
if stem.name == expected_stem then if stem.name == expected_stem then
minetest.add_node(stempos, {name=full_unconnected_stem}) minetest.add_node(stempos, { name = full_unconnected_stem })
try_connect_stem(stempos) try_connect_stem(stempos)
end end
end end
@ -253,7 +253,7 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
if not gourd_def.on_construct then if not gourd_def.on_construct then
function gourd_def.on_construct(blockpos) function gourd_def.on_construct(blockpos)
-- Connect all unconnected stems at full size -- Connect all unconnected stems at full size
for n=1, #neighbors do for n = 1, #neighbors do
local stempos = vector.add(blockpos, neighbors[n]) local stempos = vector.add(blockpos, neighbors[n])
try_connect_stem(stempos) try_connect_stem(stempos)
end end
@ -272,7 +272,7 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
stem_def.selection_box = { stem_def.selection_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.15, -0.5, -0.15, 0.15, 0.5, 0.15} { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 }
}, },
} }
end end
@ -292,7 +292,7 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
stem_def.drop = stem_drop stem_def.drop = stem_drop
end end
if stem_def.groups == nil then if stem_def.groups == nil then
stem_def.groups = {dig_immediate=3, not_in_creative_inventory=1, plant=1,attached_node=1, dig_by_water=1,destroy_by_lava_flow=1,} stem_def.groups = { dig_immediate = 3, not_in_creative_inventory = 1, plant = 1, attached_node = 1, dig_by_water = 1, destroy_by_lava_flow = 1, }
end end
if stem_def.sounds == nil then if stem_def.sounds == nil then
stem_def.sounds = mcl_sounds.node_sound_leaves_defaults() stem_def.sounds = mcl_sounds.node_sound_leaves_defaults()
@ -314,18 +314,18 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
"blank.png", -- right "blank.png", -- right
"blank.png", -- left "blank.png", -- left
connected_stem_texture, -- back connected_stem_texture, -- back
connected_stem_texture.."^[transformFX90" --front connected_stem_texture .. "^[transformFX90" --front
}, },
{ "blank.png", --top { "blank.png", --top
"blank.png", -- bottom "blank.png", -- bottom
"blank.png", -- right "blank.png", -- right
"blank.png", -- left "blank.png", -- left
connected_stem_texture.."^[transformFX90", --back connected_stem_texture .. "^[transformFX90", --back
connected_stem_texture, -- front connected_stem_texture, -- front
}, },
{ "blank.png", --top { "blank.png", --top
"blank.png", -- bottom "blank.png", -- bottom
connected_stem_texture.."^[transformFX90", -- right connected_stem_texture .. "^[transformFX90", -- right
connected_stem_texture, -- left connected_stem_texture, -- left
"blank.png", --back "blank.png", --back
"blank.png", -- front "blank.png", -- front
@ -333,25 +333,25 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
{ "blank.png", --top { "blank.png", --top
"blank.png", -- bottom "blank.png", -- bottom
connected_stem_texture, -- right connected_stem_texture, -- right
connected_stem_texture.."^[transformFX90", -- left connected_stem_texture .. "^[transformFX90", -- left
"blank.png", --back "blank.png", --back
"blank.png", -- front "blank.png", -- front
} }
} }
local connected_stem_nodebox = { local connected_stem_nodebox = {
{-0.5, -0.5, 0, 0.5, 0.5, 0}, { -0.5, -0.5, 0, 0.5, 0.5, 0 },
{-0.5, -0.5, 0, 0.5, 0.5, 0}, { -0.5, -0.5, 0, 0.5, 0.5, 0 },
{0, -0.5, -0.5, 0, 0.5, 0.5}, { 0, -0.5, -0.5, 0, 0.5, 0.5 },
{0, -0.5, -0.5, 0, 0.5, 0.5}, { 0, -0.5, -0.5, 0, 0.5, 0.5 },
} }
local connected_stem_selectionbox = { local connected_stem_selectionbox = {
{-0.1, -0.5, -0.1, 0.5, 0.2, 0.1}, { -0.1, -0.5, -0.1, 0.5, 0.2, 0.1 },
{-0.5, -0.5, -0.1, 0.1, 0.2, 0.1}, { -0.5, -0.5, -0.1, 0.1, 0.2, 0.1 },
{-0.1, -0.5, -0.1, 0.1, 0.2, 0.5}, { -0.1, -0.5, -0.1, 0.1, 0.2, 0.5 },
{-0.1, -0.5, -0.5, 0.1, 0.2, 0.1}, { -0.1, -0.5, -0.5, 0.1, 0.2, 0.1 },
} }
for i=1, 4 do for i = 1, 4 do
minetest.register_node(connected_stem_names[i], { minetest.register_node(connected_stem_names[i], {
_doc_items_create_entry = false, _doc_items_create_entry = false,
paramtype = "light", paramtype = "light",
@ -369,7 +369,7 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
}, },
tiles = connected_stem_tiles[i], tiles = connected_stem_tiles[i],
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true, use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true,
groups = {dig_immediate=3, not_in_creative_inventory=1, plant=1,attached_node=1, dig_by_water=1,destroy_by_lava_flow=1,}, groups = { dig_immediate = 3, not_in_creative_inventory = 1, plant = 1, attached_node = 1, dig_by_water = 1, destroy_by_lava_flow = 1, },
sounds = mcl_sounds.node_sound_leaves_defaults(), sounds = mcl_sounds.node_sound_leaves_defaults(),
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,
}) })
@ -380,9 +380,9 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
end end
minetest.register_abm({ minetest.register_abm({
label = "Grow gourd stem to gourd ("..full_unconnected_stem..""..gourd_itemstring..")", label = "Grow gourd stem to gourd (" .. full_unconnected_stem .. "" .. gourd_itemstring .. ")",
nodenames = {full_unconnected_stem}, nodenames = { full_unconnected_stem },
neighbors = {"air"}, neighbors = { "air" },
interval = grow_interval, interval = grow_interval,
chance = grow_chance, chance = grow_chance,
action = function(stempos) action = function(stempos)
@ -390,20 +390,20 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
if light and light > 10 then if light and light > 10 then
-- Check the four neighbors and filter out neighbors where gourds can't grow -- Check the four neighbors and filter out neighbors where gourds can't grow
local neighbors = { local neighbors = {
{ x=-1, y=0, z=0 }, { x = -1, y = 0, z = 0 },
{ x=1, y=0, z=0 }, { x = 1, y = 0, z = 0 },
{ x=0, y=0, z=-1 }, { x = 0, y = 0, z = -1 },
{ x=0, y=0, z=1 }, { x = 0, y = 0, z = 1 },
} }
local floorpos, floor local floorpos, floor
for n=#neighbors, 1, -1 do for n = #neighbors, 1, -1 do
local offset = neighbors[n] local offset = neighbors[n]
local blockpos = vector.add(stempos, offset) local blockpos = vector.add(stempos, offset)
floorpos = { x=blockpos.x, y=blockpos.y-1, z=blockpos.z } floorpos = vector.offset (blockpos, 0, -1,0) -- replaces { x = blockpos.x, y = blockpos.y - 1, z = blockpos.z }
floor = minetest.get_node(floorpos) floor = minetest.get_node(floorpos)
local block = minetest.get_node(blockpos) local block = minetest.get_node(blockpos)
local soilgroup = minetest.get_item_group(floor.name, "soil") local soilgroup = minetest.get_item_group(floor.name, "soil")
if not ((minetest.get_item_group(floor.name, "grass_block") == 1 or floor.name=="mcl_core:dirt" or soilgroup == 2 or soilgroup == 3) and block.name == "air") then if not ((minetest.get_item_group(floor.name, "grass_block") == 1 or floor.name == "mcl_core:dirt" or soilgroup == 2 or soilgroup == 3) and block.name == "air") then
table.remove(neighbors, n) table.remove(neighbors, n)
end end
end end
@ -416,27 +416,35 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
local blockpos = vector.add(stempos, offset) local blockpos = vector.add(stempos, offset)
local p2 local p2
if offset.x == 1 then if offset.x == 1 then
minetest.set_node(stempos, {name=connected_stem_names[1]}) minetest.set_node(stempos, { name = connected_stem_names[1] })
p2 = 3 p2 = 3
elseif offset.x == -1 then elseif offset.x == -1 then
minetest.set_node(stempos, {name=connected_stem_names[2]}) minetest.set_node(stempos, { name = connected_stem_names[2] })
p2 = 1 p2 = 1
elseif offset.z == 1 then elseif offset.z == 1 then
minetest.set_node(stempos, {name=connected_stem_names[3]}) minetest.set_node(stempos, { name = connected_stem_names[3] })
p2 = 2 p2 = 2
elseif offset.z == -1 then elseif offset.z == -1 then
minetest.set_node(stempos, {name=connected_stem_names[4]}) minetest.set_node(stempos, { name = connected_stem_names[4] })
p2 = 0 p2 = 0
end end
-- Place the gourd -- Place the gourd
if gourd_def.paramtype2 == "facedir" then if gourd_def.paramtype2 == "facedir" then
minetest.add_node(blockpos, {name=gourd_itemstring, param2=p2}) minetest.add_node(blockpos, { name = gourd_itemstring, param2 = p2 })
else else
minetest.add_node(blockpos, {name=gourd_itemstring}) minetest.add_node(blockpos, { name = gourd_itemstring })
end end
-- Reset farmland, etc. to dirt when the gourd grows on top -- Reset farmland, etc. to dirt when the gourd grows on top
-- FIXED: The following 2 lines were missing, and wasn't being set (outside of the above loop that
-- finds the neighbors.)
-- FYI - don't factor this out thinking that the loop above is setting the positions correctly.
floorpos = vector.offset (blockpos, 0, -1,0) -- replaces { x = blockpos.x, y = blockpos.y - 1, z = blockpos.z }
floor = minetest.get_node(floorpos)
-- END OF FIX -------------------------------------
if minetest.get_item_group(floor.name, "dirtifies_below_solid") == 1 then if minetest.get_item_group(floor.name, "dirtifies_below_solid") == 1 then
minetest.set_node(floorpos, {name = "mcl_core:dirt"}) minetest.set_node(floorpos, { name = "mcl_core:dirt" })
end end
end end
end end
@ -452,7 +460,7 @@ end
function mcl_farming:stem_color(startcolor, endcolor, step, step_count) function mcl_farming:stem_color(startcolor, endcolor, step, step_count)
local color = {} local color = {}
local function get_component(startt, endd, step, step_count) local function get_component(startt, endd, step, step_count)
return math.floor(math.max(0, math.min(255, (startt + (((step-1)/step_count) * endd))))) return math.floor(math.max(0, math.min(255, (startt + (((step - 1) / step_count) * endd)))))
end end
color.r = get_component(startcolor.r, endcolor.r, step, step_count) color.r = get_component(startcolor.r, endcolor.r, step, step_count)
color.g = get_component(startcolor.g, endcolor.g, step, step_count) color.g = get_component(startcolor.g, endcolor.g, step, step_count)
@ -464,14 +472,14 @@ end
minetest.register_lbm({ minetest.register_lbm({
label = "Add growth for unloaded farming plants", label = "Add growth for unloaded farming plants",
name = "mcl_farming:growth", name = "mcl_farming:growth",
nodenames = {"group:plant"}, nodenames = { "group:plant" },
run_at_every_load = true, run_at_every_load = true,
action = function(pos, node) action = function(pos, node)
local identifier = plant_nodename_to_id_list[node.name] local identifier = plant_nodename_to_id_list[node.name]
if not identifier then if not identifier then
return return
end end
local low_speed = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name ~= "mcl_farming:soil_wet" local low_speed = minetest.get_node({ x = pos.x, y = pos.y - 1, z = pos.z }).name ~= "mcl_farming:soil_wet"
mcl_farming:grow_plant(identifier, pos, node, false, false, low_speed) mcl_farming:grow_plant(identifier, pos, node, false, false, low_speed)
end, end,
}) })

View File

@ -35,6 +35,24 @@ for i=0, 3 do
sounds = mcl_sounds.node_sound_leaves_defaults(), sounds = mcl_sounds.node_sound_leaves_defaults(),
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,
_mcl_hardness = 0, _mcl_hardness = 0,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if mcl_dye and clicker:get_wielded_item():get_name() == "mcl_dye:white" then
mcl_dye.apply_bone_meal({under=pos},clicker)
return
end
local stage
if node.name:find("_2") then
stage = 2
elseif node.name:find("_3") then
stage = 3
end
if stage then
for i=1,math.random(stage) do
minetest.add_item(pos,"mcl_farming:sweet_berry")
end
minetest.swap_node(pos,{name = "mcl_farming:sweet_berry_bush_" .. stage - 1 })
end
end,
}) })
minetest.register_alias("mcl_sweet_berry:sweet_berry_bush_" .. i, node_name) minetest.register_alias("mcl_sweet_berry:sweet_berry_bush_" .. i, node_name)
end end

View File

@ -0,0 +1,136 @@
---------------
---- Honey ----
---------------
-- Variables
local S = minetest.get_translator(minetest.get_current_modname())
local alldirs = {{x=0,y=0,z=1}, {x=1,y=0,z=0}, {x=0,y=0,z=-1}, {x=-1,y=0,z=0}, {x=0,y=-1,z=0}, {x=0,y=1,z=0}}
-- Honeycomb
minetest.register_craftitem("mcl_honey:honeycomb", {
description = S("Honeycomb"),
_doc_items_longdesc = S("Used to craft beehives and protect copper blocks from further oxidation."),
_doc_items_usagehelp = S("Use on copper blocks to prevent further oxidation."),
inventory_image = "mcl_honey_honeycomb.png",
groups = { craftitem = 1 },
})
minetest.register_node("mcl_honey:honeycomb_block", {
description = S("Honeycomb Block"),
_doc_items_longdesc = S("Honeycomb Block. Used as a decoration."),
tiles = {
"mcl_honey_honeycomb_block.png"
},
groups = { handy = 1, deco_block = 1 },
_mcl_blast_resistance = 0.6,
_mcl_hardness = 0.6,
})
-- Honey
minetest.register_craftitem("mcl_honey:honey_bottle", {
description = S("Honey Bottle"),
_doc_items_longdesc = S("Honey Bottle is used to craft honey blocks and to restore hunger points."),
_doc_items_usagehelp = S("Drinking will restore 6 hunger points. Can also be used to craft honey blocks."),
inventory_image = "mcl_honey_honey_bottle.png",
groups = { craftitem = 1, food = 3, eatable = 6, can_eat_when_full=1 },
on_place = minetest.item_eat(6, "mcl_potions:glass_bottle"),
on_secondary_use = minetest.item_eat(6, "mcl_potions:glass_bottle"),
_mcl_saturation = 1.2,
stack_max = 16,
})
minetest.register_node("mcl_honey:honey_block", {
description = S("Honey Block"),
_doc_items_longdesc = S("Honey Block. Used as a decoration and in redstone. Is sticky on some sides."),
tiles = {"mcl_honey_block_side.png"},
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "blend" or true,
groups = { handy = 1, deco_block = 1, fall_damage_add_percent = -80 },
paramtype = "light",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.4, -0.4, -0.4, 0.4, 0.4, 0.4},
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
}
},
selection_box = {
type = "regular",
},
_mcl_blast_resistance = 0,
_mcl_hardness = 0,
mvps_sticky = function(pos, node, piston_pos)
local connected = {}
for n, v in ipairs(alldirs) do
local neighbor_pos = vector.add(pos, v)
local neighbor_node = minetest.get_node(neighbor_pos)
if neighbor_node then
if neighbor_node.name == "ignore" then
minetest.get_voxel_manip():read_from_map(neighbor_pos, neighbor_pos)
neighbor_node = minetest.get_node(neighbor_pos)
end
local name = neighbor_node.name
if name ~= "air" and name ~= "ignore" and not mesecon.mvps_unsticky[name] then
local piston, piston_side, piston_up, piston_down = false, false, false, false
if name == "mesecons_pistons:piston_sticky_off" or name == "mesecons_pistons:piston_normal_off" then
piston, piston_side = true, true
elseif name == "mesecons_pistons:piston_up_sticky_off" or name == "mesecons_pistons:piston_up_normal_off" then
piston, piston_up = true, true
elseif name == "mesecons_pistons:piston_down_sticky_off" or name == "mesecons_pistons:piston_down_normal_off" then
piston, piston_down = true, true
end
if not( (piston_side and (n-1==neighbor_node.param2)) or (piston_up and (n==5)) or (piston_down and (n==6)) ) then
if piston and piston_pos then
if piston_pos.x == neighbor_pos.x and piston_pos.y == neighbor_pos.y and piston_pos.z == neighbor_pos.z then
-- Loopback to the same piston! Preventing unwanted behavior:
return {}, true
end
end
table.insert(connected, neighbor_pos)
end
end
end
end
return connected, false
end,
})
-- Crafting
minetest.register_craft({
output = "mcl_honey:honeycomb_block",
recipe = {
{ "mcl_honey:honeycomb", "mcl_honey:honeycomb" },
{ "mcl_honey:honeycomb", "mcl_honey:honeycomb" },
},
})
minetest.register_craft({
output = "mcl_honey:honey_block",
recipe = {
{ "mcl_honey:honey_bottle", "mcl_honey:honey_bottle" },
{ "mcl_honey:honey_bottle", "mcl_honey:honey_bottle" },
},
replacements = {
{ "mcl_honey:honey_bottle", "mcl_potions:glass_bottle" },
{ "mcl_honey:honey_bottle", "mcl_potions:glass_bottle" },
{ "mcl_honey:honey_bottle", "mcl_potions:glass_bottle" },
{ "mcl_honey:honey_bottle", "mcl_potions:glass_bottle" },
},
})
minetest.register_craft({
output = "mcl_honey:honey_bottle 4",
recipe = {
{ "mcl_potions:glass_bottle", "mcl_potions:glass_bottle", "mcl_honey:honey_block" },
{ "mcl_potions:glass_bottle", "mcl_potions:glass_bottle", "" },
},
})
minetest.register_craft({
type = "shapeless",
output = "mcl_core:sugar 3",
recipe = { "mcl_honey:honey_bottle" },
replacements = {
{ "mcl_honey:honey_bottle", "mcl_potions:glass_bottle" },
},
})

View File

@ -0,0 +1,10 @@
Honeycomb=
Used to craft beehives and protect copper blocks from further oxidation.=
Use on copper blocks to prevent further oxidation.=
Honeycomb Block=
Honeycomb Block. Used as a decoration.=
Honey Bottle=
Honey Bottle is used to craft honey blocks and to restore hunger points.=
Drinking will restore 6 hunger points. Can also be used to craft honey blocks.=
Honey Block=
Honey Block. Used as a decoration and in redstone. Is sticky on some sides.=

View File

@ -0,0 +1,4 @@
name = mcl_honey
author = PrairieWind
description = MineClone 2 mod that adds honey and honeycomb and the respective block versions.
depends = mesecons_mvps

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -338,8 +338,8 @@ minetest.register_node("mcl_hoppers:hopper_side_disabled", def_hopper_side_disab
--[[ END OF NODE DEFINITIONS ]] --[[ END OF NODE DEFINITIONS ]]
local function hopper_pull_from_mc (mc_ent, dest_pos) local function hopper_pull_from_mc (mc_ent, dest_pos, inv_size)
local inv = mcl_entity_invs.load_inv(mc_ent,5) local inv = mcl_entity_invs.load_inv(mc_ent, inv_size)
if not inv then if not inv then
mcl_log("No inv") mcl_log("No inv")
return false return false
@ -382,7 +382,7 @@ end
--[[ BEGIN OF ABM DEFINITONS ]] --[[ BEGIN OF ABM DEFINITONS ]]
minetest.register_abm({ minetest.register_abm({
label = "Hoppers pull from minecart hoppers", label = "Hoppers pull from minecart",
nodenames = {"mcl_hoppers:hopper","mcl_hoppers:hopper_side"}, nodenames = {"mcl_hoppers:hopper","mcl_hoppers:hopper_side"},
interval = 0.5, interval = 0.5,
chance = 1, chance = 1,
@ -396,9 +396,9 @@ minetest.register_abm({
if entity and entity.name then if entity and entity.name then
--mcl_log("Name of object near: " .. tostring(entity.name)) --mcl_log("Name of object near: " .. tostring(entity.name))
if entity.name == "mcl_minecarts:hopper_minecart" then if entity.name == "mcl_minecarts:hopper_minecart" or entity.name == "mcl_minecarts:chest_minecart"then
local hm_pos = entity.object:get_pos() local hm_pos = entity.object:get_pos()
mcl_log("We have a hopper minecart close: ".. minetest.pos_to_string(hm_pos)) mcl_log("We have a minecart with inventory close: ".. minetest.pos_to_string(hm_pos))
--if hm_pos.y == pos.y + 1 then mcl_log("y is correct") end --if hm_pos.y == pos.y + 1 then mcl_log("y is correct") end
--if (hm_pos.x >= pos.x - DIST_FROM_MC and hm_pos.x <= pos.x + DIST_FROM_MC) then mcl_log("x is within range") end --if (hm_pos.x >= pos.x - DIST_FROM_MC and hm_pos.x <= pos.x + DIST_FROM_MC) then mcl_log("x is within range") end
@ -409,7 +409,11 @@ minetest.register_abm({
and (hm_pos.x >= pos.x - DIST_FROM_MC and hm_pos.x <= pos.x + DIST_FROM_MC) and (hm_pos.x >= pos.x - DIST_FROM_MC and hm_pos.x <= pos.x + DIST_FROM_MC)
and (hm_pos.z >= pos.z - DIST_FROM_MC and hm_pos.z <= pos.z + DIST_FROM_MC) then and (hm_pos.z >= pos.z - DIST_FROM_MC and hm_pos.z <= pos.z + DIST_FROM_MC) then
mcl_log("Minecart close enough") mcl_log("Minecart close enough")
hopper_pull_from_mc (entity, pos) if entity.name == "mcl_minecarts:hopper_minecart" then
hopper_pull_from_mc(entity, pos, 5)
elseif entity.name == "mcl_minecarts:chest_minecart" then
hopper_pull_from_mc(entity, pos, 27)
end
end end
end end
else else

View File

@ -34,6 +34,8 @@ local glow_amount = 6 -- LIGHT_MAX is 15, but the items aren't supposed to be a
local frame_item_base = {} local frame_item_base = {}
local map_item_base = {} local map_item_base = {}
local TIMER_INTERVAL = 40.0
-- Time to Fleckenstein! (it just sounds cool lol) -- Time to Fleckenstein! (it just sounds cool lol)
--- self: the object to roll. --- self: the object to roll.
@ -247,6 +249,7 @@ mcl_itemframes.update_item_entity = function(pos, node, param2)
local map_id_entity = {} local map_id_entity = {}
local map_id_lua = {} local map_id_lua = {}
local timer = minetest.get_node_timer(pos)
if map_id == "" then if map_id == "" then
-- handle regular items placed into custom frame. -- handle regular items placed into custom frame.
if mcl_itemframes.DEBUG then if mcl_itemframes.DEBUG then
@ -268,13 +271,32 @@ mcl_itemframes.update_item_entity = function(pos, node, param2)
if itemname == "" or itemname == nil then if itemname == "" or itemname == nil then
map_id_lua._texture = "blank.png" map_id_lua._texture = "blank.png"
map_id_lua._scale = 1 map_id_lua._scale = 1
-- set up glow, as this is the default/initial clause on placement.
if has_glow then if has_glow then
map_id_lua.glow = glow_amount map_id_lua.glow = glow_amount
end end
-- if there's nothing to display, then kill the timer.
if timer:is_started() == true then
timer:stop()
end
else else
map_id_lua._texture = itemname map_id_lua._texture = itemname
local def = minetest.registered_items[itemname] local def = minetest.registered_items[itemname]
map_id_lua._scale = def and def.wield_scale and def.wield_scale.x or 1 map_id_lua._scale = def and def.wield_scale and def.wield_scale.x or 1
-- fix for /ClearObjects
if minetest.get_item_group(itemname, "clock") == 0 then
-- Do timer related stuff - but only if there is something to display... and it's not a clock.
if timer:is_started() == false then
timer:start(TIMER_INTERVAL)
else
timer:stop()
timer:start(TIMER_INTERVAL)
end
end
end end
if mcl_itemframes.DEBUG then if mcl_itemframes.DEBUG then
minetest.log("action", "[mcl_itemframes] Update_Generic_Item: item's name: " .. itemname) minetest.log("action", "[mcl_itemframes] Update_Generic_Item: item's name: " .. itemname)
@ -297,6 +319,15 @@ mcl_itemframes.update_item_entity = function(pos, node, param2)
else else
minetest.log("error", "[mcl_itemframes] Update_Generic_Item: Failed to set Map Item in " .. found_name_to_use .. "'s frame.") minetest.log("error", "[mcl_itemframes] Update_Generic_Item: Failed to set Map Item in " .. found_name_to_use .. "'s frame.")
end end
-- give maps a refresh timer.
if timer:is_started() == false then
timer:start(TIMER_INTERVAL)
else
timer:stop()
timer:start(TIMER_INTERVAL)
end
end end
-- finally, set the rotation (roll) of the displayed object. -- finally, set the rotation (roll) of the displayed object.
@ -364,7 +395,7 @@ function mcl_itemframes.create_base_item_entity()
textures = { "blank.png" }, textures = { "blank.png" },
_texture = "blank.png", _texture = "blank.png",
_scale = 1, _scale = 1,
groups = { immortal = 1, },
on_activate = function(self, staticdata) on_activate = function(self, staticdata)
if staticdata and staticdata ~= "" then if staticdata and staticdata ~= "" then
local data = staticdata:split(";") local data = staticdata:split(";")
@ -395,7 +426,7 @@ function mcl_itemframes.create_base_item_entity()
end end
return "" return ""
end, end,
on_punch = function() return true end,
_update_texture = function(self) _update_texture = function(self)
if self._texture then if self._texture then
self.object:set_properties({ self.object:set_properties({
@ -561,6 +592,23 @@ function mcl_itemframes.custom_register_lbm()
end end
local function register_frame_achievements()
awards.register_achievement("mcl_itemframes:glowframe", {
title = S("Glow and Behold!"),
description = S("Craft a glow item frame."),
icon = "mcl_itemframes_glow_item_frame.png",
trigger = {
type = "craft",
item = "mcl_itemframes:glow_item_frame",
target = 1
},
type = "Advancement",
group = "Overworld",
})
end
function mcl_itemframes.create_base_definitions() function mcl_itemframes.create_base_definitions()
if mcl_itemframes.DEBUG then if mcl_itemframes.DEBUG then
minetest.log("action", "[mcl_itemframes] create_base_definitions.") minetest.log("action", "[mcl_itemframes] create_base_definitions.")
@ -590,7 +638,7 @@ function mcl_itemframes.create_base_definitions()
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
groups = { dig_immediate = 3, deco_block = 1, dig_by_piston = 1, container = 7, attached_node_facedir = 1 }, groups = { dig_immediate = 3, deco_block = 1, dig_by_piston = 1, container = 7, }, -- attached_node_facedir = 1 }, -- allows for more placement options.
sounds = mcl_sounds.node_sound_defaults(), sounds = mcl_sounds.node_sound_defaults(),
node_placement_prediction = "", node_placement_prediction = "",
@ -598,16 +646,19 @@ function mcl_itemframes.create_base_definitions()
local inv = minetest.get_meta(pos):get_inventory() local inv = minetest.get_meta(pos):get_inventory()
local stack = inv:get_stack("main", 1) local stack = inv:get_stack("main", 1)
local itemname = stack:get_name() local itemname = stack:get_name()
local node = {}
if minetest.get_item_group(itemname, "clock") > 0 then if minetest.get_item_group(itemname, "clock") > 0 then
local new_name = "mcl_clock:clock_" .. (mcl_worlds.clock_works(pos) and mcl_clock.old_time or mcl_clock.random_frame) local new_name = "mcl_clock:clock_" .. (mcl_worlds.clock_works(pos) and mcl_clock.old_time or mcl_clock.random_frame)
if itemname ~= new_name then if itemname ~= new_name then
stack:set_name(new_name) stack:set_name(new_name)
inv:set_stack("main", 1, stack) inv:set_stack("main", 1, stack)
local node = minetest.get_node(pos) node = minetest.get_node(pos)
mcl_itemframes.update_item_entity(pos, node, node.param2) mcl_itemframes.update_item_entity(pos, node, node.param2)
end end
minetest.get_node_timer(pos):start(1.0) minetest.get_node_timer(pos):start(1.0)
else
node = minetest.get_node(pos)
mcl_itemframes.update_item_entity(pos, node, node.param2)
end end
end, end,
@ -616,6 +667,14 @@ function mcl_itemframes.create_base_definitions()
return itemstack return itemstack
end end
local dir = vector.subtract(pointed_thing.under, pointed_thing.above)
local wdir = minetest.dir_to_wallmounted(dir)
-- remove bottom and top of objects.
if wdir == 0 or wdir == 1 then
return itemstack
end
-- Use pointed node's on_rightclick function first, if present -- Use pointed node's on_rightclick function first, if present
local node = minetest.get_node(pointed_thing.under) local node = minetest.get_node(pointed_thing.under)
if placer and not placer:get_player_control().sneak then if placer and not placer:get_player_control().sneak then
@ -784,15 +843,11 @@ function mcl_itemframes.create_base_definitions()
mcl_itemframes.glow_frame_base.inventory_image = "mcl_itemframes_glow_item_frame_item.png" mcl_itemframes.glow_frame_base.inventory_image = "mcl_itemframes_glow_item_frame_item.png"
mcl_itemframes.glow_frame_base.wield_image = "mcl_itemframes_glow_item_frame.png" mcl_itemframes.glow_frame_base.wield_image = "mcl_itemframes_glow_item_frame.png"
mcl_itemframes.glow_frame_base.mesh = "mcl_itemframes_glow_item_frame.obj" mcl_itemframes.glow_frame_base.mesh = "mcl_itemframes_glow_item_frame.obj"
mcl_itemframes.glow_frame_base.glow = 1 --make the glow frames have some glow at night, but not enough to be a light source.
--[[ -- set up the achievement for glow frames.
minetest.register_node("mcl_itemframes:glow_item_frame", mcl_itemframes.glow_frame_base) register_frame_achievements()
mcl_itemframes.update_frame_registry("false", "mcl_itemframes:item_frame", false)
mcl_itemframes.update_frame_registry("false", "mcl_itemframes:glow_item_frame", true)
create_register_lbm("mcl_itemframes:item_frame")
create_register_lbm("mcl_itemframes:glow_item_frame")
--]]
end end
-- for compatibility: -- for compatibility:

View File

@ -741,7 +741,7 @@ minetest.register_craftitem("mcl_ocean:kelp", {
inventory_image = "mcl_ocean_kelp_item.png", inventory_image = "mcl_ocean_kelp_item.png",
wield_image = "mcl_ocean_kelp_item.png", wield_image = "mcl_ocean_kelp_item.png",
on_place = kelp.kelp_on_place, on_place = kelp.kelp_on_place,
groups = {deco_block = 1, compostability = 30}, groups = {deco_block = 1, compostability = 30, smoker_cookable = 1},
}) })
if mod_doc then if mod_doc then

View File

@ -2,7 +2,7 @@
--- ---
# Mineclone2-Signs # Mineclone2-Signs
--- ---
A reworking of MineClone 2's mcl_signs to be colorable and made to glow. Rquires Minetest and Mineclone2. A reworking of MineClone 2's mcl_signs to be colorable and made to glow. Requires Minetest and Mineclone2.
--- ---
Created by Michieal (FaerRaven) @ DateTime: 10/14/22 4:05 PM Created by Michieal (FaerRaven) @ DateTime: 10/14/22 4:05 PM

View File

@ -125,9 +125,11 @@ mcl_signs.register_sign_craft("mcl_core", "mcl_core:junglewood", "_junglewood")
mcl_signs.register_sign("mcl_core", "#ea7479", "_acaciawood", "Acacia Sign") mcl_signs.register_sign("mcl_core", "#ea7479", "_acaciawood", "Acacia Sign")
mcl_signs.register_sign_craft("mcl_core", "mcl_core:acaciawood", "_acaciawood") mcl_signs.register_sign_craft("mcl_core", "mcl_core:acaciawood", "_acaciawood")
-- mangrove_wood Sign "#c7545c" if minetest.get_modpath("mcl_mangrove") then
mcl_signs.register_sign("mcl_core", "#b8693d", "_mangrove_wood", "Mangrove Sign") -- mangrove_wood Sign "#c7545c"
mcl_signs.register_sign_craft("mcl_core", "mcl_core:mangrove_wood", "_mangrove_wood") mcl_signs.register_sign("mcl_mangrove", "#b8693d", "_mangrove_wood", "Mangrove Sign")
mcl_signs.register_sign_craft("mcl_mangrove", "mcl_mangrove:mangrove_wood", "_mangrove_wood")
end
-- add in the nether wood signs -- add in the nether wood signs
if minetest.get_modpath("mcl_crimson") then if minetest.get_modpath("mcl_crimson") then

View File

@ -7,7 +7,6 @@
--local logging = minetest.settings:get_bool("mcl_logging_mcl_signs",true) --local logging = minetest.settings:get_bool("mcl_logging_mcl_signs",true)
local DEBUG = minetest.settings:get_bool("mcl_logging_mcl_signs", false) -- special debug setting. local DEBUG = minetest.settings:get_bool("mcl_logging_mcl_signs", false) -- special debug setting.
local table = table -- copied from the original signs init file.
if DEBUG then if DEBUG then
minetest.log("action", "[mcl_signs] Signs API Loading") minetest.log("action", "[mcl_signs] Signs API Loading")
@ -29,7 +28,11 @@ local NUMBER_OF_LINES = 4
local LINE_HEIGHT = 14 local LINE_HEIGHT = 14
local CHAR_WIDTH = 5 local CHAR_WIDTH = 5
local TIMER_INTERVAL = 40.0
-- ----------------------- -- -----------------------
-- CACHE LOCAL COPIES
local table = table
local string = string
-- CACHE NODE_SOUNDS -- CACHE NODE_SOUNDS
local node_sounds local node_sounds
@ -161,6 +164,13 @@ mcl_signs.wall_standard = {
stack_max = 16, stack_max = 16,
sounds = node_sounds, sounds = node_sounds,
on_timer = function(pos)
-- fix for /ClearObjects
mcl_signs:update_sign(pos)
-- note: update_sign decides to keep the timer running based on if there is text.
-- This prevents every sign from having a timer, when not needed.
end,
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
local above = pointed_thing.above local above = pointed_thing.above
local under = pointed_thing.under local under = pointed_thing.under
@ -272,9 +282,6 @@ mcl_signs.wall_standard = {
-- Not Useless Code. force updates the sign. -- Not Useless Code. force updates the sign.
on_punch = function(pos, node, puncher) on_punch = function(pos, node, puncher)
mcl_signs:update_sign(pos) mcl_signs:update_sign(pos)
if DISINTEGRATE then
mcl_signs:destruct_sign(pos)
end
end, end,
on_rotate = function(pos, node, user, mode) on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_FACE then if mode == screwdriver.ROTATE_FACE then
@ -372,12 +379,15 @@ mcl_signs.standing_standard = {
mcl_signs:destruct_sign(pos) mcl_signs:destruct_sign(pos)
end, end,
on_timer = function(pos)
-- fix for /ClearObjects
mcl_signs:update_sign(pos)
minetest.get_node_timer(pos):start(40.0)
end,
-- Not Useless Code. this force updates the sign. -- Not Useless Code. this force updates the sign.
on_punch = function(pos, node, puncher) on_punch = function(pos, node, puncher)
mcl_signs:update_sign(pos) mcl_signs:update_sign(pos)
if DISINTEGRATE then
mcl_signs:destruct_sign(pos)
end
end, end,
on_rotate = function(pos, node, user, mode) on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_FACE then if mode == screwdriver.ROTATE_FACE then
@ -499,7 +509,7 @@ function mcl_signs.make_lbm()
name = "mcl_signs:respawn_entities", name = "mcl_signs:respawn_entities",
label = "Respawn sign text entities", label = "Respawn sign text entities",
run_at_every_load = true, run_at_every_load = true,
nodenames = registered_sign_nodenames , nodenames = registered_sign_nodenames,
action = function(pos, node) action = function(pos, node)
mcl_signs:update_sign(pos) mcl_signs:update_sign(pos)
end, end,
@ -572,16 +582,21 @@ function mcl_signs.register_sign (modname, color, _name, ttsign)
local sign_info local sign_info
local nodeitem = ItemStack(itemstack) local nodeitem = ItemStack(itemstack)
local yaw = 0
-- Ceiling -- Ceiling
if wdir == 0 then if wdir == 0 then
--how would you add sign to ceiling? --how would you add sign to ceiling? simple - hanging sign.
-- add code for placement underneath a node.
return itemstack return itemstack
-- Floor -- Floor
elseif wdir == 1 then elseif wdir == 1 then
-- Standing sign -- Standing sign
-- Determine the sign rotation based on player's yaw -- Determine the sign rotation based on player's yaw
local yaw = pi * 2 - placer:get_look_horizontal() yaw = pi * 2 - placer:get_look_horizontal()
-- Select one of 16 possible rotations (0-15) -- Select one of 16 possible rotations (0-15)
local rotation_level = mcl_signs:round((yaw / (pi * 2)) * 16) local rotation_level = mcl_signs:round((yaw / (pi * 2)) * 16)
@ -648,7 +663,7 @@ function mcl_signs.register_sign (modname, color, _name, ttsign)
return itemstack return itemstack
end end
minetest.register_node("mcl_signs:wall_sign" .. _name, new_sign) minetest.register_node(":mcl_signs:wall_sign" .. _name, new_sign)
update_sign_registry("wall", "mcl_signs:wall_sign" .. _name) update_sign_registry("wall", "mcl_signs:wall_sign" .. _name)
-- debug step -- debug step
@ -676,7 +691,7 @@ function mcl_signs.register_sign (modname, color, _name, ttsign)
return true return true
end, end,
minetest.register_node("mcl_signs:standing_sign" .. _name, new_sign_standing) minetest.register_node(":mcl_signs:standing_sign" .. _name, new_sign_standing)
update_sign_registry("standing", "mcl_signs:standing_sign" .. _name) update_sign_registry("standing", "mcl_signs:standing_sign" .. _name)
-- debug step -- debug step
if DEBUG then if DEBUG then
@ -696,7 +711,7 @@ function mcl_signs.register_sign (modname, color, _name, ttsign)
mcl_signs:update_sign(pos, nil, nil, true) mcl_signs:update_sign(pos, nil, nil, true)
return true return true
end end
minetest.register_node("mcl_signs:standing_sign22_5" .. _name, ssign22_5d) minetest.register_node(":mcl_signs:standing_sign22_5" .. _name, ssign22_5d)
update_sign_registry("standing", "mcl_signs:standing_sign22_5" .. _name) update_sign_registry("standing", "mcl_signs:standing_sign22_5" .. _name)
-- 45° -- 45°
@ -712,7 +727,7 @@ function mcl_signs.register_sign (modname, color, _name, ttsign)
mcl_signs:update_sign(pos, nil, nil, true) mcl_signs:update_sign(pos, nil, nil, true)
return true return true
end end
minetest.register_node("mcl_signs:standing_sign45" .. _name, ssign45d) minetest.register_node(":mcl_signs:standing_sign45" .. _name, ssign45d)
update_sign_registry("standing", "mcl_signs:standing_sign45" .. _name) update_sign_registry("standing", "mcl_signs:standing_sign45" .. _name)
-- 67.5° -- 67.5°
@ -729,7 +744,7 @@ function mcl_signs.register_sign (modname, color, _name, ttsign)
mcl_signs:update_sign(pos, nil, nil, true) mcl_signs:update_sign(pos, nil, nil, true)
return true return true
end end
minetest.register_node("mcl_signs:standing_sign67_5" .. _name, ssign67_5d) minetest.register_node(":mcl_signs:standing_sign67_5" .. _name, ssign67_5d)
update_sign_registry("standing", "mcl_signs:standing_sign67_5" .. _name) update_sign_registry("standing", "mcl_signs:standing_sign67_5" .. _name)
-- register Doc entry -- register Doc entry
@ -742,9 +757,9 @@ function mcl_signs.register_sign (modname, color, _name, ttsign)
end end
--register standing sign's rotation_levels --register standing sign's rotation_levels
table.insert(mcl_signs.standing_rotation_levels, {"mcl_signs:standing_sign22_5" .. _name , 1}) table.insert(mcl_signs.standing_rotation_levels, { "mcl_signs:standing_sign22_5" .. _name, 1 })
table.insert(mcl_signs.standing_rotation_levels, {"mcl_signs:standing_sign45" .. _name , 2}) table.insert(mcl_signs.standing_rotation_levels, { "mcl_signs:standing_sign45" .. _name, 2 })
table.insert(mcl_signs.standing_rotation_levels, {"mcl_signs:standing_sign67_5" .. _name , 3}) table.insert(mcl_signs.standing_rotation_levels, { "mcl_signs:standing_sign67_5" .. _name, 3 })
end end
--- The same as register_sign, except caller defines the textures. Note, there is a greyscale version of the sign, --- The same as register_sign, except caller defines the textures. Note, there is a greyscale version of the sign,
@ -782,9 +797,9 @@ function mcl_signs.register_sign_custom (modname, _name, tiles, color, inventory
new_sign = table.copy(mcl_signs.wall_standard) new_sign = table.copy(mcl_signs.wall_standard)
new_sign.wield_image ="("..wield_image.."^[multiply:" .. color .. ")" new_sign.wield_image = "(" .. wield_image .. "^[multiply:" .. color .. ")"
new_sign.tiles = { "("..tiles.."^[multiply:" .. color .. ")" } new_sign.tiles = { "(" .. tiles .. "^[multiply:" .. color .. ")" }
new_sign.inventory_image = "("..inventory_image.."^[multiply:" .. color .. ")" new_sign.inventory_image = "(" .. inventory_image .. "^[multiply:" .. color .. ")"
new_sign.description = S(ttsign) new_sign.description = S(ttsign)
-- currently have to do this, because of how the base node placement works. -- currently have to do this, because of how the base node placement works.
new_sign.on_place = function(itemstack, placer, pointed_thing) new_sign.on_place = function(itemstack, placer, pointed_thing)
@ -883,16 +898,16 @@ function mcl_signs.register_sign_custom (modname, _name, tiles, color, inventory
mcl_signs:show_formspec(placer, place_pos) mcl_signs:show_formspec(placer, place_pos)
return itemstack return itemstack
end end
minetest.register_node("mcl_signs:wall_sign" .. _name, new_sign) minetest.register_node(":mcl_signs:wall_sign" .. _name, new_sign)
update_sign_registry("wall", "mcl_signs:wall_sign" .. _name) update_sign_registry("wall", "mcl_signs:wall_sign" .. _name)
-- standing sign base. -- standing sign base.
local new_sign_standing = {} local new_sign_standing = {}
new_sign_standing = table.copy(mcl_signs.standing_standard) new_sign_standing = table.copy(mcl_signs.standing_standard)
new_sign_standing.drop = "mcl_signs:wall_sign" .. _name new_sign_standing.drop = "mcl_signs:wall_sign" .. _name
new_sign_standing.wield_image ="("..wield_image.."^[multiply:" .. color .. ")" new_sign_standing.wield_image = "(" .. wield_image .. "^[multiply:" .. color .. ")"
new_sign_standing.tiles = { "("..tiles.."^[multiply:" .. color .. ")" } new_sign_standing.tiles = { "(" .. tiles .. "^[multiply:" .. color .. ")" }
new_sign_standing.inventory_image = "("..inventory_image.."^[multiply:" .. color .. ")" new_sign_standing.inventory_image = "(" .. inventory_image .. "^[multiply:" .. color .. ")"
new_sign_standing.on_rotate = function(pos, node, user, mode) new_sign_standing.on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_FACE then if mode == screwdriver.ROTATE_FACE then
node.name = "mcl_signs:standing_sign22_5" .. _name node.name = "mcl_signs:standing_sign22_5" .. _name
@ -903,7 +918,7 @@ function mcl_signs.register_sign_custom (modname, _name, tiles, color, inventory
mcl_signs:update_sign(pos, nil, nil, true) mcl_signs:update_sign(pos, nil, nil, true)
return true return true
end, end,
minetest.register_node("mcl_signs:standing_sign" .. _name, new_sign_standing) minetest.register_node(":mcl_signs:standing_sign" .. _name, new_sign_standing)
update_sign_registry("standing", "mcl_signs:standing_sign" .. _name) update_sign_registry("standing", "mcl_signs:standing_sign" .. _name)
-- 22.5° -- 22.5°
@ -919,7 +934,7 @@ function mcl_signs.register_sign_custom (modname, _name, tiles, color, inventory
mcl_signs:update_sign(pos, nil, nil, true) mcl_signs:update_sign(pos, nil, nil, true)
return true return true
end end
minetest.register_node("mcl_signs:standing_sign22_5" .. _name, ssign22_5d) minetest.register_node(":mcl_signs:standing_sign22_5" .. _name, ssign22_5d)
update_sign_registry("standing", "mcl_signs:standing_sign22_5" .. _name) update_sign_registry("standing", "mcl_signs:standing_sign22_5" .. _name)
-- 45° -- 45°
@ -935,7 +950,7 @@ function mcl_signs.register_sign_custom (modname, _name, tiles, color, inventory
mcl_signs:update_sign(pos, nil, nil, true) mcl_signs:update_sign(pos, nil, nil, true)
return true return true
end end
minetest.register_node("mcl_signs:standing_sign45" .. _name, ssign45d) minetest.register_node(":mcl_signs:standing_sign45" .. _name, ssign45d)
update_sign_registry("standing", "mcl_signs:standing_sign45" .. _name) update_sign_registry("standing", "mcl_signs:standing_sign45" .. _name)
-- 67.5° -- 67.5°
@ -952,7 +967,7 @@ function mcl_signs.register_sign_custom (modname, _name, tiles, color, inventory
mcl_signs:update_sign(pos, nil, nil, true) mcl_signs:update_sign(pos, nil, nil, true)
return true return true
end end
minetest.register_node("mcl_signs:standing_sign67_5" .. _name, ssign67_5d) minetest.register_node(":mcl_signs:standing_sign67_5" .. _name, ssign67_5d)
update_sign_registry("standing", "mcl_signs:standing_sign67_5" .. _name) update_sign_registry("standing", "mcl_signs:standing_sign67_5" .. _name)
-- register Doc entry -- register Doc entry
@ -965,9 +980,9 @@ function mcl_signs.register_sign_custom (modname, _name, tiles, color, inventory
end end
--register standing sign's rotation_levels --register standing sign's rotation_levels
table.insert(mcl_signs.standing_rotation_levels, {"mcl_signs:standing_sign22_5" .. _name , 1}) table.insert(mcl_signs.standing_rotation_levels, { "mcl_signs:standing_sign22_5" .. _name, 1 })
table.insert(mcl_signs.standing_rotation_levels, {"mcl_signs:standing_sign45" .. _name , 2}) table.insert(mcl_signs.standing_rotation_levels, { "mcl_signs:standing_sign45" .. _name, 2 })
table.insert(mcl_signs.standing_rotation_levels, {"mcl_signs:standing_sign67_5" .. _name , 3}) table.insert(mcl_signs.standing_rotation_levels, { "mcl_signs:standing_sign67_5" .. _name, 3 })
end end
@ -1198,9 +1213,9 @@ function mcl_signs.reregister_sign (modname, color, _name, ttsign)
end end
--register standing sign's rotation_levels --register standing sign's rotation_levels
table.insert(mcl_signs.standing_rotation_levels, {"mcl_signs:standing_sign22_5" .. _name , 1}) table.insert(mcl_signs.standing_rotation_levels, { "mcl_signs:standing_sign22_5" .. _name, 1 })
table.insert(mcl_signs.standing_rotation_levels, {"mcl_signs:standing_sign45" .. _name , 2}) table.insert(mcl_signs.standing_rotation_levels, { "mcl_signs:standing_sign45" .. _name, 2 })
table.insert(mcl_signs.standing_rotation_levels, {"mcl_signs:standing_sign67_5" .. _name , 3}) table.insert(mcl_signs.standing_rotation_levels, { "mcl_signs:standing_sign67_5" .. _name, 3 })
end end
--- The same as reregister_sign, except caller defines the textures. Note, there is a greyscale version of the sign, --- The same as reregister_sign, except caller defines the textures. Note, there is a greyscale version of the sign,
@ -1238,9 +1253,9 @@ function mcl_signs.reregister_sign_custom (modname, _name, tiles, color, invento
new_sign = table.copy(mcl_signs.wall_standard) new_sign = table.copy(mcl_signs.wall_standard)
new_sign.wield_image ="("..wield_image.."^[multiply:" .. color .. ")" new_sign.wield_image = "(" .. wield_image .. "^[multiply:" .. color .. ")"
new_sign.tiles = { "("..tiles.."^[multiply:" .. color .. ")" } new_sign.tiles = { "(" .. tiles .. "^[multiply:" .. color .. ")" }
new_sign.inventory_image = "("..inventory_image.."^[multiply:" .. color .. ")" new_sign.inventory_image = "(" .. inventory_image .. "^[multiply:" .. color .. ")"
new_sign.description = S(ttsign) new_sign.description = S(ttsign)
-- currently have to do this, because of how the base node placement works. -- currently have to do this, because of how the base node placement works.
new_sign.on_place = function(itemstack, placer, pointed_thing) new_sign.on_place = function(itemstack, placer, pointed_thing)
@ -1346,9 +1361,9 @@ function mcl_signs.reregister_sign_custom (modname, _name, tiles, color, invento
local new_sign_standing = {} local new_sign_standing = {}
new_sign_standing = table.copy(mcl_signs.standing_standard) new_sign_standing = table.copy(mcl_signs.standing_standard)
new_sign_standing.drop = "mcl_signs:wall_sign" .. _name new_sign_standing.drop = "mcl_signs:wall_sign" .. _name
new_sign_standing.wield_image ="("..wield_image.."^[multiply:" .. color .. ")" new_sign_standing.wield_image = "(" .. wield_image .. "^[multiply:" .. color .. ")"
new_sign_standing.tiles = { "("..tiles.."^[multiply:" .. color .. ")" } new_sign_standing.tiles = { "(" .. tiles .. "^[multiply:" .. color .. ")" }
new_sign_standing.inventory_image = "("..inventory_image.."^[multiply:" .. color .. ")" new_sign_standing.inventory_image = "(" .. inventory_image .. "^[multiply:" .. color .. ")"
new_sign_standing.on_rotate = function(pos, node, user, mode) new_sign_standing.on_rotate = function(pos, node, user, mode)
if mode == screwdriver.ROTATE_FACE then if mode == screwdriver.ROTATE_FACE then
node.name = "mcl_signs:standing_sign22_5" .. _name node.name = "mcl_signs:standing_sign22_5" .. _name
@ -1421,9 +1436,9 @@ function mcl_signs.reregister_sign_custom (modname, _name, tiles, color, invento
end end
--register standing sign's rotation_levels --register standing sign's rotation_levels
table.insert(mcl_signs.standing_rotation_levels, {"mcl_signs:standing_sign22_5" .. _name , 1}) table.insert(mcl_signs.standing_rotation_levels, { "mcl_signs:standing_sign22_5" .. _name, 1 })
table.insert(mcl_signs.standing_rotation_levels, {"mcl_signs:standing_sign45" .. _name , 2}) table.insert(mcl_signs.standing_rotation_levels, { "mcl_signs:standing_sign45" .. _name, 2 })
table.insert(mcl_signs.standing_rotation_levels, {"mcl_signs:standing_sign67_5" .. _name , 3}) table.insert(mcl_signs.standing_rotation_levels, { "mcl_signs:standing_sign67_5" .. _name, 3 })
end end
@ -1473,7 +1488,49 @@ function mcl_signs.register_sign_craft(modname, wood_item_string, _name)
}, },
}) })
end end
end
function mcl_signs.register_hanging_sign_craft(modname, wood_item_string, _name)
local mod_name_pass = false
if modname ~= "" and modname ~= "false" then
if minetest.get_modpath(modname) then
mod_name_pass = true
end
if mod_name_pass == false then
return
end
end
minetest.register_craft({
type = "fuel",
recipe = ":mcl_signs:wall_sign" .. _name,
burntime = 10,
})
-- debug step
if DEBUG then
minetest.log("action", "[mcl_signs] Register Sign Crafts: \n" .. modname .. "\n" .. wood_item_string .. "\n" .. _name)
end
-- register crafts (actual recipe)
if minetest.get_modpath(modname) then
local itemstring = ":mcl_signs:hanging_sign"
local quantity = "6"
local bamboo = string.find(wood_item_string, "bamboo")
if bamboo then
quantity = "2"
end
minetest.register_craft({
output = itemstring .. _name .. " " .. quantity,
recipe = {
{ "mcl_lanterns:chain", "", "mcl_lanterns:chain" },
{ wood_item_string, wood_item_string, wood_item_string },
{ wood_item_string, wood_item_string, wood_item_string },
},
})
end
end end
-- Helper functions -- Helper functions
@ -1762,7 +1819,7 @@ function mcl_signs:update_sign(pos, fields, sender, force_remove, text_color)
if not meta then if not meta then
return false return false
end end
local text = meta:get_string("text") local text = meta:get_string("text", "")
if fields and (text == "" and fields.text) then if fields and (text == "" and fields.text) then
meta:set_string("text", fields.text) meta:set_string("text", fields.text)
text = fields.text text = fields.text
@ -1843,19 +1900,8 @@ function mcl_signs:update_sign(pos, fields, sender, force_remove, text_color)
return false return false
end end
local objects = minetest.get_objects_inside_radius(pos, 0.5)
local text_entity local text_entity
for _, v in ipairs(objects) do text_entity = mcl_signs:get_text_entity(pos,force_remove)
local ent = v:get_luaentity()
if ent and ent.name == "mcl_signs:text" then
if force_remove then
v:remove()
else
text_entity = v
break
end
end
end
if not text_entity then if not text_entity then
if DEBUG then if DEBUG then
@ -1899,11 +1945,29 @@ function mcl_signs:update_sign(pos, fields, sender, force_remove, text_color)
text_entity:set_yaw(sign_info.yaw) text_entity:set_yaw(sign_info.yaw)
if DEBUG then if DEBUG then
minetest.log("verbose", "[mcl_signs] Update_Sign: After texture recreation.") minetest.log("verbose", "[mcl_signs] Update_Sign: After texture recreation.")
minetest.log("action","[mcl_signs] Update_Sign: " .. npos_name .. "\nPlaced position:" .. dump(pos) .. "\nSign_info: " .. dump(sign_info)) minetest.log("action", "[mcl_signs] Update_Sign: " .. npos_name .. "\nPlaced position:" .. dump(pos) .. "\nSign_info: " .. dump(sign_info))
end end
-- save sign metadata. -- save sign metadata.
meta:set_string("mcl_signs:text_color", text_color) meta:set_string("mcl_signs:text_color", text_color)
-- Moved timer stuff to here, to make sure that it's called and only has one set of code.
local timer = minetest.get_node_timer(pos)
if text_entity and text ~= "" then
-- Do timer related stuff - but only if there is text to display.
-- Also, prevent excessive use with punching. (see node def.)
if timer:is_started() == false then
timer:start(TIMER_INTERVAL)
else
timer:stop()
timer:start(TIMER_INTERVAL)
end
else
if timer:is_started() == true then
timer:stop()
end
end
-- debug step -- debug step
if DEBUG then if DEBUG then
minetest.log("action", "[mcl_signs] Update_Sign: Post-Sign Update: " .. meta:get_string("mcl_signs:text_color") .. " " .. meta:get_string("mcl_signs:glowing_sign") .. ".\n" .. dump(pos)) minetest.log("action", "[mcl_signs] Update_Sign: Post-Sign Update: " .. meta:get_string("mcl_signs:text_color") .. " " .. meta:get_string("mcl_signs:glowing_sign") .. ".\n" .. dump(pos))
@ -1920,3 +1984,20 @@ function mcl_signs:show_formspec(player, pos)
"size[6,3]textarea[0.25,0.25;6,1.5;text;" .. F(S("Enter sign text:")) .. ";]label[0,1.5;" .. F(S("Maximum line length: 15")) .. "\n" .. F(S("Maximum lines: 4")) .. "]button_exit[0,2.5;6,1;submit;" .. F(S("Done")) .. "]" "size[6,3]textarea[0.25,0.25;6,1.5;text;" .. F(S("Enter sign text:")) .. ";]label[0,1.5;" .. F(S("Maximum line length: 15")) .. "\n" .. F(S("Maximum lines: 4")) .. "]button_exit[0,2.5;6,1;submit;" .. F(S("Done")) .. "]"
) )
end end
function mcl_signs:get_text_entity (pos, force_remove)
local objects = minetest.get_objects_inside_radius(pos, 0.5)
local text_entity = false -- just to have a check for failure.
for _, v in ipairs(objects) do
local ent = v:get_luaentity()
if ent and ent.name == "mcl_signs:text" then
if force_remove ~= nil and force_remove == true then
v:remove()
else
text_entity = v
break
end
end
end
return text_entity
end

View File

@ -1760,6 +1760,21 @@ local function register_dimension_biomes()
_mcl_biome_type = "medium", _mcl_biome_type = "medium",
_mcl_palette_index = 0, _mcl_palette_index = 0,
}) })
minetest.register_biome({
name = "EndBarrens",
node_stone = "air",
node_filler = "air",
node_water = "air",
node_river_water = "air",
node_cave_liquid = "air",
y_min = mcl_vars.mg_end_min,
y_max = mcl_vars.mg_end_max + 80,
heat_point = 1000,
humidity_point = 1000,
vertical_blend = 16,
_mcl_biome_type = "medium",
_mcl_palette_index = 0,
})
minetest.register_biome({ minetest.register_biome({
name = "EndMidlands", name = "EndMidlands",
node_stone = "air", node_stone = "air",
@ -3160,7 +3175,48 @@ local function register_decorations()
flags = "place_center_x, place_center_z", flags = "place_center_x, place_center_z",
rotation = "random", rotation = "random",
}) })
minetest.register_decoration({
deco_type = "schematic",
place_on = {"group:grass_block_no_snow", "mcl_core:dirt"},
sidelen = 16,
--[[noise_params = {
offset = 0.01,
scale = 0.00001,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.33
},]]--
fill_ratio = 0.0002,
biomes = {"FlowerForest"},
y_min = 1,
y_max = mcl_vars.mg_overworld_max,
schematic = mod_mcl_core.."/schematics/mcl_core_oak_classic_bee_nest.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
spawn_by = "group:flower",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"group:grass_block_no_snow", "mcl_core:dirt"},
sidelen = 16,
--[[noise_params = {
offset = 0.01,
scale = 0.00001,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.33
},]]--
fill_ratio = 0.00002,
biomes = {"Forest"},
y_min = 1,
y_max = mcl_vars.mg_overworld_max,
schematic = mod_mcl_core.."/schematics/mcl_core_oak_classic_bee_nest.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
spawn_by = "group:flower",
})
-- Rare balloon oak -- Rare balloon oak
minetest.register_decoration({ minetest.register_decoration({
@ -3269,7 +3325,27 @@ local function register_decorations()
flags = "place_center_x, place_center_z, force_placement", flags = "place_center_x, place_center_z, force_placement",
rotation = "random", rotation = "random",
}) })
minetest.register_decoration({
deco_type = "schematic",
place_on = {"mcl_mud:mud"},
sidelen = 80,
--[[noise_params = {
offset = 0.01,
scale = 0.00001,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.33
},]]--
fill_ratio = 0.0005,
biomes = {"MangroveSwamp"},
y_min = 1,
y_max = mcl_vars.mg_overworld_max,
schematic = mod_mcl_mangrove.."/schematics/mcl_mangrove_bee_nest.mts",
flags = "place_center_x, place_center_z, force_placement",
rotation = "random",
spawn_by = "group:flower",
})
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"mcl_mud:mud"}, place_on = {"mcl_mud:mud"},
@ -3630,6 +3706,27 @@ local function register_decorations()
schematic = mod_mcl_core.."/schematics/mcl_core_birch.mts", schematic = mod_mcl_core.."/schematics/mcl_core_birch.mts",
flags = "place_center_x, place_center_z", flags = "place_center_x, place_center_z",
}) })
minetest.register_decoration({
deco_type = "schematic",
place_on = {"group:grass_block_no_snow", "mcl_core:dirt"},
sidelen = 16,
--[[noise_params = {
offset = 0.01,
scale = 0.00001,
spread = {x = 250, y = 250, z = 250},
seed = 2,
octaves = 3,
persist = 0.33
},]]--
fill_ratio = 0.00002,
biomes = {"Forest", "BirchForest", "BirchForestM"},
y_min = 1,
y_max = mcl_vars.mg_overworld_max,
schematic = mod_mcl_core.."/schematics/mcl_core_birch_bee_nest.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
spawn_by = "group:flower",
})
-- Dark Oak -- Dark Oak
minetest.register_decoration({ minetest.register_decoration({

View File

@ -10,7 +10,7 @@ local node_def = {
drawtype = "mesh", drawtype = "mesh",
node_placement_prediction = "", node_placement_prediction = "",
on_construct = function(pos) on_construct = function(pos)
local name = get_node(pos).name local name = minetest.get_node(pos).name
local message = "[mcl_meshhand] Trying to construct " .. name .. " at " .. minetest.pos_to_string(pos) local message = "[mcl_meshhand] Trying to construct " .. name .. " at " .. minetest.pos_to_string(pos)
minetest.log("error", message) minetest.log("error", message)
minetest.remove_node(pos) minetest.remove_node(pos)

View File

@ -3,6 +3,8 @@ mcl_playerplus = {
is_pressing_jump = {}, is_pressing_jump = {},
} }
local hud_water = {}
local get_connected_players = minetest.get_connected_players local get_connected_players = minetest.get_connected_players
local dir_to_yaw = minetest.dir_to_yaw local dir_to_yaw = minetest.dir_to_yaw
local get_item_group = minetest.get_item_group local get_item_group = minetest.get_item_group
@ -25,6 +27,26 @@ local mcl_playerplus_internal = {}
local time = 0 local time = 0
local look_pitch = 0 local look_pitch = 0
local function calculate_water_depth(pos)
for i=1, 50 do
if get_item_group(minetest.get_node(vector.new(pos.x,pos.y+i,pos.z)).name, "water") == 0 then
return i
end
end
return 50
end
local function remove_water_hud(player)
if hud_water[player] then
mcl_weather.skycolor.update_sky_color()
for i=1, #hud_water[player] do
player:hud_remove(hud_water[player][i])
end
hud_water[player] = nil
end
end
local function player_collision(player) local function player_collision(player)
local pos = player:get_pos() local pos = player:get_pos()
@ -395,6 +417,25 @@ minetest.register_globalstep(function(dtime)
set_bone_pos(player,"Body_Control", nil, vector.new(0, -player_vel_yaw + yaw, 0)) set_bone_pos(player,"Body_Control", nil, vector.new(0, -player_vel_yaw + yaw, 0))
end end
if get_item_group(mcl_playerinfo[name].node_head, "water") ~= 0 then
if not hud_water[player] or hud_water[player] and calculate_water_depth(player:get_pos()) ~= #hud_water[player] then
remove_water_hud(player)
hud_water[player] = {}
for i=1, calculate_water_depth(player:get_pos()) do
table.insert(hud_water[player], player:hud_add({
hud_elem_type = "image",
text = "mcl_playerplus_water.png",
position = {x = 0.5, y = 0.5},
scale = {x = 32, y = 16},
offset = {x = 0, y = 0},
z_index = -1002,
}))
end
end
else
remove_water_hud(player)
end
elytra.last_yaw = player:get_look_horizontal() elytra.last_yaw = player:get_look_horizontal()
-- Update jump status immediately since we need this info in real time. -- Update jump status immediately since we need this info in real time.
-- WARNING: This section is HACKY as hell since it is all just based on heuristics. -- WARNING: This section is HACKY as hell since it is all just based on heuristics.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -25,21 +25,21 @@ mcl_skins = {
-- Base color is separate to keep the number of junk nodes registered in check -- Base color is separate to keep the number of junk nodes registered in check
base_color = {0xffeeb592, 0xffb47a57, 0xff8d471d}, base_color = {0xffeeb592, 0xffb47a57, 0xff8d471d},
color = { color = {
0xff613915, -- 1 Dark brown Steve hair, Alex bottom 0xff613915, -- 1 Dark brown
0xff97491b, -- 2 Medium brown 0xff97491b, -- 2 Medium brown
0xffb17050, -- 3 Light brown 0xffb17050, -- 3 Light brown
0xffe2bc7b, -- 4 Beige 0xffe2bc7b, -- 4 Beige
0xff706662, -- 5 Gray 0xff706662, -- 5 Gray
0xff151515, -- 6 Black 0xff151515, -- 6 Black
0xffc21c1c, -- 7 Red 0xffc21c1c, -- 7 Red
0xff178c32, -- 8 Green Alex top 0xff178c32, -- 8 Green
0xffae2ad3, -- 9 Plum 0xffae2ad3, -- 9 Plum
0xffebe8e4, -- 10 White 0xffebe8e4, -- 10 White
0xffe3dd26, -- 11 Yellow 0xffe3dd26, -- 11 Yellow
0xff449acc, -- 12 Light blue Steve top 0xff449acc, -- 12 Light blue
0xff124d87, -- 13 Dark blue Steve bottom 0xff124d87, -- 13 Dark blue
0xfffc0eb3, -- 14 Pink 0xfffc0eb3, -- 14 Pink
0xffd0672a, -- 15 Orange Alex hair 0xffd0672a, -- 15 Orange
}, },
footwear = {}, footwear = {},
mouth = {}, mouth = {},
@ -574,16 +574,16 @@ local function init()
for _, item in pairs(json) do for _, item in pairs(json) do
mcl_skins.register_item(item) mcl_skins.register_item(item)
end end
mcl_skins.steve.base_color = mcl_skins.base_color[1] mcl_skins.steve.base_color = mcl_skins.base_color[2]
mcl_skins.steve.hair_color = mcl_skins.color[1] mcl_skins.steve.hair_color = 0xff5d473b
mcl_skins.steve.top_color = mcl_skins.color[12] mcl_skins.steve.top_color = 0xff993535
mcl_skins.steve.bottom_color = mcl_skins.color[13] mcl_skins.steve.bottom_color = 0xff644939
mcl_skins.steve.slim_arms = false mcl_skins.steve.slim_arms = false
mcl_skins.alex.base_color = mcl_skins.base_color[1] mcl_skins.alex.base_color = mcl_skins.base_color[1]
mcl_skins.alex.hair_color = mcl_skins.color[15] mcl_skins.alex.hair_color = 0xff715d57
mcl_skins.alex.top_color = mcl_skins.color[8] mcl_skins.alex.top_color = 0xff346840
mcl_skins.alex.bottom_color = mcl_skins.color[1] mcl_skins.alex.bottom_color = 0xff383532
mcl_skins.alex.slim_arms = true mcl_skins.alex.slim_arms = true
end end

View File

@ -18,11 +18,13 @@
}, },
{ {
"type": "eye", "type": "eye",
"texture": "mcl_skins_eye_1.png" "texture": "mcl_skins_eye_1.png",
"alex": true
}, },
{ {
"type": "eye", "type": "eye",
"texture": "mcl_skins_eye_2.png" "texture": "mcl_skins_eye_2.png",
"steve": true
}, },
{ {
"type": "eye", "type": "eye",
@ -34,9 +36,7 @@
}, },
{ {
"type": "eye", "type": "eye",
"texture": "mcl_skins_eye_5.png", "texture": "mcl_skins_eye_5.png"
"steve": true,
"alex": true
}, },
{ {
"type": "eye", "type": "eye",
@ -73,21 +73,23 @@
}, },
{ {
"type": "mouth", "type": "mouth",
"texture": "mcl_skins_mouth_7.png", "texture": "mcl_skins_mouth_7.png"
"alex": true
}, },
{ {
"type": "mouth" "type": "mouth",
"alex": true
}, },
{ {
"type": "hair", "type": "hair",
"texture": "mcl_skins_hair_1.png", "texture": "mcl_skins_hair_1.png",
"mask": "mcl_skins_hair_1_mask.png" "mask": "mcl_skins_hair_1_mask.png",
"alex": true
}, },
{ {
"type": "hair", "type": "hair",
"texture": "mcl_skins_hair_2.png", "texture": "mcl_skins_hair_2.png",
"mask": "mcl_skins_hair_2_mask.png" "mask": "mcl_skins_hair_2_mask.png",
"steve": true
}, },
{ {
"type": "hair", "type": "hair",
@ -127,14 +129,12 @@
{ {
"type": "hair", "type": "hair",
"texture": "mcl_skins_hair_10.png", "texture": "mcl_skins_hair_10.png",
"mask": "mcl_skins_hair_10_mask.png", "mask": "mcl_skins_hair_10_mask.png"
"steve": true
}, },
{ {
"type": "hair", "type": "hair",
"texture": "mcl_skins_hair_11.png", "texture": "mcl_skins_hair_11.png",
"mask": "mcl_skins_hair_11_mask.png", "mask": "mcl_skins_hair_11_mask.png"
"alex": true
}, },
{ {
"type": "hair" "type": "hair"
@ -145,7 +145,8 @@
}, },
{ {
"type": "headwear", "type": "headwear",
"texture": "mcl_skins_headwear_2.png" "texture": "mcl_skins_headwear_2.png",
"alex": true
}, },
{ {
"type": "headwear", "type": "headwear",
@ -173,13 +174,14 @@
}, },
{ {
"type": "headwear", "type": "headwear",
"steve": true, "steve": true
"alex": true
}, },
{ {
"type": "bottom", "type": "bottom",
"texture": "mcl_skins_bottom_1.png", "texture": "mcl_skins_bottom_1.png",
"mask": "mcl_skins_bottom_1_mask.png" "mask": "mcl_skins_bottom_1_mask.png",
"steve": true,
"alex": true
}, },
{ {
"type": "bottom", "type": "bottom",
@ -194,14 +196,14 @@
{ {
"type": "bottom", "type": "bottom",
"texture": "mcl_skins_bottom_4.png", "texture": "mcl_skins_bottom_4.png",
"mask": "mcl_skins_bottom_4_mask.png", "mask": "mcl_skins_bottom_4_mask.png"
"steve": true,
"alex": true
}, },
{ {
"type": "top", "type": "top",
"texture": "mcl_skins_top_1.png", "texture": "mcl_skins_top_1.png",
"mask": "mcl_skins_top_1_mask.png" "mask": "mcl_skins_top_1_mask.png",
"steve": true,
"alex": true
}, },
{ {
"type": "top", "type": "top",
@ -241,14 +243,12 @@
{ {
"type": "top", "type": "top",
"texture": "mcl_skins_top_9.png", "texture": "mcl_skins_top_9.png",
"mask": "mcl_skins_top_9_mask.png", "mask": "mcl_skins_top_9_mask.png"
"alex": true
}, },
{ {
"type": "top", "type": "top",
"texture": "mcl_skins_top_10.png", "texture": "mcl_skins_top_10.png",
"mask": "mcl_skins_top_10_mask.png", "mask": "mcl_skins_top_10_mask.png"
"steve": true
}, },
{ {
"type": "base", "type": "base",

View File

@ -20,6 +20,7 @@ mcl_skins_top_6.png
mcl_skins_bottom_3.png mcl_skins_bottom_3.png
mcl_skins_eye_7.png mcl_skins_eye_7.png
mcl_skins_mouth_7.png mcl_skins_mouth_7.png
mcl_skins_hair_10.png
Original work by MrRar Original work by MrRar
License: CC BY-SA 4.0 License: CC BY-SA 4.0
@ -99,7 +100,6 @@ Source: http://minetest.fensta.bplaced.net/#id=1258
mcl_skins_bottom_4.png mcl_skins_bottom_4.png
mcl_skins_top_9.png mcl_skins_top_9.png
mcl_skins_top_10.png mcl_skins_top_10.png
mcl_skins_hair_10.png
mcl_skins_hair_11.png mcl_skins_hair_11.png
Name: Pixel Perfection Legacy 1.19 Name: Pixel Perfection Legacy 1.19
Author: Nova_Wostra. Adapted for mcl_skins by MrRar. Author: Nova_Wostra. Adapted for mcl_skins by MrRar.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

After

Width:  |  Height:  |  Size: 143 B