From c7cc9ccb3e9e1af913491cc59c7c13d9f0cf7ff3 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 6 Nov 2022 12:30:16 +0100 Subject: [PATCH] Add raid captain spawn func with banner attach --- mods/ENVIRONMENT/mcl_raids/init.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mods/ENVIRONMENT/mcl_raids/init.lua b/mods/ENVIRONMENT/mcl_raids/init.lua index 288df6e39..b5bf4ba79 100644 --- a/mods/ENVIRONMENT/mcl_raids/init.lua +++ b/mods/ENVIRONMENT/mcl_raids/init.lua @@ -38,6 +38,27 @@ local extra_wave = { --["mobs_mc:ravager"] = 2, } +local oban_def = minetest.registered_entities["mcl_banners:standing_banner"] +oban_def.visual_size = { x=1, y=1 } +minetest.register_entity(":mcl_raids:ominous_banner",oban_def) + +function mcl_raids.spawn_raidcaptain(pos) + local c = minetest.add_entity(pos,"mobs_mc:pillager") + local b = minetest.add_entity(pos,"mcl_raids:ominous_banner") + --TODO: add actual banner pattern + --b:set_properties({textures = {mcl_banners.make_banner_texture(self._base_color, self._layers)}}) + b:get_luaentity() + b:set_attach(c,"",vector.new(-1.75,5.5,-0.5),vector.new(0,0,0),true) +end + +minetest.register_chatcommand("raidcap",{ + privs = {debug = true}, + func = function(pname,param) + mcl_raids.spawn_raidcaptain(minetest.get_player_by_name(pname):get_pos()) + end, +}) + + function mcl_raids.spawn_raid(event) local pos = event.pos local wave = event.stage