Builtin: minor fixes
This commit is contained in:
parent
a3e3f12900
commit
e91813755c
@ -1089,7 +1089,7 @@ core.register_chatcommand("msg", {
|
||||
end
|
||||
core.log("action", "PM from " .. name .. " to " .. sendto
|
||||
.. ": " .. message)
|
||||
core.chat_send_player(sendto, minetest.colorize("green",
|
||||
core.chat_send_player(sendto, core.colorize("green",
|
||||
"PM from " .. name .. ": " .. message))
|
||||
return true, "Message sent."
|
||||
end,
|
||||
@ -1200,6 +1200,7 @@ core.register_chatcommand("setspawn", {
|
||||
end
|
||||
local pos = core.pos_to_string(player:get_pos(), 1)
|
||||
core.settings:set("static_spawnpoint", pos)
|
||||
core.settings:write()
|
||||
return true, "The spawn point are set to " .. pos
|
||||
end
|
||||
})
|
||||
|
@ -442,6 +442,7 @@ function core.spawn_falling_node(pos)
|
||||
return convert_to_falling_node(pos, node)
|
||||
end
|
||||
|
||||
-- Declared as local function above
|
||||
function drop_attached_node(p)
|
||||
local n = core.get_node(p)
|
||||
local drops = core.get_node_drops(n, "")
|
||||
|
@ -139,7 +139,7 @@ function hunger.set_poisoned(player, poisoned)
|
||||
end
|
||||
|
||||
local function poison_tick(name, ticks, interval, elapsed)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
local player = core.get_player_by_name(name)
|
||||
if not player or not hunger.is_poisoned(player) then
|
||||
return
|
||||
elseif elapsed > ticks then
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
local abs, min, floor, random, pi = math.abs, math.min, math.floor, math.random, math.pi
|
||||
local vnormalize = vector.normalize
|
||||
|
||||
function core.spawn_item(pos, item)
|
||||
-- Take item in any format
|
||||
local stack = ItemStack(item)
|
||||
@ -213,7 +214,6 @@ core.register_entity(":__builtin:item", {
|
||||
y = pos.y + self.object:get_properties().collisionbox[2] - 0.05,
|
||||
z = pos.z
|
||||
})
|
||||
local node_inside = core.get_node_or_nil(pos)
|
||||
-- Delete in 'ignore' nodes
|
||||
if node and node.name == "ignore" then
|
||||
self.itemstring = ""
|
||||
@ -315,6 +315,7 @@ core.register_entity(":__builtin:item", {
|
||||
|
||||
local vel = self.object:get_velocity()
|
||||
local def = node and core.registered_nodes[node.name]
|
||||
local node_inside = core.get_node_or_nil(pos)
|
||||
local def_inside = node_inside and core.registered_nodes[node_inside.name]
|
||||
-- local is_moving = (def and not def.walkable) or
|
||||
-- vel.x ~= 0 or vel.y ~= 0 or vel.z ~= 0
|
||||
|
@ -179,10 +179,6 @@ function core.is_protected(pos, name)
|
||||
return false
|
||||
end
|
||||
|
||||
function core.is_protected_action()
|
||||
return false
|
||||
end
|
||||
|
||||
function core.record_protection_violation(pos, name)
|
||||
for _, func in pairs(core.registered_on_protection_violation) do
|
||||
func(pos, name)
|
||||
|
@ -107,9 +107,6 @@ function core.register_entity(name, prototype)
|
||||
prototype.mod_origin = core.get_current_modname() or "??"
|
||||
end
|
||||
|
||||
-- Intllib
|
||||
Sl = intllib.make_gettext_pair("locales")
|
||||
|
||||
function core.register_item(name, itemdef)
|
||||
-- Check name
|
||||
if name == nil then
|
||||
@ -159,12 +156,6 @@ function core.register_item(name, itemdef)
|
||||
itemdef.paramtype2 = "flowingliquid"
|
||||
end
|
||||
|
||||
-- Intllib
|
||||
if itemdef.description and itemdef.description ~= "" then
|
||||
itemdef.description = Sl(itemdef.description:gsub("@", "\001"))
|
||||
:gsub("\001", "@")
|
||||
end
|
||||
|
||||
-- BEGIN Legacy stuff
|
||||
if itemdef.cookresult_itemstring ~= nil and itemdef.cookresult_itemstring ~= "" then
|
||||
core.register_craft({
|
||||
@ -390,12 +381,13 @@ core.register_node(":ignore", {
|
||||
})
|
||||
|
||||
-- The hand (bare definition)
|
||||
local creative_mode = core.settings:get_bool("creative_mode")
|
||||
core.register_item(":", {
|
||||
type = "none",
|
||||
wield_image = "blank.png",
|
||||
wield_image = "wieldhand.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.5,
|
||||
damage_groups = {fleshy = core.settings:get_bool("creative_mode") and 5 or 1}
|
||||
damage_groups = {fleshy = creative_mode and 5 or 1}
|
||||
},
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user