mirror of
https://github.com/ElCeejo/creatura.git
synced 2025-03-21 15:21:24 +00:00
Spawn Item color region renaming
This commit is contained in:
parent
d62afbc2cc
commit
a043bb4f94
1 changed files with 9 additions and 3 deletions
12
spawning.lua
12
spawning.lua
|
@ -74,9 +74,12 @@ end
|
||||||
function creatura.register_spawn_item(name, def)
|
function creatura.register_spawn_item(name, def)
|
||||||
local inventory_image
|
local inventory_image
|
||||||
if not def.inventory_image
|
if not def.inventory_image
|
||||||
and def.col1 and def.col2 then
|
and ((def.col1 and def.col2)
|
||||||
local base = "(creatura_spawning_crystal_primary.png^[multiply:#" .. def.col1 .. ")"
|
or (def.hex_primary and def.hex_secondary)) then
|
||||||
local spots = "(creatura_spawning_crystal_secondary.png^[multiply:#" .. def.col2 .. ")"
|
local primary = def.col1 or def.hex_primary
|
||||||
|
local secondary = def.col2 or def.hex_secondary
|
||||||
|
local base = "(creatura_spawning_crystal_primary.png^[multiply:#" .. primary .. ")"
|
||||||
|
local spots = "(creatura_spawning_crystal_secondary.png^[multiply:#" .. secondary .. ")"
|
||||||
inventory_image = base .. "^" .. spots
|
inventory_image = base .. "^" .. spots
|
||||||
end
|
end
|
||||||
local mod_name = name:split(":")[1]
|
local mod_name = name:split(":")[1]
|
||||||
|
@ -103,6 +106,9 @@ function creatura.register_spawn_item(name, def)
|
||||||
if object then
|
if object then
|
||||||
object:set_yaw(random(0, pi * 2))
|
object:set_yaw(random(0, pi * 2))
|
||||||
object:get_luaentity().last_yaw = object:get_yaw()
|
object:get_luaentity().last_yaw = object:get_yaw()
|
||||||
|
if def.on_spawn then
|
||||||
|
def.on_spawn(object:get_luaentity(), player)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if not minetest.is_creative_enabled(player:get_player_name())
|
if not minetest.is_creative_enabled(player:get_player_name())
|
||||||
or def.consume_in_creative then
|
or def.consume_in_creative then
|
||||||
|
|
Loading…
Add table
Reference in a new issue