1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-25 18:20:36 +01:00

Add _misc and u_skins

- Backup de u_skins pas update (ne pas l’update pour l’instant)
- ajout d’un _misc à jour
This commit is contained in:
Ombridride 2014-11-08 23:21:10 +01:00
parent 7430cdabe9
commit b86ec17527
1437 changed files with 2295 additions and 0 deletions

19
mods/_misc/aliases.lua Normal file
View File

@ -0,0 +1,19 @@
-- Remove stone_with_tin from default carbone subgame => virer doublon minerais brutes
minetest.register_alias("default:stone_with_tin", "default:stone")
minetest.register_alias("default:stone_with_silver", "default:stone")
-- Remove lump from default carbone subgame => virer doublon minerais
minetest.register_alias("default:tin_lump", "default:stone")
minetest.register_alias("default:silver_lump", "default:stone")
-- Remove ingot from default carbone subgame => virer doublon lingots
minetest.register_alias("default:tin_ingot", "default:stone")
minetest.register_alias("default:silver_ingot", "default:stone")
-- Remove torch from torches => remise des torches par défaut
minetest.register_alias("torches:floor", "default:torch")
minetest.register_alias("torches:wand", "default:torch")
-- Remove copper_rail from moreores => utilisation des rail_copper du mod carts
minetest.register_alias("moreores:copper_rail", "carts:rail_copper")

136
mods/_misc/chatcommands.lua Normal file
View File

@ -0,0 +1,136 @@
--
-- Edited chat commands from core
--
-- /me
-- /help
-- /privs
-- /grant
-- /revoke
-- /setpassword
-- /clearpassword
-- /auth_reload
-- /teleport
-- /set
-- /mods
-- /give
-- /giveme
-- /spawnentity
-- /pulverize
-- /rollback_check
-- /rollback
-- /status
minetest.register_chatcommand("time", {
params = "<0...24000>",
description = "set time of day",
privs = {settime=true},
func = function(name, param)
if param == "" then
return false, "Missing time."
end
local newtime = tonumber(param)
if newtime == nil then
return false, "Invalid time."
end
minetest.set_timeofday((newtime % 24000) / 24000)
minetest.log("action", name .. " sets time " .. newtime)
minetest.chat_send_all(name .. " changed the time of day.")
end,
})
minetest.register_chatcommand("shutdown", {
description = "shutdown server",
privs = {server=true},
func = function(name, param)
minetest.log("action", name .. " shuts down server")
minetest.request_shutdown()
minetest.chat_send_all(name .. " just shut down the server.")
end,
})
minetest.register_chatcommand("ban", {
params = "<name>",
description = "Ban IP of player",
privs = {ban=true},
func = function(name, param)
if param == "" then
return true, "Ban list: " .. minetest.get_ban_list()
end
if not minetest.get_player_by_name(param) then
return false, "This player is not online at the moment. Use a /future_ban instead."
end
if not minetest.ban_player(param) then
return false, "Failed to ban player."
end
local desc = minetest.get_ban_description(param)
minetest.log("action", name .. " bans " .. desc .. ".")
return true, "Banned " .. desc .. "."
end,
})
-- /unban
-- /kick
-- /clearobjects
-- /msg
--
-- Other chat commands
--
-- Spawn command
--minetest.register_chatcommand("spawn", {
-- params = "",
-- description = "Teleport to the spawn location.",
-- privs = {shout=true},
-- func = function(name, param)
-- local player = minetest.env:get_player_by_name(name)
-- minetest.chat_send_player(name, "Teleported to spawn!")
-- player:setpos({x=0.0, y=5.0, z=0.0})
-- return true
-- end,
--})
--[[
-- Sethome command
minetest.register_chatcommand("sethome", {
params = "",
description = "Set your home location.",
privs = {shout=true},
func = function(name, param)
player = minetest.env:get_player_by_name(name)
test = player:getpos()
local file = io.open(minetest.get_worldpath().."/home/"..player:get_player_name().."_home", "w")
if not file then
minetest.chat_send_player(name, "Il y a eut une erreur, s'il vous plait contactez le detenteur du serveur.")
return
end
file:write(minetest.pos_to_string(test))
file:close()
minetest.chat_send_player(name, "Votre emplacement 'home' est definit ! Tapez /home pour vous y teleporter.")
end
})
-- Home command
minetest.register_chatcommand("home", {
params = "",
description = "Vous teleporte a l'emplacement de votre 'home'.",
privs = {shout=true},
func = function(name, param)
player = minetest.env:get_player_by_name(name)
local file = io.open(minetest.get_worldpath().."/home/"..player:get_player_name().."_home", "r")
if not file then
minetest.chat_send_player(name, "Vous devez definir votre emplacement 'home' ! Pour ce faire, utilisez la commande /sethome.")
return
end
local line = file:read("*line")
file:close()
local pos = minetest.string_to_pos(string.sub(line, 1, string.find(line, ")")))
if not pos or type(pos) ~= "table" then
minetest.chat_send_player(name, "Il y a eut une erreur, s'il vous plait contactez le detenteur du serveur.")
return
end
minetest.env:get_player_by_name(name):setpos(pos)
minetest.chat_send_player(name, "Vous voilà chez vous.")
end
})
--]]

View File

@ -0,0 +1,10 @@
-- Craft obsidian
minetest.register_craft({
output = "default:obsidian",
recipe = {
{"bucket:bucket_lava"},
},
replacements = {
{"bucket:bucket_lava", "bucket:bucket_empty"}
},
})

View File

@ -0,0 +1,10 @@
minetest.register_on_newplayer(function(player)
print("Un nouveau joueur vient de nous rejoindre !")
if minetest.setting_getbool("give_initial_stuff") then
print("Equipement de depart transmis")
player:get_inventory():add_item("main", "default:axe_wood")
player:get_inventory():add_item("main", "default:torch 10")
player:get_inventory():add_item("main", "default:sapling 2")
player:get_inventory():add_item("main", "default:apple 5")
end
end)

28
mods/_misc/init.lua Normal file
View File

@ -0,0 +1,28 @@
---------------------
-- Server Misc Mod --
---------------------
-- Give initial stuff
dofile(minetest.get_modpath("_misc").."/give_initial_stuff.lua")
-- Chat Commands
dofile(minetest.get_modpath("_misc").."/chatcommands.lua")
-- Rules
dofile(minetest.get_modpath("_misc").."/rules.lua")
-- No Interact Messages
dofile(minetest.get_modpath("_misc").."/nointeract_messages.lua")
-- irc
--dofile(minetest.get_modpath("_misc").."/irc.lua")
-- No Shout Messages
--dofile(minetest.get_modpath("_misc").."/noshout_messages.lua")
-- Aliases
dofile(minetest.get_modpath("_misc").."/aliases.lua")
-- Craft Obsidian
dofile(minetest.get_modpath("_misc").."/craft_obsidian.lua")
-- UnCraft Woll
dofile(minetest.get_modpath("_misc").."/uncraft_woll.lua")

81
mods/_misc/irc.lua Normal file
View File

@ -0,0 +1,81 @@
# Based on https://github.com/ChaosWormz/mt_terms_of_use
local IRC = [[
-~= Règles du salon de chat IRC #minetestforfun@irc.inchra.net =~-
(Ces règles ont é établies le 1er Novembre 2014 par les opérateurs du canal Mg et MinetestForFun)
1) Il ne sera toléré aucune transgressions aux règles du réseau InchraNet, sous peine de la sanction prévue par les administrateurs du réseau.
2) Il ne sera toléré aucune forme de violation des lois en vigueur dans les pays de résidence des participants, ainsi que ceux des hébergeurs des serveurs.
3) Il ne sera toléré aucune sorte d'insulte, de provocation gratuite, d'incitation à la haine, au meurtre, au suicide, ou toute autre forme d'atteinte au respect mutuel des utilisateurs de l'IRC.
4) Il ne sera toléré aucune forme de flood ainsi que de spam. Rappelez-vous qu'il est préférable d'utiliser un site de téléversion de texte (aussi nommé "pastebin"), tel que "pastebin.ubuntu.com" à chaque fois que vous désirez transmettre du code ou un long texte.
Le flood est l'action de saturer le chat de messages répétitifs, inutiles, y compris les join/part, grossiers, sans aucun rapport avec la conversation et au détriment des participants
Le spam est l'action de faire de la publicité pour quelque chose que ce soit sans l'accord d'un ayant droit ou d'un opérateur de canal.
5) Il ne sera toléré aucun pseudonyme à caractère sexuel, haineux, contenant des termes ou propos indésirables sur le salon.
6) Il ne sera toléré aucune forme d'harcèlement moral ou à caractère sexuel, y compris par messages privés.
7) Il ne sera toléré aucun type de discrimination contre quelque participant que ce soit, ni aucune forme d'insulte envers les opérateurs, semi-opérateurs et administrateurs d'InchraNet.
Voici les sanctions prévues pour les infractions aux règles ci-dessus.
+-----------------------+-----------------------------------+---------------------------------------+
| Niveau d'infraction : | Infraction(s) commise(s) : | Sanctions appliquées : |
| | Manque de respect enver autrui | Devoice une demi-journée |
| Niveau DIRT | Provocation envers autrui | Devoie une journée |
| | Insultes envers autrui | Kick + devoice une journée |
+-----------------------+-----------------------------------+---------------------------------------+
| | Récidive d'infraction niveau dirt | Kick + Ban 1/2 journée |
| Niveau STONE | Flood, Discrimination | Kick + devoice deux heures |
| | Spam | Kick + devoice 1 jour + ban 1/2 journée |
+-----------------------+-----------------------------------+---------------------------------------+
| | Récidive d'infraction niveau stone | Kick + Ban 4 jours + devoice 5 jours |
| Niveau MESE | Contenu à caractère sexuel | Kick + Ban 1 semaine + devoice 5 jours |
| | Irrespect envers l'équipe | Kick + Ban 10 jours + devoice 8 jours |
+-----------------------+-----------------------------------+---------------------------------------+
| | Récidive d'infraction niveau mese | Kick + Ban 1 mois + devoice 2 semaines |
| Niveau OBSIDIAN | Violation des lois en vigueur | Kick + Ban définitif + Gline |
| | Violation des règles d'InchraNet | Kick + Ban définitif + Gline |
+-----------------------+-----------------------------------+---------------------------------------+
Autres règles de bienséances :
- Ne demandez pas à faire partie des opérateurs/semi-opérateurs du canal.
- Attention, l'abus de query et msg est dangereux pour la santé.
- Inutile de faire étalage de votre vie privée si c'est hors contexte ou si personne n'est intéressé par celle ci.
- Nous ne sanctionnons bien évidemment pas le hors-sujet, toutefois, s'il est évitable ça ne peut quêtre toujours un plus !
- Le respect d'autrui est important à nos yeux.
- En cas de problème, n'hésitez pas à contacter le staff.
]]
local function make_formspec()
local size = { "size[10,8]" }
table.insert(size, "textarea[0.5,0.5;9.5,8;TOS;Voici les regles, cliquez sur Accepter si vous etes d'accord avec;"..minetest.formspec_escape(IRC).."]")
table.insert(size, "button_exit[6,7.4;1.5,0.5;accept;J'accepte]")
table.insert(size, "button[7.5,7.4;1.5,0.5;decline;Je refuse]")
return table.concat(size)
end
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "irc" then return end
local name = player:get_player_name()
if fields.accept then
minetest.chat_send_player(name, "Merci d'avoir accepte les regles, vous etes maintenant capable de parler.")
minetest.chat_send_player(name, "Pour plus d'informations tapez /news")
local privs = minetest.get_player_privs(name)
privs.shout = true
minetest.set_player_privs(name, privs)
end
return
elseif fields.decline then
minetest.kick_player(name, "Aurevoir ! Vous devez accepter les règles de l'irc pour jouer sur le serveur (revennez si vous changez d'avis).")
return
end
end)
minetest.register_chatcommand("irc",{
params = "",
description = "Montre les regles de l'irc",
privs = {spawn=true},
func = function (name,params)
local player = minetest.get_player_by_name(name)
minetest.after(1, function()
minetest.show_formspec(name, "irc", make_formspec())
end)
end
})

View File

@ -0,0 +1,12 @@
local TIMER = 0
minetest.register_globalstep(function(dtime)
TIMER = TIMER + dtime
if TIMER < 20 then return end
TIMER = 0
for _,player in ipairs(minetest.get_connected_players()) do
local name = player:get_player_name()
if not minetest.check_player_privs(name, {interact=true}) then
minetest.chat_send_player(name, "Hey " .. name .. " ! Pour pouvoir construire et intéragir sur ce serveur, tu dois lire les règles du serveur et les accepter. Tape /rules.")
end
end
end)

View File

@ -0,0 +1,12 @@
local TIMER = 0
minetest.register_globalstep(function(dtime)
TIMER = TIMER + dtime
if TIMER < 25 then return end
TIMER = 0
for _,player in ipairs(minetest.get_connected_players()) do
local name = player:get_player_name()
if not minetest.check_player_privs(name, {interact=true}) then
minetest.chat_send_player(name, "Hey " .. name .. " ! Pour pouvoir communiquer avec les autres joueurs sur ce serveur, tu dois lire les règles de l'irc et les accepter. Tape /irc.")
end
end
end)

55
mods/_misc/rules.lua Normal file
View File

@ -0,0 +1,55 @@
# Based on https://github.com/ChaosWormz/mt_terms_of_use
local RULES = [[
Voici les règles :
1) Aucune atteinte intentionnelle au bon fonctionnement du serveur ne sera admise. (lag, crash, exploit de bug, etc...)
2) La triche (hack, client modifié, etc...) n'est pas tolérée sur le serveur. Soyez fair-play et apprenez à jouer selon les règles.
3) Sur le serveur, le PVP est autorisé, le vole/grief est aussi autorisé. (pensez au mod areas pour protéger vos biens)
4) Merci de ne pas spammer ou flooder.
5) Chaque joueur à l'entière responsabilité de son compte, nous ne sommes en aucun cas responsable d'une utilisation frauduleuse de votre compte dans le jeu.
6) Si possible, évitez les constructions de tours en 1x1 et, poser des blocs gâchant le décor n'importe ou. Ceci pour que le serveur reste le plus beau, sauvage et naturel possibe.
7) Ne demandez pas à être membre de l'equipe du serveur.
8) Aucune forme d'insulte ou de racisme n'est admise.
Cliquez sur le bouton "Accepter" pour pouvoir construire et intéragir sur le serveur.
]]
local function make_formspec()
local size = { "size[10,8]" }
table.insert(size, "textarea[0.5,0.5;9.5,8;TOS;Voici les regles, cliquez sur Accepter si vous etes d'accord avec;"..RULES.."]")
table.insert(size, "button_exit[6,7.4;1.5,0.5;accept;J'accepte]")
table.insert(size, "button[7.5,7.4;1.5,0.5;decline;Je refuse]")
return table.concat(size)
end
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "rules" then return end
local name = player:get_player_name()
if fields.accept then
if minetest.check_player_privs(name, {shout=true}) then
minetest.chat_send_player(name, "Merci d'avoir accepte les regles, vous etes maintenant capable de construire et d'interagir avec le serveur.")
minetest.chat_send_player(name, "Amusez vous bien a survivre et construire !")
minetest.chat_send_player(name, "Pour plus d'informations tapez /news")
local privs = minetest.get_player_privs(name)
privs.interact = true
minetest.set_player_privs(name, privs)
end
return
elseif fields.decline then
minetest.kick_player(name, "Aurevoir ! Vous devez accepter les règles pour jouer sur le serveur (revennez si vous changez d'avis).")
return
end
end)
minetest.register_chatcommand("rules",{
params = "",
description = "Montre les regles du serveur",
privs = {shout=true},
func = function (name,params)
local player = minetest.get_player_by_name(name)
minetest.after(1, function()
minetest.show_formspec(name, "rules", make_formspec())
end)
end
})

119
mods/_misc/uncraft_woll.lua Normal file
View File

@ -0,0 +1,119 @@
-- récupéré les "cotton" des "wool" faite (récupère 3 aulieu de 4 et perte du colorant)
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:black"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:white"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:grey"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:dark_grey"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:blue"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:brown"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:cyan"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:green"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:dark_green"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:dark_grey"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:dark_grey"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:magenta"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:orange"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:pink"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:red"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:violet"},
},
})
minetest.register_craft({
output = "farming:cotton 3",
recipe = {
{"wool:yellow"},
},
})

BIN
mods/u_skins/MT_skins_updater.exe Executable file

Binary file not shown.

BIN
mods/u_skins/Newtonsoft.Json.dll Executable file

Binary file not shown.

28
mods/u_skins/README Executable file
View File

@ -0,0 +1,28 @@
minetest-u_skins
================
An skin extention for the Minetest mod unified_inventory by Dean Montgomery
It downloads the skins from the Minetest skin database. (http://minetest.fensta.bplaced.net)
Requires latest unified_inventory from:
https://github.com/minetest-technic/unified_inventory
To download the latest skins you need to run:
"./update_from_db.py" OR
the win32.NET client
Licenses:
--------
cornernote:
Lua source code (GPLv3)
Fritigern:
update_skins_db.sh (CC-BY-NC-SA 4.0)
Krock:
Lua source code (GPLv3)
MT_skins_updater.exe (WTFPL)
Credits:
--------
RealyBadAngel unified_inventory and Zeg9 skinsdb

View File

@ -0,0 +1,48 @@
#!/bin/sh
# This script is used to generate the previews needed by the mod
# It requires blender with the latest python API (2.6x is tested)
# A script that works with older blenders and, maybe, without python, is available in older commits.
# This script can also use pngcrush and imagemagick to reduce output size,
# please enable them if you want to push to the git repository of the mod.
# Pngcrush output will be written to .previews/pngcrush_output
# Warning: any file in .previews/ and u_skins/textures might be deleted without asking.
PNGCRUSH=true
IMAGEMAGICK=true
cd .previews
rm ../u_skins/textures/*_preview*.png # Remove all previous previews
blender -b skin_previews.blend --python-text "Generate previews" > /dev/null
if $IMAGEMAGICK
then echo "Stripping metadata from generated files..."
else echo "Moving files..."
fi
rm -rf output # remove my output
mkdir -p output
for i in blender_out/character_*_00.png;
do
out_name=$(basename $i | sed -e 's/_00.png//g')
out_file=output/"$out_name"_preview.png
if $IMAGEMAGICK
then
convert -strip $i $out_file
else
mv $i $out_file
fi
done
for i in blender_out/character_*_01.png;
do
out_name=$(basename $i | sed -e 's/_01.png//g')
out_file=output/"$out_name"_preview_back.png
if $IMAGEMAGICK
then
convert -strip $i $out_file
else
mv $i $out_file
fi
done
if $PNGCRUSH
then
echo "Running pngcrush..."
pngcrush -d ../u_skins/textures/ output/*_preview*.png 2> pngcrush_output
else mv output/*_preview*.png ../u_skins/textures/
fi
echo "Done !"

0
mods/u_skins/modpack.txt Executable file
View File

59
mods/u_skins/set_meta.sh Executable file
View File

@ -0,0 +1,59 @@
#!/bin/bash
SPRITES=$(find -regextype sed -regex '.*/player_[0-9]\{1,\}.png' | sort -V)
MODELS=$(find -regextype sed -regex '.*/character_[0-9]\{1,\}.png' | sort -V)
function ask_for_meta {
convert $2 -scale 100x200 /tmp/skins_set_meta
SNAME=$(basename $1)
SNAME=${SNAME%.*}
METAFILE=u_skins/meta/$SNAME.txt
FORCE=$3
if $FORCE || ! [ -f $METAFILE ]
then
echo $METAFILE
YADOUT=$(yad --form --image=/tmp/skins_set_meta --field $SNAME:LBL --field=Name --field=Author --field=Description --field=Comment)
if [ -z "$YADOUT" ]; then exit; fi # canceled
OIFS="$IFS"
IFS='|'
read -a VALUES <<< "$YADOUT"
IFS="$OIFS"
NAME=${VALUES[1]}
AUTHOR=${VALUES[2]}
DESCRIPTION=${VALUES[3]}
COMMENT=${VALUES[4]}
if [ -n "$NAME" ] && [ -n "$AUTHOR" ]
then
echo -n > $METAFILE # clear it
echo 'name = "'$NAME'",' >> $METAFILE
echo 'author = "'$AUTHOR'",' >> $METAFILE
# only write description and comment if they are specified
if [ -n "$DESCRIPTION" ]
then
echo 'description = "'$DESCRIPTION'",' >> $METAFILE
fi
if [ -n "$COMMENT" ]
then
echo 'comment = "'$COMMENT'",' >> $METAFILE
fi
echo "Saved !"
fi
fi
}
if [ -z $1 ]
then
for i in $SPRITES
do
ask_for_meta $i $i false
done
for i in $MODELS
do
ask_for_meta $i ${i%.*}_preview.png false
done
else
if [ -f ${1%.*}_preview.png ]
then
ask_for_meta $1 ${1%.*}_preview.png true
else
ask_for_meta $1 $1 true
fi
fi
rm /tmp/skins_set_meta

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,3 @@
Jovens
Ailton Junior
CC BY-SA 3.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

View File

@ -0,0 +1,3 @@
old skin in 3D
DS
CC BY-SA 3.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

View File

@ -0,0 +1,3 @@
Kirby
Rhys
CC BY-SA 3.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 919 B

View File

@ -0,0 +1,3 @@
Cool Bacon
Ghanastripes1
CC BY-SA 3.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

View File

@ -0,0 +1,3 @@
Invisibility Ninja
Minetestian
CC 0 (1.0)

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

View File

@ -0,0 +1,3 @@
Lil Ghast
Blitzfan
CC 0 (1.0)

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,3 @@
Mummy
TandT
CC BY-SA 3.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -0,0 +1,3 @@
Diamond Armor Sam
Block_Guy
CC BY-SA 3.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -0,0 +1,3 @@
Diamond Armor Sam
Block_Guy
CC BY-SA 3.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

View File

@ -0,0 +1,3 @@
HurtedOerkki
AMMOnym
CC BY-SA 3.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

View File

@ -0,0 +1,3 @@
Black
Calinou
CC BY 4.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

View File

@ -0,0 +1,3 @@
ShadowNinja
ShadowNinja
CC BY-SA 4.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -0,0 +1,2 @@
unified_inventory
default

165
mods/u_skins/u_skins/init.lua Executable file
View File

@ -0,0 +1,165 @@
-- Unified Skins for Minetest - based modified Bags from unfied_inventory and skins from inventory_plus
-- Copyright (c) 2012 cornernote, Dean Montgomery
-- License: GPLv3
u_skins = {}
u_skins.modpath = minetest.get_modpath("u_skins")
u_skins.file = minetest.get_worldpath().."/u_skins.mt"
u_skins.default = "character_1"
u_skins.pages = {}
u_skins.u_skins = {}
u_skins.file_save = false
-- ( Deprecated
u_skins.type = { SPRITE=0, MODEL=1, ERROR=99 }
u_skins.get_type = function(texture)
if not u_skins.is_skin(texture) then
return u_skins.type.ERROR
end
return u_skins.type.MODEL
end
-- )
u_skins.is_skin = function(texture)
if not texture then
return false
end
if not u_skins.meta[texture] then
return false
end
return true
end
dofile(u_skins.modpath.."/skinlist.lua")
dofile(u_skins.modpath.."/players.lua")
u_skins.update_player_skin = function(player)
local name = player:get_player_name()
if not u_skins.is_skin(u_skins.u_skins[name]) then
u_skins.u_skins[name] = u_skins.default
end
player:set_properties({
textures = {u_skins.u_skins[name]..".png"},
})
u_skins.file_save = true
end
-- Display Current Skin
unified_inventory.register_page("u_skins", {
get_formspec = function(player)
local name = player:get_player_name()
if not u_skins.is_skin(u_skins.u_skins[name]) then
u_skins.u_skins[name] = u_skins.default
end
local formspec = ("background[0.06,0.99;7.92,7.52;ui_misc_form.png]"
.."image[0,.75;1,2;"..u_skins.u_skins[name].."_preview.png]"
.."label[6,.5;Raw texture:]"
.."image[6,1;2,1;"..u_skins.u_skins[name]..".png]")
local meta = u_skins.meta[u_skins.u_skins[name]]
if meta then
if meta.name ~= "" then
formspec = formspec.."label[2,.5;Name: "..minetest.formspec_escape(meta.name).."]"
end
if meta.author ~= "" then
formspec = formspec.."label[2,1;Author: "..minetest.formspec_escape(meta.author).."]"
end
if meta.license ~= "" then
formspec = formspec.."label[2,1.5;License: "..minetest.formspec_escape(meta.license).."]"
end
if meta.description ~= "" then --what's that??
formspec = formspec.."label[2,2;Description: "..minetest.formspec_escape(meta.description).."]"
end
end
local page = 0
if u_skins.pages[name] then
page = u_skins.pages[name]
end
formspec = formspec .. "button[.75,3;6.5,.5;u_skins_page$"..page..";Change]"
return {formspec=formspec}
end,
})
unified_inventory.register_button("u_skins", {
type = "image",
image = "u_skins_button.png",
})
-- Create all of the skin-picker pages.
u_skins.generate_pages = function(texture)
local page = 0
local pages = {}
for i, skin in ipairs(u_skins.list) do
local p_index = (i - 1) % 16
if p_index == 0 then
page = page + 1
pages[page] = {}
end
pages[page][p_index + 1] = {i, skin}
end
local total_pages = page
page = 1
for page, arr in ipairs(pages) do
local formspec = "background[0.06,0.99;7.92,7.52;ui_misc_form.png]"
local y = -0.1
for i, skin in ipairs(arr) do
local x = (i - 1) % 8
if i > 1 and x == 0 then
y = 1.8
end
formspec = (formspec.."image_button["..x..","..y..";1,2;"
..skin[2].."_preview.png;u_skins_set$"..skin[1]..";]")
end
local page_prev = page - 2
local page_next = page
if page_prev < 0 then
page_prev = total_pages - 1
end
if page_next >= total_pages then
page_next = 0
end
formspec = (formspec
.."button[0,3.8;1,.5;u_skins_page$"..page_prev..";<<]"
.."button[.75,3.8;6.5,.5;u_skins_null;Page "..page.."/"..total_pages.."]"
.."button[7,3.8;1,.5;u_skins_page$"..page_next..";>>]")
unified_inventory.register_page("u_skins_page$"..(page - 1), {
get_formspec = function(player)
return {formspec=formspec}
end
})
end
end
-- click button handlers
minetest.register_on_player_receive_fields(function(player, formname, fields)
if fields.u_skins then
unified_inventory.set_inventory_formspec(player, "craft")
return
end
for field, _ in pairs(fields) do
local current = string.split(field, "$", 2)
if current[1] == "u_skins_set" then
u_skins.u_skins[player:get_player_name()] = u_skins.list[tonumber(current[2])]
u_skins.update_player_skin(player)
unified_inventory.set_inventory_formspec(player, "u_skins")
elseif current[1] == "u_skins_page" then
u_skins.pages[player:get_player_name()] = current[2]
unified_inventory.set_inventory_formspec(player, "u_skins_page$"..current[2])
end
end
end)
-- Change skin on join - reset if invalid
minetest.register_on_joinplayer(function(player)
local player_name = player:get_player_name()
if not u_skins.is_skin(u_skins.u_skins[player_name]) then
u_skins.u_skins[player_name] = u_skins.default
end
u_skins.update_player_skin(player)
end)
u_skins.generate_pages()
u_skins.load_players()

15
mods/u_skins/u_skins/meta.lua Executable file
View File

@ -0,0 +1,15 @@
u_skins.meta = {}
for _, i in ipairs(u_skins.list) do
u_skins.meta[i] = {}
local f = io.open(u_skins.modpath.."/meta/"..i..".txt")
local data = nil
if f then
data = minetest.deserialize("return {"..f:read('*all').."}")
f:close()
end
data = data or {}
u_skins.meta[i].name = data.name or ""
u_skins.meta[i].author = data.author or ""
u_skins.meta[i].description = data.description or nil
u_skins.meta[i].comment = data.comment or nil
end

View File

@ -0,0 +1,3 @@
Sam 0
Jordach
CC BY-SA 3.0

View File

@ -0,0 +1,3 @@
Tuxedo Sam
Jordach
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Franklin
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Trevor
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Bart Simpson
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Creeper
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
War Machine
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Gangnam Style
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Sonic The Hedgehog
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Charizard
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Scarlet Spider-man
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Ferdi Napoli
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Semmett9
Infinatum
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Finn The Adventured
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Jake
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Ferdi Napoli Reserve
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Joker
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Bleau Steve
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Deadpool Bleau
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Seth Rollins
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Daffy Duck
LuxAtheris
CC BY-SA 3.0

View File

@ -0,0 +1,3 @@
DareDevil
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Clone
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
John
Evergreen
CC BY-SA 3.0

View File

@ -0,0 +1,3 @@
Banana Guy
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Rubber
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Gothic Sam
GingerHunter797
CC BY-SA 3.0

View File

@ -0,0 +1,3 @@
Tails
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Aguia Explorer
Davizinho
CC BY-SA 3.0

View File

@ -0,0 +1,3 @@
Toad
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
oOChainLynxOo
oOChainLynxOo
CC BY-SA 3.0

View File

@ -0,0 +1,3 @@
amazing spiderman
mateus
CC BY-SA 3.0

View File

@ -0,0 +1,3 @@
black spiderman
mateus
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Sam Mese Tee
oOChainLynxOo
CC BY-SA 3.0

View File

@ -0,0 +1,3 @@
rotor112
rotor112
CC BY-SA 3.0

View File

@ -0,0 +1,3 @@
Jesus
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Wires
Geopbyte
CC BY-SA 3.0

View File

@ -0,0 +1,3 @@
Vector
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
Fire Mario
Ferdi Napoli
CC BY-NC-SA 3.0

View File

@ -0,0 +1,3 @@
skin minecraft
lestouem
CC BY-SA 3.0

Some files were not shown because too many files have changed in this diff Show More