mirror of
https://github.com/Sokomine/cottages.git
synced 2025-07-08 10:50:22 +02:00
stylua fixes
This commit is contained in:
@ -4,7 +4,7 @@ function api.make_unrepairable(itemstring)
|
||||
local def = minetest.registered_items[itemstring]
|
||||
local groups = table.copy(def.groups or {})
|
||||
groups.not_repaired_by_anvil = 1
|
||||
minetest.override_item(itemstring, {groups = groups})
|
||||
minetest.override_item(itemstring, { groups = groups })
|
||||
end
|
||||
|
||||
function api.can_repair(tool_stack)
|
||||
|
@ -7,15 +7,15 @@ minetest.register_entity("cottages:anvil_item", {
|
||||
initial_properties = {
|
||||
hp_max = 1,
|
||||
visual = "wielditem",
|
||||
visual_size = {x = .33, y = .33},
|
||||
collisionbox = {0, 0, 0, 0, 0, 0},
|
||||
visual_size = { x = 0.33, y = 0.33 },
|
||||
collisionbox = { 0, 0, 0, 0, 0, 0 },
|
||||
physical = false,
|
||||
collide_with_objects = false,
|
||||
pointable = false,
|
||||
},
|
||||
|
||||
get_staticdata = function(self)
|
||||
return serialize({self.pos, self.item})
|
||||
return serialize({ self.pos, self.item })
|
||||
end,
|
||||
|
||||
on_activate = function(self, staticdata, dtime_s)
|
||||
@ -27,7 +27,7 @@ minetest.register_entity("cottages:anvil_item", {
|
||||
return
|
||||
end
|
||||
|
||||
self.pos = pos -- *MUST* set before calling api.get_entity
|
||||
self.pos = pos -- *MUST* set before calling api.get_entity
|
||||
|
||||
local other_obj = anvil.get_entity(pos)
|
||||
if other_obj and obj ~= other_obj then
|
||||
@ -37,8 +37,8 @@ minetest.register_entity("cottages:anvil_item", {
|
||||
|
||||
self.item = item
|
||||
|
||||
obj:set_properties({wield_item = item})
|
||||
obj:set_armor_groups({immortal = 1})
|
||||
obj:set_properties({ wield_item = item })
|
||||
obj:set_armor_groups({ immortal = 1 })
|
||||
end,
|
||||
|
||||
on_punch = function()
|
||||
@ -54,22 +54,20 @@ if cottages.settings.anvil.tool_entity_enabled then
|
||||
-- automatically restore entities lost due to /clearobjects or similar
|
||||
if cottages.has.node_entity_queue then
|
||||
node_entity_queue.api.register_node_entity_loader("cottages:anvil", anvil.update_entity)
|
||||
|
||||
else
|
||||
minetest.register_lbm({
|
||||
name = "cottages:anvil_item_restoration",
|
||||
nodenames = {"cottages:anvil"},
|
||||
nodenames = { "cottages:anvil" },
|
||||
run_at_every_load = true,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
anvil.update_entity(pos)
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
else
|
||||
minetest.register_lbm({
|
||||
name = "cottages:anvil_item_removal",
|
||||
nodenames = {"cottages:anvil"},
|
||||
nodenames = { "cottages:anvil" },
|
||||
run_at_every_load = true,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
anvil.clear_entity(pos)
|
||||
@ -84,13 +82,12 @@ if minetest.registered_entities["anvil:item"] then
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
minetest.register_entity(":anvil:item", {
|
||||
on_step = function(self)
|
||||
if self.object then
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
@ -11,10 +11,10 @@ minetest.register_tool("cottages:hammer", {
|
||||
max_drop_level = 1,
|
||||
groupcaps = {
|
||||
-- about equal to a stone pick (it's not intended as a tool)
|
||||
cracky = {times = {[2] = 2.00, [3] = 1.20}, uses = 30, maxlevel = 1},
|
||||
cracky = { times = { [2] = 2.00, [3] = 1.20 }, uses = 30, maxlevel = 1 },
|
||||
},
|
||||
damage_groups = {fleshy = 6},
|
||||
}
|
||||
damage_groups = { fleshy = 6 },
|
||||
},
|
||||
})
|
||||
|
||||
if cottages.settings.anvil.disable_hammer_repair then
|
||||
|
Reference in New Issue
Block a user