everything added
41
mods/pn/.gitignore
vendored
Normal file
@ -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
|
||||
|
21
mods/pn/LICENSE
Normal file
@ -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.
|
9
mods/pn/README.md
Normal file
@ -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`)
|
103
mods/pn/init.lua
Normal file
@ -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 = "<x> <y> <x> <nodename>",
|
||||
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 = "<node>",
|
||||
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 = "<x> <y> <x> <nodename>",
|
||||
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 = "<node>",
|
||||
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,
|
||||
})
|
2
mods/pn/mod.conf
Normal file
@ -0,0 +1,2 @@
|
||||
name = place_node
|
||||
description = Add `setblock` and `place` command to the game
|
BIN
mods/pn/screenshot.png
Normal file
After Width: | Height: | Size: 2.8 MiB |
0
mods/poop/music.lua
Normal file
50
mods/poop/nodes.lua
Normal file
@ -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")
|
BIN
mods/poop/sounds/shit_all_over_the_place.ogg
Normal file
BIN
mods/poop/textures/BOX.png
Normal file
After Width: | Height: | Size: 304 B |
BIN
mods/poop/textures/Bricks.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
mods/poop/textures/Bricks2.png
Normal file
After Width: | Height: | Size: 1015 B |
BIN
mods/poop/textures/PC.png
Normal file
After Width: | Height: | Size: 147 B |
BIN
mods/poop/textures/PC2.png
Normal file
After Width: | Height: | Size: 100 B |
BIN
mods/poop/textures/Planks.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
mods/poop/textures/Poop.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
mods/poop/textures/SHITitem.png
Normal file
After Width: | Height: | Size: 318 B |
BIN
mods/poop/textures/aquablock.png
Normal file
After Width: | Height: | Size: 126 B |
BIN
mods/poop/textures/boxitem.png
Normal file
After Width: | Height: | Size: 194 B |
BIN
mods/poop/textures/floor.png
Normal file
After Width: | Height: | Size: 126 B |
BIN
mods/poop/textures/fluxcap.png
Normal file
After Width: | Height: | Size: 214 B |
BIN
mods/poop/textures/fluxcap2.png
Normal file
After Width: | Height: | Size: 116 B |
BIN
mods/poop/textures/glass.png
Normal file
After Width: | Height: | Size: 139 B |
BIN
mods/poop/textures/plumba.png
Normal file
After Width: | Height: | Size: 142 B |
BIN
mods/poop/textures/purpleblock.png
Normal file
After Width: | Height: | Size: 125 B |
BIN
mods/poop/textures/redblock.png
Normal file
After Width: | Height: | Size: 127 B |
BIN
mods/poop/textures/sraka.png
Normal file
After Width: | Height: | Size: 516 B |
BIN
mods/poop/textures/wood.png
Normal file
After Width: | Height: | Size: 187 B |