Compare commits
5 Commits
e40827e955
...
c0cea7b1df
Author | SHA1 | Date |
---|---|---|
shivajiva101 | c0cea7b1df | |
shivajiva101 | fb558a2153 | |
David Leal | 993394778e | |
shivajiva101 | a655a42942 | |
Panquesito7 | ce533f3816 |
|
@ -0,0 +1,11 @@
|
|||
on: [push, pull_request]
|
||||
name: Check & Release
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: lint
|
||||
uses: Roang-zero1/factorio-mod-luacheck@master
|
||||
with:
|
||||
luacheckrc_url: https://raw.githubusercontent.com/shivajiva101/minetest-gamehub/master/.luacheckrc
|
|
@ -0,0 +1,26 @@
|
|||
unused_args = false
|
||||
allow_defined_top = true
|
||||
max_line_length = 999
|
||||
|
||||
globals = {
|
||||
"gamehub", "unified_inventory",
|
||||
}
|
||||
|
||||
read_globals = {
|
||||
string = {fields = {"split", "trim"}},
|
||||
table = {fields = {"copy", "getn"}},
|
||||
|
||||
-- Minetest
|
||||
"minetest", "core",
|
||||
"vector", "ItemStack",
|
||||
"VoxelArea",
|
||||
|
||||
"default", "playerplus",
|
||||
"armor", "areas",
|
||||
"worldedit", "sqlite3",
|
||||
|
||||
"jail", "stairsplus", "signs_lib",
|
||||
}
|
||||
|
||||
files["gamehub/commands.lua"].ignore = { "pos" }
|
||||
files["jail/init.lua"].ignore = { "owner" }
|
11
ReadMe.md
11
ReadMe.md
|
@ -1,6 +1,9 @@
|
|||
## Gamehub Modpack
|
||||
### for minetest by shivajiva101@hotmail.com
|
||||
|
||||
[![Build status](https://github.com/shivajiva101/minetest-gamehub/workflows/Check%20&%20Release/badge.svg)](https://github.com/shivajiva101/minetest-gamehub/actions)
|
||||
[![License](https://img.shields.io/badge/license-AGPLv3.0%2B-blue.svg)](https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
|
||||
This mod provides a hub concept for sub games within a Minetest world.
|
||||
|
||||
Designed to handle privileges, inventory, transport and rewards.
|
||||
|
@ -94,7 +97,7 @@ so it's important to think about what you call the area, prior to building a gam
|
|||
|
||||
3 files will be created in your worlds /schems folder which you can compress as a set to share with your friends and the community.
|
||||
### Jail
|
||||
A simple but powerful mechanism is used to jail players and disable their functionality. The jail building is inserted in the bowels of the world, a fitting place for a player finding themselves on the wrong side of the server management team. To jail a player use the command:
|
||||
A simple but powerful mechanism is used to jail players and disable their functionality. The jail is inserted in the bowels of the world, a fitting place for a player finding themselves on the wrong side of the server management team. To jail a player use the command:
|
||||
|
||||
``/jail <player> <duration> <reason>``
|
||||
|
||||
|
@ -102,7 +105,7 @@ A simple but powerful mechanism is used to jail players and disable their functi
|
|||
|
||||
``/jail Steve 1w trolling a staff member ``
|
||||
|
||||
this would jail Steve for 1 week and will automatically expire. The hub_mod privilege is required before you can jail players.
|
||||
would jail Steve for 1 week and automatically expire. The hub_mod privilege is required before you can jail players.
|
||||
To unjail a currently jailed player use the following command:
|
||||
|
||||
``/unjail <player>``
|
||||
|
@ -119,6 +122,4 @@ See individual credit.txt in the respective folders for further information.
|
|||
|
||||
This modpack was inspired by running a Skyblock server and time spent playing with the code, friends who undoubtedly know who they are, plus all the Minetest developers & mod developers contributions that enabled it.
|
||||
### Status
|
||||
Functional, not fully tested
|
||||
|
||||
THIS MODPACK IS A WIP!
|
||||
Functional, fully tested.
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Adds a games hub, jail and shop to your world. Load the examples or create your own mini games and share them with the community.
|
|
@ -19,6 +19,7 @@ This file is part of gamehub.
|
|||
|
||||
local ie = gamehub.ie
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local WP = minetest.get_worldpath()
|
||||
|
||||
-----------------------
|
||||
-- Helper Functions --
|
||||
|
@ -45,7 +46,7 @@ local function handle_grant_command(caller, grant_name, grant_priv_str)
|
|||
local privs = minetest.get_player_privs(grant_name)
|
||||
local privs_unknown = ""
|
||||
local basic_privs = minetest.string_to_privs(
|
||||
minetest.setting_get("basic_privs") or "interact,shout")
|
||||
minetest.settings:get("basic_privs") or "interact,shout")
|
||||
|
||||
if grant_priv_str == "all" then
|
||||
grantprivs = minetest.registered_privileges
|
||||
|
@ -69,8 +70,8 @@ local function handle_grant_command(caller, grant_name, grant_priv_str)
|
|||
if not gamehub.player[grant_name] then
|
||||
gamehub.load_player(grant_name)
|
||||
if gamehub.player[grant_name] then
|
||||
gamehub.update_player_field(grant_name, "privs", privs)
|
||||
gamehub.player[grant_name] = nil
|
||||
gamehub.update_player_field(grant_name, "privs", privs)
|
||||
gamehub.player[grant_name] = nil
|
||||
minetest.log("action", caller..
|
||||
' granted ('..grant_priv_str..
|
||||
') privileges to '..grant_name)
|
||||
|
@ -122,7 +123,7 @@ local function handle_revoke_command(caller, revoke_name, revoke_priv_str)
|
|||
local revoke_privs = minetest.string_to_privs(revoke_priv_str)
|
||||
local privs = minetest.get_player_privs(revoke_name)
|
||||
local basic_privs = minetest.string_to_privs(
|
||||
minetest.setting_get("basic_privs") or "interact,shout")
|
||||
minetest.settings:get("basic_privs") or "interact,shout")
|
||||
for priv, _ in pairs(revoke_privs) do
|
||||
if not basic_privs[priv] and
|
||||
not minetest.check_player_privs(caller, {privs=true}) then
|
||||
|
@ -197,7 +198,7 @@ minetest.register_chatcommand("hub", {
|
|||
return false, "Insufficient privs!"
|
||||
end
|
||||
|
||||
local cmd, helper, list, param1, param2, player
|
||||
local cmd, helper, list, param2, player
|
||||
|
||||
helper = [[Usage:
|
||||
/hub add
|
||||
|
@ -511,7 +512,7 @@ minetest.register_chatcommand("hub", {
|
|||
-- serialize metadata
|
||||
local result, count = gamehub.serialize_meta(area.pos1, area.pos2)
|
||||
|
||||
local path = minetest.get_worldpath() .. "/schems"
|
||||
local path = WP .. "/schems"
|
||||
local filename = path .. "/" .. area.name .. ".we"
|
||||
local file, err = ie.io.open(filename, "wb")
|
||||
|
||||
|
@ -555,7 +556,7 @@ minetest.register_chatcommand("hub", {
|
|||
elseif cmd == 'unstage' then
|
||||
|
||||
local num = tonumber(list[2])
|
||||
local stages, data, fresh, msg, game
|
||||
local stages, data, fresh, msg
|
||||
local area, ctr = gamehub.area_at_pos(pos)
|
||||
if area and ctr == 1 then
|
||||
data = gamehub.game[area.name].data
|
||||
|
@ -623,10 +624,10 @@ minetest.register_chatcommand("info", {
|
|||
|
||||
-- replace default revoke/grant privileges commands
|
||||
minetest.override_chatcommand("revoke", {
|
||||
params = "<name> (<privilege> | all)",
|
||||
description = "Remove privilege from player",
|
||||
privs = {privs=true},
|
||||
func = function(name, param)
|
||||
params = "<name> (<privilege> | all)",
|
||||
description = "Remove privilege from player",
|
||||
privs = {privs=true},
|
||||
func = function(name, param)
|
||||
local revoke_name, revoke_priv_str = string.match(param, "([^ ]+) (.+)")
|
||||
if not revoke_name or not revoke_priv_str then
|
||||
return true, "Invalid parameters (see /help revoke)"
|
||||
|
@ -634,7 +635,7 @@ minetest.override_chatcommand("revoke", {
|
|||
return true, "Player " .. revoke_name .. " does not exist."
|
||||
end
|
||||
return handle_revoke_command(name, revoke_name, revoke_priv_str)
|
||||
end,
|
||||
end,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
3d_armor?
|
||||
abriglass?
|
||||
areas
|
||||
default
|
||||
frame?
|
||||
maptools
|
||||
moreblocks?
|
||||
moreores?
|
||||
unified_inventory
|
||||
worldedit
|
|
@ -0,0 +1,3 @@
|
|||
name = gamehub
|
||||
depends = areas, default, maptools, unified_inventory, worldedit
|
||||
optional_depends = 3d_armor, abriglass, frame, moreblocks, moreores
|
|
@ -270,7 +270,7 @@ minetest.register_node("gamehub:egg", {
|
|||
is_ground_content = false,
|
||||
groups = {crumbly = 1, not_in_creative_inventory = 1},
|
||||
drop = {},
|
||||
sounds = default.node_sound_stone_defaults,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
if minetest.get_modpath("moreblocks") then
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
gamehub
|
|
@ -0,0 +1,2 @@
|
|||
name = jail
|
||||
depends = gamehub
|
|
@ -0,0 +1,2 @@
|
|||
name = minetest-gamehub
|
||||
description = Adds a games hub, jail and shop to your world. Load the examples or create your own mini-games and share them with the community.
|
|
@ -1,2 +0,0 @@
|
|||
gamehub
|
||||
unified_inventory
|
|
@ -0,0 +1,2 @@
|
|||
name = shop
|
||||
depends = gamehub, unified_inventory
|
|
@ -84,7 +84,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||
tonumber(fields.shop_selling), tonumber(fields.shop_moq))
|
||||
end
|
||||
unified_inventory.set_inventory_formspec(player, "shop_manager") -- refresh
|
||||
|
||||
|
||||
end
|
||||
end)
|
||||
|
||||
|
|
Loading…
Reference in New Issue