Make: mod into modpack

This commit is contained in:
Coder12a 2019-12-16 18:23:32 -06:00
parent 54389cda26
commit b0301130dc
32 changed files with 48 additions and 44 deletions

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019 Coder12a
Copyright (c) 2019 Coder12
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,4 +1,4 @@
# factions
mod for minetest
modpack for minetest
Mod for handling in game factions.
Mods for handling in game factions.

View File

@ -488,3 +488,5 @@ function factionUpdate()
factions.faction_tick()
minetest.after(factions_config.tick_time, factionUpdate)
end
minetest.after(factions_config.tick_time, factionUpdate)

2
fac/mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = fac
depends = fac_config

View File

@ -910,7 +910,7 @@ factions.register_command("show_parcel", {
local psc = parcel_size_center
local fps = factions_config.parcel_size
local ppos = {x = (math.floor(pos.x / fps) * fps) + psc, y = (math.floor(pos.y / fps) * fps) + psc, z = (math.floor(pos.z / fps) * fps) + psc}
minetest.add_entity(ppos, "factions:display")
minetest.add_entity(ppos, "fac_objects:display")
return true
end
})

1
fac_chat/mod.conf Normal file
View File

@ -0,0 +1 @@
name = fac_chat

1
fac_config/mod.conf Normal file
View File

@ -0,0 +1 @@
name = fac_config

View File

@ -17,6 +17,7 @@ if factions_config.database == "colddb" then
factions.players = factions.root.sub_database("players")
factions.player_ips = factions.root.sub_database("ips")
elseif factions_config.database == "mod_storage" then
dofile (minetest.get_modpath("fac_database") .. "/storagedb.lua")
factions.root = storagedb.Storagedb("factions")
factions.factions = factions.root.sub_database("factions")
factions.parcels = factions.root.sub_database("parcels")

3
fac_database/mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = fac_database
depends = fac_config
optional_depends = colddb

8
fac_events/init.lua Normal file
View File

@ -0,0 +1,8 @@
local path = minetest.get_modpath("fac_events")
dofile (path .. "/claim_events.lua")
dofile (path .. "/diplomacy_events.lua")
dofile (path .. "/eventcallbacks.lua")
dofile (path .. "/invite_events.lua")
dofile (path .. "/player_events.lua")
dofile (path .. "/power_events.lua")
dofile (path .. "/rank_events.lua")

2
fac_events/mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = fac_events
depends = fac

View File

@ -54,21 +54,20 @@ minetest.register_on_leaveplayer(function(player)
end)
minetest.register_on_respawnplayer(function(player)
local name = player:get_player_name()
local faction, facname = factions.get_player_faction(name)
if not faction then
return false
else
on_death[name] = nil
if not faction.spawn then
return false
else
player:set_pos(faction.spawn)
return true
end
end
end
)
local name = player:get_player_name()
local faction, facname = factions.get_player_faction(name)
if not faction then
return false
else
on_death[name] = nil
if not faction.spawn then
return false
else
player:set_pos(faction.spawn)
return true
end
end
end)
minetest.register_on_dieplayer(function(player)
local pname = player:get_player_name()

View File

@ -122,3 +122,5 @@ function hudUpdateClaimInfo()
end
minetest.after(3, hudUpdateClaimInfo)
end
hudUpdateClaimInfo()

1
fac_hud/mod.conf Normal file
View File

@ -0,0 +1 @@
name = fac_hud

View File

@ -198,7 +198,7 @@ end)
local x = math.floor(factions_config.parcel_size / 2.1)
minetest.register_node("factions:display_node", {
minetest.register_node("fac_objects:display_node", {
tiles = {"factions_display.png"},
use_texture_alpha = true,
walkable = false,
@ -227,12 +227,12 @@ minetest.register_node("factions:display_node", {
drop = "",
})
minetest.register_entity("factions:display", {
minetest.register_entity("fac_objects:display", {
physical = false,
collisionbox = {0, 0, 0, 0, 0, 0},
visual = "wielditem",
visual_size = {x = 1.0 / 1.5, y = 1.0 / 1.5},
textures = {"factions:display_node"},
textures = {"fac_objects:display_node"},
timer = 0,
on_step = function(self, dtime)

2
fac_objects/mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = fac_objects
depends = fac

View File

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 235 B

1
fac_protect/mod.conf Normal file
View File

@ -0,0 +1 @@
name = fac_protect

View File

@ -1,19 +0,0 @@
--!path of mod
factions_modpath = minetest.get_modpath("factions")
dofile (factions_modpath .. "/config.lua")
dofile (factions_modpath .. "/storagedb.lua")
dofile (factions_modpath .. "/databases.lua")
dofile (factions_modpath .. "/eventcallbacks.lua")
dofile (factions_modpath .. "/diplomacy_events.lua")
dofile (factions_modpath .. "/invite_events.lua")
dofile (factions_modpath .. "/player_events.lua")
dofile (factions_modpath .. "/power_events.lua")
dofile (factions_modpath .. "/protection_override.lua")
dofile (factions_modpath .. "/rank_events.lua")
dofile (factions_modpath .. "/hud.lua")
dofile (factions_modpath .. "/claim_events.lua")
dofile (factions_modpath .. "/factions.lua")
dofile (factions_modpath .. "/chatcommands.lua")
dofile (factions_modpath .. "/nodes.lua")
minetest.after(1, hudUpdateClaimInfo)
minetest.after(factions_config.tick_time, factionUpdate)

View File

@ -1,3 +0,0 @@
name = factions
description = Mc style faction system.
optional_depends = colddb

1
modpack.conf Normal file
View File

@ -0,0 +1 @@
name = factions