Cleanup
This commit is contained in:
parent
e6f433d0c3
commit
f942d765b4
21
LICENSE.txt
Normal file
21
LICENSE.txt
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 EvergreenTree
|
||||
|
||||
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.
|
26
README.txt
26
README.txt
@ -5,27 +5,17 @@
|
||||
| | | | (_| \__ \ | | | | \__/\ (_| | | | |
|
||||
\_/_| \__,_|___/_| |_| \____/\__,_|_| |_|
|
||||
|
||||
|
||||
|
||||
|
||||
This mod adds a wooden trash can, and a dumpster to the game. Right click it, put in your trash, and click the empty trash button.
|
||||
You can also throw things in the wooden trash can by pressing "q" or throwing them out of your inventory.
|
||||
|
||||
Version: 0.1.0
|
||||
License: MIT (see LICENSE.txt)
|
||||
|
||||
Dependencies: Default
|
||||
|
||||
|
||||
|
||||
License: CC BY-SA 3.0
|
||||
|
||||
This work is licensed under a Creative Commons Attribution 3.0 Unported License.
|
||||
More info at http://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
|
||||
Dependencies:
|
||||
default (found in minetest_game)
|
||||
|
||||
Crafting:
|
||||
|
||||
|
||||
Wooden trash can:
|
||||
w = wood planks x = nothing
|
||||
|
||||
@ -35,7 +25,6 @@ w|x|w
|
||||
-----
|
||||
w|w|w
|
||||
|
||||
|
||||
Dumpster:
|
||||
i = iron ingot c = coal block g = dark green dye
|
||||
|
||||
@ -45,18 +34,13 @@ i|g|i
|
||||
-----
|
||||
i|i|i
|
||||
|
||||
|
||||
Contributers:
|
||||
|
||||
|
||||
Zeg9:
|
||||
|
||||
Made it so you can throw stuff in the trash can (by pressing "q")
|
||||
|
||||
|
||||
Mossmanikin:
|
||||
|
||||
Made the nodeboxes for the dumpster, the textures for the wooden trash can, and the texture for the dumpster node.
|
||||
(with some editing by me)
|
||||
(with some editing by me). (old)
|
||||
|
||||
|
||||
|
78
dumpster.lua
78
dumpster.lua
@ -2,68 +2,26 @@
|
||||
-- by Mossmanikin
|
||||
-- License: WTFPL
|
||||
|
||||
--Custom Sounds
|
||||
--
|
||||
-- Custom Sounds
|
||||
--
|
||||
function default.node_sound_metal_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
{name="default_hard_footstep", gain=0.4}
|
||||
table.dig = table.dig or
|
||||
{name="metal_bang", gain=0.6}
|
||||
table.dug = table.dug or
|
||||
{name="default_dug_node", gain=1.0}
|
||||
table.footstep = table.footstep or {name="default_hard_footstep", gain=0.4}
|
||||
table.dig = table.dig or {name="metal_bang", gain=0.6}
|
||||
table.dug = table.dug or {name="default_dug_node", gain=1.0}
|
||||
|
||||
default.node_sound_defaults(table)
|
||||
return table
|
||||
end
|
||||
|
||||
--Nodeboxes(some are unused)
|
||||
--
|
||||
-- Nodeboxes
|
||||
--
|
||||
|
||||
local cube = {-0.5 , -0.5 , -0.5 , 0.5 , 0.5 , 0.5 }
|
||||
local dumpster_selectbox = {-0.4375, -0.5, -0.9375, 1.4375, 0.75, 0.4375}
|
||||
|
||||
local selectah = {-0.4375, -0.5 , -0.9375, 1.4375, 0.75 , 0.4375}
|
||||
|
||||
local container = {
|
||||
{-0.4375, -0.5 , -0.9375, 1.4375, 0.75 , 0.4375},
|
||||
{-0.5 , 0.75 , -1.0 , 1.5 , 0.875 , 0.5 },
|
||||
}
|
||||
|
||||
local container2 = { -- the one on Container.png
|
||||
{-0.4375, -0.4375, -0.9375, -0.375 , 0.625 , 0.4375},
|
||||
{ 1.375 , -0.4375, -0.9375, 1.4375, 0.625 , 0.4375},
|
||||
{-0.4375, -0.4375, -0.9375, 1.4375, 0.625 , -0.875 },
|
||||
{-0.4375, -0.4375, 0.375 , 1.4375, 0.625 , 0.4375},
|
||||
{-0.375 , -0.5 , -0.875 , 1.375 , -0.4375, 0.375 },
|
||||
|
||||
{-0.5 , 0.625 , -1.0 , -0.375 , 0.75 , 0.5 },
|
||||
{ 1.375 , 0.625 , -1.0 , 1.5 , 0.75 , 0.5 },
|
||||
{-0.5 , 0.625 , -1.0 , 1.5 , 0.75 , -0.875 },
|
||||
{-0.5 , 0.625 , 0.375 , 1.5 , 0.75 , 0.5 },
|
||||
}
|
||||
|
||||
local container3 = {
|
||||
-- Top
|
||||
{-0.4375, 1.125 , 0.1875, 1.4375, 1.1875, 0.4375},
|
||||
{-0.4375, 1.0625, 0.0 , 1.4375, 1.125 , 0.4375},
|
||||
{-0.4375, 1.0 , -0.1875, 1.4375, 1.0625, 0.4375},
|
||||
{-0.4375, 0.9375, -0.375 , 1.4375, 1.0 , 0.4375},
|
||||
{-0.4375, 0.875 , -0.5625, 1.4375, 0.9375, 0.4375},
|
||||
{-0.4375, 0.8125, -0.75 , 1.4375, 0.875 , 0.4375},
|
||||
{-0.4375, 0.75 , -0.9375, 1.4375, 0.8125, 0.4375},
|
||||
-- Border
|
||||
{-0.5 , 0.625 , -1.0 , 1.5 , 0.75 , 0.5 },
|
||||
-- Main Body
|
||||
{-0.4375, -0.4375, -0.9375, 1.4375, 0.625 , 0.4375},
|
||||
-- Grip
|
||||
{-0.5 , 0.0 , -1.0 , -0.25 , 0.25 , 0.5 },
|
||||
{ 1.25 , 0.0 , -1.0 , 1.5 , 0.25 , 0.5 },
|
||||
-- Feet
|
||||
{-0.4375, -0.5 , -0.9375, -0.1875, -0.4375, -0.6875},
|
||||
{ 1.1875, -0.5 , -0.9375, 1.4375, -0.4375, -0.6875},
|
||||
{-0.4375, -0.5 , 0.1875, -0.1875, -0.4375, 0.4375},
|
||||
{ 1.1875, -0.5 , 0.1875, 1.4375, -0.4375, 0.4375},
|
||||
}
|
||||
|
||||
local container4 = { -- the one on Dumpster.png
|
||||
local dumpster_nodebox = {
|
||||
-- Top
|
||||
{-0.4375, 0.75 , -0.9375, 1.4375, 0.875 , 0.4375},
|
||||
-- Border
|
||||
@ -95,11 +53,11 @@ minetest.register_node("trash_can:dumpster", {
|
||||
drawtype = "nodebox",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = selectah,
|
||||
fixed = dumpster_selectbox,
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = container4,
|
||||
fixed = dumpster_nodebox,
|
||||
},
|
||||
groups = {
|
||||
cracky = 3,
|
||||
@ -114,7 +72,8 @@ minetest.register_node("trash_can:dumpster", {
|
||||
"size[8,9]"..
|
||||
"button[0,0;2,1;empty;Empty Trash]"..
|
||||
"list[current_name;main;1,1;6,3;]"..
|
||||
"list[current_player;main;0,5;8,4;]")
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
)
|
||||
meta:set_string("infotext", "Dumpster")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
@ -143,13 +102,16 @@ minetest.register_node("trash_can:dumpster", {
|
||||
for i = 1, inv:get_size("main") do
|
||||
inv:set_stack("main", i, nil)
|
||||
end
|
||||
minetest.sound_play("trash", {to_player=player_name, gain = 2.0})
|
||||
minetest.sound_play("trash", {to_player=sender:get_player_name(), gain = 2.0})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
--
|
||||
-- Crafting
|
||||
--
|
||||
|
||||
--Crafting
|
||||
-- Dumpster
|
||||
minetest.register_craft({
|
||||
output = 'trash_can:dumpster',
|
||||
recipe = {
|
||||
|
41
init.lua
41
init.lua
@ -1,9 +1,12 @@
|
||||
--dofiles
|
||||
-- Include dumpster
|
||||
dofile(minetest.get_modpath("trash_can").."/dumpster.lua")
|
||||
|
||||
|
||||
--Node Registration
|
||||
--
|
||||
-- Node Registration
|
||||
--
|
||||
|
||||
-- Normal Trash Can
|
||||
minetest.register_node("trash_can:trash_can_wooden",{
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
tiles = {"trash_can_wooden_top.png", "trash_can_wooden_top.png", "trash_can_wooden.png"},
|
||||
@ -26,7 +29,8 @@ minetest.register_node("trash_can:trash_can_wooden",{
|
||||
"size[8,9]"..
|
||||
"button[0,0;2,1;empty;Empty Trash]"..
|
||||
"list[current_name;main;3,1;2,3;]"..
|
||||
"list[current_player;main;0,5;8,4;]")
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
)
|
||||
meta:set_string("infotext", "Trash Can")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
@ -60,8 +64,11 @@ minetest.register_node("trash_can:trash_can_wooden",{
|
||||
end,
|
||||
})
|
||||
|
||||
--Crafting
|
||||
--
|
||||
-- Crafting
|
||||
--
|
||||
|
||||
-- Normal Trash Can
|
||||
minetest.register_craft({
|
||||
output = 'trash_can:trash_can_wooden',
|
||||
recipe = {
|
||||
@ -71,32 +78,16 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
--
|
||||
-- Misc
|
||||
--
|
||||
|
||||
--Throw In Trash Can Code
|
||||
|
||||
-- Remove any items thrown in trash can.
|
||||
local old_on_step = minetest.registered_entities["__builtin:item"].on_step
|
||||
minetest.registered_entities["__builtin:item"].on_step = function(self, dtime)
|
||||
if minetest.env:get_node(self.object:getpos()).name == "trash_can:trash_can_wooden" then
|
||||
if minetest.get_node(self.object:getpos()).name == "trash_can:trash_can_wooden" then
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
old_on_step(self, dtime)
|
||||
end
|
||||
|
||||
--Unused stuff
|
||||
--minetest.register_node("trash_can:trash_can_full",{
|
||||
-- groups = {choppy=2},
|
||||
-- tiles = {"default_wood.png"},
|
||||
-- drawtype="nodebox",
|
||||
-- paramtype = "light",
|
||||
-- node_box = {
|
||||
-- type = "fixed",
|
||||
-- fixed = {
|
||||
-- {-0.375000,-0.500000,0.312500,0.375000,0.500000,0.375000}, --NodeBox 1
|
||||
-- {0.312500,-0.500000,-0.375000,0.375000,0.500000,0.375000}, --NodeBox 2
|
||||
-- {-0.375000,-0.500000,-0.375000,0.375000,0.500000,-0.312500}, --NodeBox 3
|
||||
-- {-0.375000,-0.500000,-0.375000,-0.312500,0.500000,0.375000}, --NodeBox 4
|
||||
-- {-0.312500,-0.500000,-0.312500,0.312500,0.375000,0.312500}, --NodeBox 5
|
||||
-- }
|
||||
-- }
|
||||
--})
|
Loading…
x
Reference in New Issue
Block a user