diff --git a/mods/pn/.gitignore b/mods/pn/.gitignore new file mode 100644 index 0000000..6fd0a37 --- /dev/null +++ b/mods/pn/.gitignore @@ -0,0 +1,41 @@ +# Compiled Lua sources +luac.out + +# luarocks build files +*.src.rock +*.zip +*.tar.gz + +# Object files +*.o +*.os +*.ko +*.obj +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo +*.def +*.exp + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + diff --git a/mods/pn/LICENSE b/mods/pn/LICENSE new file mode 100644 index 0000000..993ac8d --- /dev/null +++ b/mods/pn/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Emojigit + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/mods/pn/README.md b/mods/pn/README.md new file mode 100644 index 0000000..f131602 --- /dev/null +++ b/mods/pn/README.md @@ -0,0 +1,9 @@ +This mod add `setblock` and `place` command + +## Commands + +### /setblock x y z modname:foobar_node & /place x y z modname:foobar_node +Place a block at x,y,z (setblock call `minetest.set_node`, and place call `minetest.place_node`) + +### /setblock_heremodname:foobar_node & /place_here modname:foobar_node +Place a block at your pos (setblock call `minetest.set_node`, and place call `minetest.place_node`) diff --git a/mods/pn/init.lua b/mods/pn/init.lua new file mode 100644 index 0000000..d5fc134 --- /dev/null +++ b/mods/pn/init.lua @@ -0,0 +1,103 @@ +minetest.register_privilege("setblock", { + description = "Player can use place and setblock command.", + give_to_singleplayer= false, +}) + +local function split (inputstr, sep) + if sep == nil then + sep = "%s" + end + local t={} + for str in string.gmatch(inputstr, "([^"..sep.."]+)") do + table.insert(t, str) + end + return t +end + +minetest.register_chatcommand("place", { + params = " ", + description = "Place block", + privs = {setblock = true}, + func = function(name, param) + splited = split(param," ") + if not(tonumber(splited[1]) and tonumber(splited[2]) and tonumber(splited[3])) then + return false, "Pos error: please give int!" + end + x,y,z,node = tonumber(splited[1]),tonumber(splited[2]),tonumber(splited[3]),splited[4] + if node == "ignore" then + return false, "You can't place \"ignore\"!" + end + if minetest.registered_nodes[node] then + minetest.place_node({x=x, y=y, z=z}, {name=node}) + return true, "Setted node "..node.." at "..tostring(x)..tostring(y)..tostring(z) + else + return false, "Cannot place a unknown node." + end + end, +}) + +minetest.register_chatcommand("place_here", { + params = "", + privs = {setblock = true}, + description = "Place block at player's pos", + func = function(name, param) + local player = minetest.get_player_by_name(name) + if not player then + return false, "Player is not online." + end + if param == "ignore" then + return false, "You can't place \"ignore\"!" + end + if minetest.registered_nodes[param] then + minetest.place_node(player:get_pos(), {name=param}) + return true, "Placed node "..param.." at "..tostring(math.floor(player:get_pos().x))..","..tostring(math.floor(player:get_pos().y))..","..tostring(math.floor(player:get_pos().z)) + else + return false, "Cannot place a unknown node." + end + end, +}) + +-- minetest.set_node + +minetest.register_chatcommand("setblock", { + params = " ", + privs = {setblock = true}, + description = "Set a block", + func = function(name, param) + splited = split(param," ") + if not(tonumber(splited[1]) and tonumber(splited[2]) and tonumber(splited[3])) then + return false, "Pos error: please give int!" + end + x,y,z,node = tonumber(splited[1]),tonumber(splited[2]),tonumber(splited[3]),splited[4] + if node == "ignore" then + return false, "You can't set \"ignore\"!" + end + if minetest.registered_nodes[node] then + minetest.set_node({x=x, y=y, z=z}, {name=node}) + return true, "Setted node "..node.." at "..tostring(x)..tostring(y)..tostring(z) + else + return false, "Cannot set a unknown node." + end + end, +}) + +minetest.register_chatcommand("setblock_here", { + params = "", + privs = {setblock = true}, + description = "Set a block at player's pos", + func = function(name, param) + local player = minetest.get_player_by_name(name) + if not player then + return false, "Player is not online." + end + if param == "ignore" then + return false, "You can't set \"ignore\"!" + end + if minetest.registered_nodes[param] then + minetest.set_node(player:get_pos(), {name=param}) + return true, "Setted node "..param.." at "..tostring(math.floor(player:get_pos().x))..","..tostring(math.floor(player:get_pos().y))..","..tostring(math.floor(player:get_pos().z)) + else + return false, "Cannot set a unknown node." + end + end, +}) diff --git a/mods/pn/mod.conf b/mods/pn/mod.conf new file mode 100644 index 0000000..9fb01ff --- /dev/null +++ b/mods/pn/mod.conf @@ -0,0 +1,2 @@ +name = place_node +description = Add `setblock` and `place` command to the game diff --git a/mods/pn/screenshot.png b/mods/pn/screenshot.png new file mode 100644 index 0000000..8879fa3 Binary files /dev/null and b/mods/pn/screenshot.png differ diff --git a/mods/poop/music.lua b/mods/poop/music.lua new file mode 100644 index 0000000..e69de29 diff --git a/mods/poop/nodes.lua b/mods/poop/nodes.lua new file mode 100644 index 0000000..1192557 --- /dev/null +++ b/mods/poop/nodes.lua @@ -0,0 +1,50 @@ +minetest.register_node("poop:box", { + description = "cardboard box", + tiles = {"BOX.png"}, + + drop = 'poop:box', + legacy_mineral = true, +}) + +minetest.register_node("poop:floor", { + description = "Floor", + tiles = {"floor.png"}, + + drop = 'poop:floor', + legacy_mineral = true, +}) + +minetest.register_node("poop:Poop", { + description = "Just Shit", + tiles = {"Poop.png"}, + drop = 'poop:PoopItem', +}) + +minetest.register_node("poop:tv", { + description = "CRTV", + tiles = {"PC2.png", "PC2.png","PC2.png","PC.png","PC2.png","PC2.png"}, + + drop = 'poop:Poop', +}) + +minetest.register_node("poop:bricks", { + description = "Bricks", + tiles = {"Bricks.png"}, + + drop = 'poop:grey_bricks', +}) +minetest.register_node("poop:grey_bricks", { + description = "Bricks 2", + tiles = {"Bricks2.png"}, + + drop = 'poop:grey_bricks', +}) +minetest.register_node("poop:planks", { + description = "Planks", + tiles = {"Planks.png"}, + + drop = 'poop:planks', +}) + + +minetest.register_alias("mapgen_stone", "poop:Poop") \ No newline at end of file diff --git a/mods/poop/sounds/shit_all_over_the_place.ogg b/mods/poop/sounds/shit_all_over_the_place.ogg new file mode 100644 index 0000000..8f2c1b4 Binary files /dev/null and b/mods/poop/sounds/shit_all_over_the_place.ogg differ diff --git a/mods/poop/textures/BOX.png b/mods/poop/textures/BOX.png new file mode 100644 index 0000000..12c609b Binary files /dev/null and b/mods/poop/textures/BOX.png differ diff --git a/mods/poop/textures/Bricks.png b/mods/poop/textures/Bricks.png new file mode 100644 index 0000000..24b5d36 Binary files /dev/null and b/mods/poop/textures/Bricks.png differ diff --git a/mods/poop/textures/Bricks2.png b/mods/poop/textures/Bricks2.png new file mode 100644 index 0000000..5d45ebf Binary files /dev/null and b/mods/poop/textures/Bricks2.png differ diff --git a/mods/poop/textures/PC.png b/mods/poop/textures/PC.png new file mode 100644 index 0000000..4c73ec8 Binary files /dev/null and b/mods/poop/textures/PC.png differ diff --git a/mods/poop/textures/PC2.png b/mods/poop/textures/PC2.png new file mode 100644 index 0000000..2ec0a98 Binary files /dev/null and b/mods/poop/textures/PC2.png differ diff --git a/mods/poop/textures/Planks.png b/mods/poop/textures/Planks.png new file mode 100644 index 0000000..e97f576 Binary files /dev/null and b/mods/poop/textures/Planks.png differ diff --git a/mods/poop/textures/Poop.png b/mods/poop/textures/Poop.png new file mode 100644 index 0000000..ed9bc5a Binary files /dev/null and b/mods/poop/textures/Poop.png differ diff --git a/mods/poop/textures/SHITitem.png b/mods/poop/textures/SHITitem.png new file mode 100644 index 0000000..1388e4c Binary files /dev/null and b/mods/poop/textures/SHITitem.png differ diff --git a/mods/poop/textures/aquablock.png b/mods/poop/textures/aquablock.png new file mode 100644 index 0000000..21bc01e Binary files /dev/null and b/mods/poop/textures/aquablock.png differ diff --git a/mods/poop/textures/boxitem.png b/mods/poop/textures/boxitem.png new file mode 100644 index 0000000..d7fa639 Binary files /dev/null and b/mods/poop/textures/boxitem.png differ diff --git a/mods/poop/textures/floor.png b/mods/poop/textures/floor.png new file mode 100644 index 0000000..1fc7d0a Binary files /dev/null and b/mods/poop/textures/floor.png differ diff --git a/mods/poop/textures/fluxcap.png b/mods/poop/textures/fluxcap.png new file mode 100644 index 0000000..ff03ea2 Binary files /dev/null and b/mods/poop/textures/fluxcap.png differ diff --git a/mods/poop/textures/fluxcap2.png b/mods/poop/textures/fluxcap2.png new file mode 100644 index 0000000..dfad75c Binary files /dev/null and b/mods/poop/textures/fluxcap2.png differ diff --git a/mods/poop/textures/glass.png b/mods/poop/textures/glass.png new file mode 100644 index 0000000..6a1102b Binary files /dev/null and b/mods/poop/textures/glass.png differ diff --git a/mods/poop/textures/plumba.png b/mods/poop/textures/plumba.png new file mode 100644 index 0000000..42760c9 Binary files /dev/null and b/mods/poop/textures/plumba.png differ diff --git a/mods/poop/textures/purpleblock.png b/mods/poop/textures/purpleblock.png new file mode 100644 index 0000000..f7a58fb Binary files /dev/null and b/mods/poop/textures/purpleblock.png differ diff --git a/mods/poop/textures/redblock.png b/mods/poop/textures/redblock.png new file mode 100644 index 0000000..f9d37da Binary files /dev/null and b/mods/poop/textures/redblock.png differ diff --git a/mods/poop/textures/sraka.png b/mods/poop/textures/sraka.png new file mode 100644 index 0000000..4aa5db7 Binary files /dev/null and b/mods/poop/textures/sraka.png differ diff --git a/mods/poop/textures/wood.png b/mods/poop/textures/wood.png new file mode 100644 index 0000000..26d3e32 Binary files /dev/null and b/mods/poop/textures/wood.png differ diff --git a/mods/poop/tools.lua b/mods/poop/tools.lua new file mode 100644 index 0000000..e69de29