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

This commit is contained in:
teknomunk 2024-12-05 08:57:31 -06:00
parent 0d8f7515c6
commit 5db55dde3c
8 changed files with 13 additions and 13 deletions

View file

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

View file

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

View file

@ -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."), 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."), _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", 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) _on_dispense = function(itemstack, dispenserpos, droppos, dropnode, dropdir)
-- Shoot arrow -- Shoot arrow
local shootpos = vector.add(dispenserpos, vector.multiply(dropdir, 0.51)) local shootpos = vector.add(dispenserpos, vector.multiply(dropdir, 0.51))

View file

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

View file

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

View file

@ -17,7 +17,7 @@ core.register_craftitem("mcl_throwing:ender_pearl", {
inventory_image = "mcl_throwing_ender_pearl.png", inventory_image = "mcl_throwing_ender_pearl.png",
stack_max = 16, stack_max = 16,
on_use = mcl_throwing.get_player_throw_function("mcl_throwing:ender_pearl_entity"), 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) function on_collide(self, pos, node)
@ -91,7 +91,7 @@ function on_collide(self, pos, node)
local oldpos = player:get_pos() local oldpos = player:get_pos()
-- Teleport and hurt player -- Teleport and hurt player
player:set_pos(telepos) 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 -- 5% chance to spawn endermite at the player's origin
if math.random(1,20) == 1 then if math.random(1,20) == 1 then

View file

@ -12,7 +12,7 @@ core.register_craftitem("mcl_throwing:snowball", {
_doc_items_usagehelp = how_to_throw, _doc_items_usagehelp = how_to_throw,
inventory_image = "mcl_throwing_snowball.png", inventory_image = "mcl_throwing_snowball.png",
stack_max = 64, stack_max = 64,
groups = { weapon_ranged = 1 }, groups = {weapon_ranged = 1},
on_use = mcl_throwing.get_player_throw_function("mcl_throwing:snowball_entity"), on_use = mcl_throwing.get_player_throw_function("mcl_throwing:snowball_entity"),
_on_dispense = mcl_throwing.dispense_function, _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()) snowball_particles(self._last_pos or pos, self.object:get_velocity())
end, end,
sounds = { sounds = {
on_solid_collision = {"mcl_throwing_snowball_impact_hard", { 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} 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) mcl_throwing.register_throwable_object("mcl_throwing:snowball", "mcl_throwing:snowball_entity", 22)

View file

@ -491,7 +491,7 @@ local function handle_entity_collision(self, entity_def, projectile_def, object)
dmg = dmg(self, entity_def, projectile_def, object) dmg = dmg(self, entity_def, projectile_def, object)
end 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 -- Guard against crashes when projectiles get destroyed in response to what it punched
if not self.object:get_pos() then return true end if not self.object:get_pos() then return true end