diff --git a/README.md b/README.md index e5df13a..45e0eec 100644 --- a/README.md +++ b/README.md @@ -1 +1,26 @@ -antipvp +# AntiPVP v1.0.0 + +[![Baixar](https://img.shields.io/badge/Baixar-v1.0.0-green.svg)](https://github.com/BrunoMine/antipvp/archive/v1.0.0.zip) +[![Projeto](https://img.shields.io/badge/Git-Projeto-green.svg)](https://github.com/BrunoMine/antipvp) +[![!Bower](https://img.shields.io/badge/Bower-Projeto-green.svg)](https://minetest-bower.herokuapp.com/mods/antipvp) +[![Licença](https://img.shields.io/badge/Licença-LGPL_v3.0-blue.svg)](https://github.com/BrunoMine/antipvp/blob/master/LICENSE) + +## Descrição +Adiciona itens que impedem PVP em areas + +## Recursos do projeto + +* [Baixar](https://github.com/BrunoMine/antipvp/archive/v1.0.0.zip) +* [Projeto](https://github.com/BrunoMine/antipvp) +* [Bower](https://minetest-bower.herokuapp.com/mods/antipvp) + +## Licença +Veja LICENSE.txt para informações detalhadas da licença LGPL 3.0 + +### Autores do código fonte + +Originalmente por BrunoMine, Bruno Borges (LGPL 3.0) + +### Autores de mídias (texturas, modelos and sons) + +BrunoMine, Bruno Borges (CC BY-SA 3.0) diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..331d858 --- /dev/null +++ b/depends.txt @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/description.txt b/description.txt new file mode 100644 index 0000000..fd9baa8 --- /dev/null +++ b/description.txt @@ -0,0 +1 @@ +Carpete anti PVP diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..486fb55 --- /dev/null +++ b/init.lua @@ -0,0 +1,48 @@ +--[[ + Mod AntiPVP para Minetest + Copyright (C) 2017 BrunoMine (https://github.com/BrunoMine) + + Recebeste uma cópia da GNU Lesser General + Public License junto com esse software, + se não, veja em . + + Carpete Anti PVP + ]] + +-- Raio (em blocos) de alcance do Carpete AntPVP +local RAIO_ANTPVP = tonumber(minetest.setting_get("antipvp_dist") or 25) + +-- Carpete AntPVP +minetest.register_node("antipvp:placa", { + description = "Placa Anti PVP", + tiles = {"default_sign_wall_wood.png^antipvp_placa.png"}, + inventory_image = "default_sign_wood.png^antipvp_placa.png", + wield_image = "default_sign_wood.png^antipvp_placa.png", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "wallmounted", + is_ground_content = false, + sunlight_propagates = true, + walkable = false, + groups = {oddly_breakable_by_hand=3}, + node_box = { + type = "wallmounted", + wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125}, + wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125}, + wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375}, + }, +}) + +minetest.register_on_punchplayer(function(player, hitter) + if minetest.find_node_near(player:getpos(), RAIO_ANTPVP, "antipvp:placa") then + if hitter then + if hitter:is_player() then + minetest.chat_send_player(hitter:get_player_name(),"Area Anti PVP. Proibido atacar jogadores nesse local.") + else + hitter:remove() + end + return true + end + end +end) + diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..ab661ba --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,7 @@ +# Configurações aplicaveis para o menu gráfico + +# Dintancia em blocos que um carpete anti PVP atua +antipvp_dist (Distancia de efeito do carpete) int 25 1 50 + + + diff --git a/textures/antipvp_placa.png b/textures/antipvp_placa.png new file mode 100644 index 0000000..91dac64 Binary files /dev/null and b/textures/antipvp_placa.png differ