Update { ... } to {...}

This commit is contained in:
teknomunk 2024-12-05 08:57:31 -06:00
parent 4c5b29b404
commit c63cd9c96d
8 changed files with 13 additions and 13 deletions

@ -65,7 +65,7 @@ local arrow_entity = {
damages_players = true,
maximum_time = 60,
damage_groups = function(self)
return { fleshy = self._damage }
return {fleshy = self._damage}
end,
hide_tracer = function(self)
return self._stuck or self._damage < 9 or self._in_player
@ -165,7 +165,7 @@ local arrow_entity = {
return core.serialize(out)
end,
on_activate = function(self, staticdata, dtime_s)
self.object:set_armor_groups({ immortal = 1 })
self.object:set_armor_groups({immortal = 1})
self._time_in_air = 1.0
local data = core.deserialize(staticdata)

@ -70,7 +70,7 @@ function mcl_bows.shoot_arrow(arrow_item, pos, dir, yaw, shooter, power, damage,
le._arrow_item = arrow_item
local item_def = core.registered_items[le._arrow_item]
if item_def and item_def._arrow_image then
obj:set_properties({ textures = item_def._arrow_image })
obj:set_properties({textures = item_def._arrow_image})
end
core.sound_play("mcl_bows_bow_shoot", {pos=pos, max_hear_distance=16}, true)
if shooter and shooter:is_player() then

@ -223,7 +223,7 @@ core.register_craftitem("mcl_bows:rocket", {
S("Arrows might get stuck on solid blocks and can be retrieved again. They are also capable of pushing wooden buttons."),
_doc_items_usagehelp = S("To use arrows as ammunition for a bow, just put them anywhere in your inventory, they will be used up automatically. To use arrows as ammunition for a dispenser, place them in the dispenser's inventory. To retrieve an arrow that sticks in a block, simply walk close to it."),
inventory_image = "mcl_bows_rocket.png",
groups = { ammo=1, ammo_crossbow=1, ammo_bow_regular=1 },
groups = {ammo=1, ammo_crossbow=1, ammo_bow_regular=1},
_on_dispense = function(itemstack, dispenserpos, droppos, dropnode, dropdir)
-- Shoot arrow
local shootpos = vector.add(dispenserpos, vector.multiply(dropdir, 0.51))

@ -327,7 +327,7 @@ vl_projectile.register("mcl_fishing:flying_bobber_entity", {
behaviors = {
vl_projectile.collides_with_solids,
},
collides_with = { "group:liquid" },
collides_with = {"group:liquid"},
on_collide_with_solid = function(self, pos, node)
local player = self._owner

@ -14,7 +14,7 @@ core.register_craftitem("mcl_throwing:egg", {
stack_max = 64,
on_use = mcl_throwing.get_player_throw_function("mcl_throwing:egg_entity"),
_on_dispense = mcl_throwing.dispense_function,
groups = { craftitem = 1 },
groups = {craftitem = 1},
})
local function egg_spawn_chicks(pos)

@ -17,7 +17,7 @@ core.register_craftitem("mcl_throwing:ender_pearl", {
inventory_image = "mcl_throwing_ender_pearl.png",
stack_max = 16,
on_use = mcl_throwing.get_player_throw_function("mcl_throwing:ender_pearl_entity"),
groups = { transport = 1 },
groups = {transport = 1},
})
function on_collide(self, pos, node)
@ -91,7 +91,7 @@ function on_collide(self, pos, node)
local oldpos = player:get_pos()
-- Teleport and hurt player
player:set_pos(telepos)
player:set_hp(player:get_hp() - 5, { type = "fall", from = "mod" })
player:set_hp(player:get_hp() - 5, {type = "fall", from = "mod"})
-- 5% chance to spawn endermite at the player's origin
if math.random(1,20) == 1 then

@ -12,7 +12,7 @@ core.register_craftitem("mcl_throwing:snowball", {
_doc_items_usagehelp = how_to_throw,
inventory_image = "mcl_throwing_snowball.png",
stack_max = 64,
groups = { weapon_ranged = 1 },
groups = {weapon_ranged = 1},
on_use = mcl_throwing.get_player_throw_function("mcl_throwing:snowball_entity"),
_on_dispense = mcl_throwing.dispense_function,
})
@ -71,10 +71,10 @@ vl_projectile.register("mcl_throwing:snowball_entity", {
snowball_particles(self._last_pos or pos, self.object:get_velocity())
end,
sounds = {
on_solid_collision = {"mcl_throwing_snowball_impact_hard", { max_hear_distance=16, gain=0.7 }, true},
on_entity_collision = {"mcl_throwing_snowball_impact_soft", { max_hear_distance=16, gain=0.7 }, true}
on_solid_collision = {"mcl_throwing_snowball_impact_hard", {max_hear_distance=16, gain=0.7}, true},
on_entity_collision = {"mcl_throwing_snowball_impact_soft", {max_hear_distance=16, gain=0.7}, true}
},
damage_groups = { snowball_vulnerable = 3 },
damage_groups = {snowball_vulnerable = 3},
},
})
mcl_throwing.register_throwable_object("mcl_throwing:snowball", "mcl_throwing:snowball_entity", 22)

@ -491,7 +491,7 @@ local function handle_entity_collision(self, entity_def, projectile_def, object)
dmg = dmg(self, entity_def, projectile_def, object)
end
object:punch(self.object, 1.0, projectile_def.tool or { full_punch_interval = 1.0, damage_groups = dmg }, dir )
object:punch(self.object, 1.0, projectile_def.tool or {full_punch_interval = 1.0, damage_groups = dmg}, dir )
-- Guard against crashes when projectiles get destroyed in response to what it punched
if not self.object:get_pos() then return true end