Compare commits
	
		
			20 Commits
		
	
	
		
			2021-04-14
			...
			0724b0dda9
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					0724b0dda9 | ||
| 
						 | 
					eacbe80fae | ||
| 
						 | 
					b3ca88e58d | ||
| 
						 | 
					b5ec85d037 | ||
| 
						 | 
					0af4ae2eb2 | ||
| 
						 | 
					2058c58738 | ||
| 
						 | 
					1ce0533672 | ||
| 
						 | 
					6f9a27ff05 | ||
| 
						 | 
					c350f40405 | ||
| 
						 | 
					35a3be337d | ||
| 
						 | 
					0664552799 | ||
| 
						 | 
					7043a7d15d | ||
| 
						 | 
					2e2d904261 | ||
| 
						 | 
					daf04bd400 | ||
| 
						 | 
					427b6b1f3f | ||
| 
						 | 
					92ee7e419e | ||
| 
						 | 
					0a43ffe46a | ||
| 
						 | 
					eca7c55028 | ||
| 
						 | 
					7e517d8386 | ||
| 
						 | 
					03325e886a | 
							
								
								
									
										18
									
								
								.github/workflows/luacheck.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
 | 
			
		||||
name: luacheck
 | 
			
		||||
 | 
			
		||||
on: [push, pull_request]
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  build:
 | 
			
		||||
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
 | 
			
		||||
    steps:
 | 
			
		||||
    - uses: actions/checkout@v1
 | 
			
		||||
    - name: apt
 | 
			
		||||
      run: sudo apt-get install -y luarocks
 | 
			
		||||
    - name: luacheck install
 | 
			
		||||
      run: luarocks install --local luacheck
 | 
			
		||||
    - name: luacheck run
 | 
			
		||||
      run: $HOME/.luarocks/bin/luacheck ./
 | 
			
		||||
							
								
								
									
										25
									
								
								.luacheckrc
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,25 @@
 | 
			
		||||
unused_args = false
 | 
			
		||||
allow_defined_top = true
 | 
			
		||||
 | 
			
		||||
exclude_files = {".luacheckrc"}
 | 
			
		||||
 | 
			
		||||
globals = {
 | 
			
		||||
    "minetest", "core",
 | 
			
		||||
 | 
			
		||||
    --mod provided
 | 
			
		||||
    "home_vending_machines",
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
read_globals = {
 | 
			
		||||
    string = {fields = {"split"}},
 | 
			
		||||
    table = {fields = {"copy", "getn"}},
 | 
			
		||||
 | 
			
		||||
    --luac
 | 
			
		||||
    "math", "table",
 | 
			
		||||
 | 
			
		||||
    -- Builtin
 | 
			
		||||
    "vector", "ItemStack", "dump", "DIR_DELIM", "VoxelArea", "Settings", "PcgRandom", "VoxelManip", "PseudoRandom",
 | 
			
		||||
 | 
			
		||||
    --mod produced
 | 
			
		||||
    "default", "screwdriver", "unifieddyes", "computers", "farming",
 | 
			
		||||
}
 | 
			
		||||
@@ -1,21 +0,0 @@
 | 
			
		||||
unused_args = false
 | 
			
		||||
allow_defined_top = true
 | 
			
		||||
max_comment_line_length = 999
 | 
			
		||||
 | 
			
		||||
read_globals = {
 | 
			
		||||
	"DIR_DELIM",
 | 
			
		||||
	"minetest", "core",
 | 
			
		||||
	"unpack",
 | 
			
		||||
	"dump",
 | 
			
		||||
	table = { fields = { "copy", "getn" } },
 | 
			
		||||
	"vector", "nodeupdate",
 | 
			
		||||
	"VoxelManip", "VoxelArea",
 | 
			
		||||
	"PseudoRandom", "ItemStack",
 | 
			
		||||
	"default",
 | 
			
		||||
	"unifieddyes",
 | 
			
		||||
	"screwdriver",
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
globals = {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1,6 +1,7 @@
 | 
			
		||||
 | 
			
		||||
Decorative Computers Mod for Minetest
 | 
			
		||||
by Diego Martínez <kaeza@users.sf.net>
 | 
			
		||||
by Diego Martínez <kaeza@users.sf.net> and contributors
 | 
			
		||||
license [MIT](https://spdx.org/licenses/MIT.html)
 | 
			
		||||
 | 
			
		||||
How to install:
 | 
			
		||||
Unzip the archive an place it in minetest-base-directory/mods/minetest/
 | 
			
		||||
@@ -46,4 +47,4 @@ Thanks to all the people in the forums and the #minetest IRC channel for
 | 
			
		||||
  was you ;) ). 
 | 
			
		||||
 | 
			
		||||
See also:
 | 
			
		||||
http://minetest.net/
 | 
			
		||||
http://minetest.net/
 | 
			
		||||
@@ -3,6 +3,7 @@ minetest.register_alias("computer:shefriendSOO_off",     "computers:shefriendSOO
 | 
			
		||||
minetest.register_alias("computer:vanio",                "computers:vanio")
 | 
			
		||||
minetest.register_alias("computer:vanio_off",            "computers:vanio_off")
 | 
			
		||||
minetest.register_alias("computer:slaystation",          "computers:slaystation")
 | 
			
		||||
minetest.register_alias("computer:slaystation_off",      "computers:slaystation_off")
 | 
			
		||||
minetest.register_alias("computer:slaystation2",         "computers:slaystation2")
 | 
			
		||||
minetest.register_alias("computer:slaystation2_off",     "computers:slaystation2_off")
 | 
			
		||||
minetest.register_alias("computer:specter",              "computers:specter")
 | 
			
		||||
 
 | 
			
		||||
@@ -80,7 +80,7 @@ minetest.register_node("computers:piepad", {
 | 
			
		||||
	walkable = false,
 | 
			
		||||
	groups = {oddly_breakable_by_hand=2},
 | 
			
		||||
	selection_box = {type = "wallmounted"},
 | 
			
		||||
	sounds = default.node_sound_wood_defaults()
 | 
			
		||||
	sounds = default and default.node_sound_wood_defaults() or nil
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- Commodore 64 lookalike
 | 
			
		||||
@@ -116,7 +116,9 @@ minetest.register_node("computers:monitor", {
 | 
			
		||||
	inventory_image = "computers_monitor_inv.png",
 | 
			
		||||
	drawtype = "mesh",
 | 
			
		||||
	mesh = "computers_monitor.obj",
 | 
			
		||||
	tiles = {"computers_black.png", "computers_monitor_plastic.png", "computers_black.png", "computers_monitor_plastic.png"},
 | 
			
		||||
	tiles = {
 | 
			
		||||
		"computers_black.png", "computers_monitor_plastic.png", "computers_black.png", "computers_monitor_plastic.png"
 | 
			
		||||
	},
 | 
			
		||||
	paramtype = "light",
 | 
			
		||||
	paramtype2 = "facedir",
 | 
			
		||||
	walkable = false,
 | 
			
		||||
@@ -132,7 +134,12 @@ minetest.register_node("computers:monitor", {
 | 
			
		||||
minetest.register_node("computers:monitor_on", {
 | 
			
		||||
	drawtype = "mesh",
 | 
			
		||||
	mesh = "computers_monitor.obj",
 | 
			
		||||
	tiles = {"computers_monitor_display.png^[transformFX", "computers_monitor_plastic.png", "computers_black.png", "computers_monitor_plastic.png"},
 | 
			
		||||
	tiles = {
 | 
			
		||||
		"computers_monitor_display.png^[transformFX",
 | 
			
		||||
		"computers_monitor_plastic.png",
 | 
			
		||||
		"computers_black.png",
 | 
			
		||||
		"computers_monitor_plastic.png"
 | 
			
		||||
	},
 | 
			
		||||
	paramtype = "light",
 | 
			
		||||
	paramtype2 = "facedir",
 | 
			
		||||
	light_source = 9,
 | 
			
		||||
@@ -166,7 +173,7 @@ minetest.register_node("computers:router", {
 | 
			
		||||
	paramtype2 = "facedir",
 | 
			
		||||
	walkable = false,
 | 
			
		||||
	groups = {snappy=3},
 | 
			
		||||
	sound = default.node_sound_wood_defaults(),
 | 
			
		||||
	sound = default and default.node_sound_wood_defaults() or nil,
 | 
			
		||||
	drawtype = "nodebox",
 | 
			
		||||
	node_box = {
 | 
			
		||||
		type = "fixed",
 | 
			
		||||
@@ -194,7 +201,7 @@ minetest.register_node("computers:tower", {
 | 
			
		||||
	paramtype = "light",
 | 
			
		||||
	paramtype2 = "facedir",
 | 
			
		||||
	groups = {snappy=3},
 | 
			
		||||
	sound = default.node_sound_wood_defaults(),
 | 
			
		||||
	sound = default and default.node_sound_wood_defaults() or nil,
 | 
			
		||||
	selection_box = pct_cbox,
 | 
			
		||||
	collision_box = pct_cbox
 | 
			
		||||
})
 | 
			
		||||
@@ -223,7 +230,7 @@ minetest.register_node("computers:server", {
 | 
			
		||||
		type = "fixed",
 | 
			
		||||
		fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375}
 | 
			
		||||
	},
 | 
			
		||||
	sounds = default.node_sound_wood_defaults(),
 | 
			
		||||
	sounds = default and default.node_sound_wood_defaults() or nil,
 | 
			
		||||
	on_rightclick = function(pos, node, clicker, itemstack)
 | 
			
		||||
		node.name = "computers:server_on"
 | 
			
		||||
		minetest.set_node(pos, node)
 | 
			
		||||
@@ -262,7 +269,7 @@ minetest.register_node("computers:server_on", {
 | 
			
		||||
		type = "fixed",
 | 
			
		||||
		fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375}
 | 
			
		||||
	},
 | 
			
		||||
	sounds = default.node_sound_wood_defaults(),
 | 
			
		||||
	sounds = default and default.node_sound_wood_defaults() or nil,
 | 
			
		||||
	drop = 'computers:server',
 | 
			
		||||
	on_rightclick = function(pos, node, clicker, itemstack)
 | 
			
		||||
		node.name = "computers:server"
 | 
			
		||||
@@ -282,7 +289,7 @@ minetest.register_node("computers:printer", {
 | 
			
		||||
	paramtype2 = "facedir",
 | 
			
		||||
	walkable = true,
 | 
			
		||||
	groups = {snappy=3},
 | 
			
		||||
	sound = default.node_sound_wood_defaults(),
 | 
			
		||||
	sound = default and default.node_sound_wood_defaults() or nil,
 | 
			
		||||
	drawtype = "nodebox",
 | 
			
		||||
	node_box = {
 | 
			
		||||
		type = "fixed",
 | 
			
		||||
 
 | 
			
		||||
@@ -298,8 +298,7 @@ local function step(pos, fields)
 | 
			
		||||
		t.score, close, buttons }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		meta:set_string("formspec", concat(scr)
 | 
			
		||||
			..default.gui_bg..default.gui_bg_img..default.gui_slots)
 | 
			
		||||
		meta:set_string("formspec", concat(scr))
 | 
			
		||||
		meta:set_string("tetris", minetest.serialize(t))
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
@@ -326,8 +325,7 @@ minetest.register_node("computers:tetris_arcade", {
 | 
			
		||||
	on_construct = function(pos)
 | 
			
		||||
		local meta = minetest.get_meta(pos)
 | 
			
		||||
		meta:set_string("formspec", formsize
 | 
			
		||||
			.."button[2,2.5;2,2;new;"..minetest.formspec_escape(S("New Game")).."]"
 | 
			
		||||
			..default.gui_bg..default.gui_bg_img..default.gui_slots)
 | 
			
		||||
			.."button[2,2.5;2,2;new;"..minetest.formspec_escape(S("New Game")).."]")
 | 
			
		||||
	end,
 | 
			
		||||
	on_timer = function(pos)
 | 
			
		||||
		return step(pos, nil)
 | 
			
		||||
 
 | 
			
		||||
@@ -93,6 +93,9 @@ end
 | 
			
		||||
 | 
			
		||||
local MODPATH = minetest.get_modpath("computers")
 | 
			
		||||
dofile(MODPATH.."/computers.lua")
 | 
			
		||||
dofile(MODPATH.."/recipes.lua")
 | 
			
		||||
dofile(MODPATH.."/gaming.lua")
 | 
			
		||||
dofile(MODPATH.."/aliases.lua")
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("default") and minetest.get_modpath("basic_materials") then
 | 
			
		||||
	dofile(MODPATH.."/recipes.lua")
 | 
			
		||||
end
 | 
			
		||||
@@ -1,3 +1,2 @@
 | 
			
		||||
name = computers
 | 
			
		||||
depends = default, basic_materials
 | 
			
		||||
optional_depends = screwdriver
 | 
			
		||||
optional_depends = screwdriver, default, basic_materials
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										59
									
								
								home_vending_machines/api.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,59 @@
 | 
			
		||||
local registered_currency = {}
 | 
			
		||||
 | 
			
		||||
function home_vending_machines.register_currency(name, worth)
 | 
			
		||||
    registered_currency[name] = worth
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function reg_simple(name, def)
 | 
			
		||||
    minetest.register_node(":" .. name, {
 | 
			
		||||
        description = def.description,
 | 
			
		||||
        drawtype = "mesh",
 | 
			
		||||
        mesh = "home_vending_machines_machine.obj",
 | 
			
		||||
        tiles = def.tiles,
 | 
			
		||||
        paramtype = "light",
 | 
			
		||||
        paramtype2 = "facedir",
 | 
			
		||||
        groups = def.groups or {snappy=3},
 | 
			
		||||
        selection_box = {
 | 
			
		||||
            type = "fixed",
 | 
			
		||||
            fixed = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5}
 | 
			
		||||
        },
 | 
			
		||||
        collision_box = {
 | 
			
		||||
            type = "fixed",
 | 
			
		||||
            fixed = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5}
 | 
			
		||||
        },
 | 
			
		||||
        sounds = def.sounds,
 | 
			
		||||
        on_rotate = function(pos, node, user, mode, new_param2)
 | 
			
		||||
            if minetest.get_modpath("screwdriver") then
 | 
			
		||||
                return screwdriver.rotate_simple(pos, node, user, mode, new_param2)
 | 
			
		||||
            end
 | 
			
		||||
        end,
 | 
			
		||||
        on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
 | 
			
		||||
            local pname = clicker:get_player_name()
 | 
			
		||||
            local iname = itemstack:get_name()
 | 
			
		||||
            local dpos = vector.add((vector.multiply(minetest.facedir_to_dir(node.param2), -1)), pos)
 | 
			
		||||
 | 
			
		||||
            if registered_currency[iname] and registered_currency[iname] == 1 then
 | 
			
		||||
                local item = def._vmachine.item
 | 
			
		||||
                if type(item) == "table" then
 | 
			
		||||
                    item = item[math.random(#item)]
 | 
			
		||||
                end
 | 
			
		||||
 | 
			
		||||
                minetest.add_item(dpos, item)
 | 
			
		||||
 | 
			
		||||
                if not minetest.is_creative_enabled(pname) then
 | 
			
		||||
                    itemstack:take_item()
 | 
			
		||||
                    return itemstack
 | 
			
		||||
                end
 | 
			
		||||
            else
 | 
			
		||||
                minetest.chat_send_player(pname, "Please insert valid currency.")
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    })
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function home_vending_machines.register_machine(type, name, def)
 | 
			
		||||
    if type == "simple" then
 | 
			
		||||
        reg_simple(name, def)
 | 
			
		||||
    end
 | 
			
		||||
    --TODO: add more complex machine type with formspec and selections
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										32
									
								
								home_vending_machines/crafts.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,32 @@
 | 
			
		||||
if minetest.get_modpath("default") then
 | 
			
		||||
    if minetest.get_modpath("dye") then
 | 
			
		||||
        minetest.register_craft({
 | 
			
		||||
            output = "home_workshop_misc:soda_machine",
 | 
			
		||||
            recipe = {
 | 
			
		||||
                {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
 | 
			
		||||
                {"default:steel_ingot", "dye:red",             "default:steel_ingot"},
 | 
			
		||||
                {"default:steel_ingot", "default:copperblock", "default:steel_ingot"},
 | 
			
		||||
            },
 | 
			
		||||
        })
 | 
			
		||||
    end
 | 
			
		||||
    if minetest.get_modpath("vessels") then
 | 
			
		||||
        minetest.register_craft({
 | 
			
		||||
            output = "home_vending_machines:drink_machine",
 | 
			
		||||
            recipe = {
 | 
			
		||||
                {"default:steel_ingot", "group:vessel", "default:steel_ingot"},
 | 
			
		||||
                {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
 | 
			
		||||
                {"default:steel_ingot", "default:copperblock", "default:steel_ingot"},
 | 
			
		||||
            },
 | 
			
		||||
        })
 | 
			
		||||
    end
 | 
			
		||||
    if farming and farming.mod == "redo" then
 | 
			
		||||
        minetest.register_craft({
 | 
			
		||||
            output = "home_vending_machines:sweet_machine",
 | 
			
		||||
            recipe = {
 | 
			
		||||
                {"default:steel_ingot", "group:food_sugar",    "default:steel_ingot"},
 | 
			
		||||
                {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
 | 
			
		||||
                {"default:steel_ingot", "default:copperblock", "default:steel_ingot"},
 | 
			
		||||
            },
 | 
			
		||||
        })
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										9
									
								
								home_vending_machines/init.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,9 @@
 | 
			
		||||
local modpath = minetest.get_modpath("home_vending_machines")
 | 
			
		||||
home_vending_machines = {}
 | 
			
		||||
 | 
			
		||||
dofile(modpath .. "/api.lua")
 | 
			
		||||
dofile(modpath .. "/machines.lua")
 | 
			
		||||
dofile(modpath .. "/items.lua")
 | 
			
		||||
dofile(modpath .. "/crafts.lua")
 | 
			
		||||
 | 
			
		||||
home_vending_machines.init = true
 | 
			
		||||
							
								
								
									
										12
									
								
								home_vending_machines/items.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,12 @@
 | 
			
		||||
local function reg_item(name, evalue)
 | 
			
		||||
    minetest.register_craftitem("home_vending_machines:" .. name, {
 | 
			
		||||
        description = string.gsub(name, "_", " "),
 | 
			
		||||
        inventory_image = "home_vending_machines_" .. name .. ".png",
 | 
			
		||||
        on_use = minetest.item_eat(evalue),
 | 
			
		||||
    })
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
reg_item("soda_can", 2)
 | 
			
		||||
minetest.register_alias("home_workshop_misc:soda_can", "home_vending_machines:soda_can")
 | 
			
		||||
 | 
			
		||||
reg_item("water_bottle", 3)
 | 
			
		||||
							
								
								
									
										29
									
								
								home_vending_machines/machines.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,29 @@
 | 
			
		||||
home_vending_machines.register_currency("default:gold_ingot", 1)
 | 
			
		||||
home_vending_machines.register_currency("currency:minegeld_cent_25", 1)
 | 
			
		||||
 | 
			
		||||
home_vending_machines.register_machine("simple", "home_workshop_misc:soda_machine", {
 | 
			
		||||
    description = "Soda vending machine",
 | 
			
		||||
    tiles = {"home_vending_machines_soda_machine.png"},
 | 
			
		||||
    sounds = nil,
 | 
			
		||||
    _vmachine = {
 | 
			
		||||
        item = "home_vending_machines:soda_can"
 | 
			
		||||
    }
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
home_vending_machines.register_machine("simple", "home_vending_machines:drink_machine", {
 | 
			
		||||
    description = "Drinks vending machine",
 | 
			
		||||
    tiles = {"home_vending_machines_drink_machine.png"},
 | 
			
		||||
    sounds = nil,
 | 
			
		||||
    _vmachine = {
 | 
			
		||||
        item = {"home_vending_machines:soda_can", "home_vending_machines:water_bottle"}
 | 
			
		||||
    }
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
home_vending_machines.register_machine("simple", "home_vending_machines:sweet_machine", {
 | 
			
		||||
    description = "Sweets vending machine",
 | 
			
		||||
    tiles = {"home_vending_machines_sweet_machine.png"},
 | 
			
		||||
    sounds = nil,
 | 
			
		||||
    _vmachine = {
 | 
			
		||||
        item = "home_vending_machines:soda_can"
 | 
			
		||||
    }
 | 
			
		||||
})
 | 
			
		||||
							
								
								
									
										2
									
								
								home_vending_machines/mod.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,2 @@
 | 
			
		||||
name = home_vending_machines
 | 
			
		||||
optional_depends = screwdriver, default, dye, vessels, farming
 | 
			
		||||
							
								
								
									
										11
									
								
								home_vending_machines/readme.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,11 @@
 | 
			
		||||
code wsor MIT
 | 
			
		||||
 | 
			
		||||
VanessaE (cc-by-sa 4.0):
 | 
			
		||||
home_vending_machines_machine.obj
 | 
			
		||||
home_vending_machines_soda_can.png
 | 
			
		||||
home_vending_machines_soda_machine.png
 | 
			
		||||
 | 
			
		||||
Andrey01 (CC BY-SA 3.0):
 | 
			
		||||
home_vending_machines_drimk_machine.png
 | 
			
		||||
home_vending_machines_sweet_machine.png
 | 
			
		||||
home_vending_machines_water_bottle.png
 | 
			
		||||
| 
		 Before Width: | Height: | Size: 155 B After Width: | Height: | Size: 155 B  | 
| 
		 After Width: | Height: | Size: 381 B  | 
| 
		 After Width: | Height: | Size: 920 B  | 
| 
		 Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB  | 
| 
		 After Width: | Height: | Size: 1.3 KiB  | 
@@ -1,2 +0,0 @@
 | 
			
		||||
-- nothing to see here :P
 | 
			
		||||
-- this is just a stub to provide a few textures
 | 
			
		||||
@@ -17,7 +17,7 @@ minetest.register_node("home_workshop_machines:3dprinter_bedflinger", {
 | 
			
		||||
	paramtype = "light",
 | 
			
		||||
	walkable = true,
 | 
			
		||||
	groups = {snappy=3, ud_param2_colorable = 1},
 | 
			
		||||
	sound = default.node_sound_wood_defaults(),
 | 
			
		||||
	sound = default and default.node_sound_wood_defaults() or nil,
 | 
			
		||||
	drawtype = "mesh",
 | 
			
		||||
	mesh = "home_workshop_machines_3dprinter_bedflinger.obj",
 | 
			
		||||
	paramtype2 = "colorwallmounted",
 | 
			
		||||
@@ -47,7 +47,7 @@ minetest.register_node("home_workshop_machines:3dprinter_corexy", {
 | 
			
		||||
	paramtype = "light",
 | 
			
		||||
	walkable = true,
 | 
			
		||||
	groups = {snappy=3, ud_param2_colorable = 1},
 | 
			
		||||
	sound = default.node_sound_wood_defaults(),
 | 
			
		||||
	sound = default and default.node_sound_wood_defaults() or nil,
 | 
			
		||||
	drawtype = "mesh",
 | 
			
		||||
	mesh = "home_workshop_machines_3dprinter_corexy.obj",
 | 
			
		||||
	paramtype2 = "colorwallmounted",
 | 
			
		||||
@@ -61,6 +61,28 @@ minetest.register_node("home_workshop_machines:3dprinter_corexy", {
 | 
			
		||||
	on_rotate = unifieddyes.fix_after_screwdriver_nsew,
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("basic_materials") then
 | 
			
		||||
	minetest.register_craft({
 | 
			
		||||
		output = "home_workshop_machines:3dprinter_bedflinger",
 | 
			
		||||
		recipe = {
 | 
			
		||||
			{"basic_materials:plastic_sheet", "dye:white", "basic_materials:plastic_sheet"},
 | 
			
		||||
			{"basic_materials:motor", "basic_materials:heating_element", "basic_materials:motor"},
 | 
			
		||||
			{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
 | 
			
		||||
		},
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("basic_materials") then
 | 
			
		||||
	minetest.register_craft({
 | 
			
		||||
		output = "home_workshop_machines:3dprinter_corexy",
 | 
			
		||||
		recipe = {
 | 
			
		||||
			{"default:steel_ingot", "basic_materials:motor", "basic_materials:plastic_sheet"},
 | 
			
		||||
			{"default:glass", "basic_materials:heating_element", "default:glass"},
 | 
			
		||||
			{"default:steel_ingot", "basic_materials:motor", "default:steel_ingot"},
 | 
			
		||||
		},
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
minetest.register_alias("computer:3dprinter_bedflinger",  "home_workshop_machines:3dprinter_bedflinger")
 | 
			
		||||
minetest.register_alias("computers:3dprinter_bedflinger", "home_workshop_machines:3dprinter_bedflinger")
 | 
			
		||||
minetest.register_alias("computer:3dprinter_corexy",      "home_workshop_machines:3dprinter_corexy")
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,3 @@
 | 
			
		||||
name = home_workshop_machines
 | 
			
		||||
depends = default, unifieddyes
 | 
			
		||||
optional_depends = screwdriver
 | 
			
		||||
depends = unifieddyes
 | 
			
		||||
optional_depends = default, screwdriver, dye, basic_materials
 | 
			
		||||
 
 | 
			
		||||
@@ -14,13 +14,4 @@ minetest.register_craft({
 | 
			
		||||
		{ "basic_materials:steel_bar", "default:steel_ingot", "basic_materials:steel_bar" },
 | 
			
		||||
		{ "default:steel_ingot",       "default:steel_ingot", "default:steel_ingot" }
 | 
			
		||||
	},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
	output = "homedecor:soda_machine",
 | 
			
		||||
	recipe = {
 | 
			
		||||
		{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
 | 
			
		||||
		{"default:steel_ingot", "dye:red",             "default:steel_ingot"},
 | 
			
		||||
		{"default:steel_ingot", "default:copperblock", "default:steel_ingot"},
 | 
			
		||||
	},
 | 
			
		||||
})
 | 
			
		||||
})
 | 
			
		||||
@@ -14,6 +14,7 @@ minetest.register_node("home_workshop_misc:tool_cabinet", {
 | 
			
		||||
		"home_workshop_common_generic_metal_bright.png",
 | 
			
		||||
		"home_workshop_misc_tool_cabinet_misc.png",
 | 
			
		||||
	},
 | 
			
		||||
	paramtype = "light",
 | 
			
		||||
	paramtype2="facedir",
 | 
			
		||||
	inventory_image = "home_workshop_misc_tool_cabinet_inv.png",
 | 
			
		||||
	on_rotate = minetest.get_modpath("screwdriver") and screwdriver.rotate_simple or nil,
 | 
			
		||||
@@ -33,6 +34,7 @@ minetest.register_node("home_workshop_misc:beer_tap", {
 | 
			
		||||
		{ name = "home_workshop_common_generic_metal.png", color = 0xff303030 }
 | 
			
		||||
	},
 | 
			
		||||
	inventory_image = "home_workshop_misc_beertap_inv.png",
 | 
			
		||||
	paramtype = "light",
 | 
			
		||||
	paramtype2 = "facedir",
 | 
			
		||||
	groups = { snappy=3 },
 | 
			
		||||
	walkable = false,
 | 
			
		||||
@@ -46,9 +48,9 @@ minetest.register_node("home_workshop_misc:beer_tap", {
 | 
			
		||||
		local wieldname = itemstack:get_name()
 | 
			
		||||
		if wieldname == "vessels:drinking_glass" then
 | 
			
		||||
			if inv:room_for_item("main", "home_workshop_misc:beer_mug 1") then
 | 
			
		||||
				inv:add_item("main", "home_workshop_misc:beer_mug 1")
 | 
			
		||||
				itemstack:take_item()
 | 
			
		||||
				clicker:set_wielded_item(itemstack)
 | 
			
		||||
				inv:add_item("main", "home_workshop_misc:beer_mug 1")
 | 
			
		||||
				minetest.chat_send_player(clicker:get_player_name(),
 | 
			
		||||
						S("Ahh, a frosty cold beer - look in your inventory for it!"))
 | 
			
		||||
			else
 | 
			
		||||
@@ -70,76 +72,33 @@ minetest.register_node("home_workshop_misc:beer_mug", {
 | 
			
		||||
	mesh = "home_workshop_misc_beer_mug.obj",
 | 
			
		||||
	tiles = { "home_workshop_misc_beer_mug.png" },
 | 
			
		||||
	inventory_image = "home_workshop_misc_beer_mug_inv.png",
 | 
			
		||||
	paramtype = "light",
 | 
			
		||||
	paramtype2 = "facedir",
 | 
			
		||||
	groups = { snappy=3, oddly_breakable_by_hand=3 },
 | 
			
		||||
	walkable = false,
 | 
			
		||||
	sounds = default.node_sound_glass_defaults(),
 | 
			
		||||
	sounds = default and default.node_sound_glass_defaults() or nil,
 | 
			
		||||
	selection_box = beer_cbox,
 | 
			
		||||
	on_use = function(itemstack, user, pointed_thing)
 | 
			
		||||
		if not creative.is_enabled_for(user:get_player_name()) then
 | 
			
		||||
		if not minetest.is_creative_enabled(user:get_player_name()) then
 | 
			
		||||
			minetest.do_item_eat(2, "vessels:drinking_glass 1", itemstack, user, pointed_thing)
 | 
			
		||||
			return itemstack
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
local svm_cbox = {
 | 
			
		||||
	type = "fixed",
 | 
			
		||||
	fixed = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
minetest.register_node("home_workshop_misc:soda_machine", {
 | 
			
		||||
	description = S("Soda vending machine"),
 | 
			
		||||
	drawtype = "mesh",
 | 
			
		||||
	mesh = "home_workshop_misc_soda_machine.obj",
 | 
			
		||||
	tiles = {"home_workshop_misc_soda_machine.png"},
 | 
			
		||||
	paramtype2 = "facedir",
 | 
			
		||||
	groups = {snappy=3},
 | 
			
		||||
	selection_box = svm_cbox,
 | 
			
		||||
	collision_box = svm_cbox,
 | 
			
		||||
	expand = { top="placeholder" },
 | 
			
		||||
	sounds = default.node_sound_wood_defaults(),
 | 
			
		||||
	on_rotate = minetest.get_modpath("screwdriver") and screwdriver.rotate_simple or nil,
 | 
			
		||||
	on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
 | 
			
		||||
		local playername = clicker:get_player_name()
 | 
			
		||||
		local wielditem = clicker:get_wielded_item()
 | 
			
		||||
		local wieldname = wielditem:get_name()
 | 
			
		||||
		local fdir_to_fwd = { {0, -1}, {-1, 0}, {0, 1}, {1, 0} }
 | 
			
		||||
		local fdir = node.param2
 | 
			
		||||
		local pos_drop = { x=pos.x+fdir_to_fwd[fdir+1][1], y=pos.y, z=pos.z+fdir_to_fwd[fdir+1][2] }
 | 
			
		||||
		if wieldname == "currency:minegeld_cent_25" then
 | 
			
		||||
			minetest.spawn_item(pos_drop, "home_workshop_misc:soda_can")
 | 
			
		||||
			minetest.sound_play("insert_coin", {
 | 
			
		||||
				pos=pos, max_hear_distance = 5
 | 
			
		||||
			})
 | 
			
		||||
			if not creative.is_enabled_for(playername) then
 | 
			
		||||
				wielditem:take_item()
 | 
			
		||||
				clicker:set_wielded_item(wielditem)
 | 
			
		||||
				return wielditem
 | 
			
		||||
			end
 | 
			
		||||
		else
 | 
			
		||||
			minetest.chat_send_player(playername, S("Please insert a 25 Mg cent coin in the machine."))
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
minetest.register_craftitem("home_workshop_misc:soda_can", {
 | 
			
		||||
	description = S("Soda Can"),
 | 
			
		||||
	inventory_image = "home_workshop_misc_soda_can.png",
 | 
			
		||||
	on_use = minetest.item_eat(2),
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("homedecor_common") then
 | 
			
		||||
	minetest.register_alias("home_workshop_misc:drawer_small", "homedecor:drawer_small")
 | 
			
		||||
else
 | 
			
		||||
	minetest.register_craftitem("home_workshop_misc:drawer_small", {
 | 
			
		||||
			description = S("Small Wooden Drawer"),
 | 
			
		||||
			inventory_image = "home_workshop_machines_drawer_small.png",
 | 
			
		||||
			inventory_image = "home_workshop_common_drawer_small.png",
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local MODPATH = minetest.get_modpath("home_workshop_misc")
 | 
			
		||||
dofile(MODPATH.."/crafts.lua")
 | 
			
		||||
if minetest.get_modpath("default") and minetest.get_modpath("basic_materials") then
 | 
			
		||||
	dofile(MODPATH.."/crafts.lua")
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
minetest.register_alias("homedecor:tool_cabinet",        "home_workshop_misc:tool_cabinet")
 | 
			
		||||
minetest.register_alias("homedecor:tool_cabinet_bottom", "home_workshop_misc:tool_cabinet")
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,2 @@
 | 
			
		||||
name = home_workshop_misc
 | 
			
		||||
depends = default, home_workshop_common
 | 
			
		||||
optional_depends = currency, screwdriver, homedecor_common
 | 
			
		||||
optional_depends = currency, screwdriver, homedecor_common, default
 | 
			
		||||
 
 | 
			
		||||
| 
		 Before Width: | Height: | Size: 225 B After Width: | Height: | Size: 225 B  | 
| 
		 Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 218 B  | 
| 
		 Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 186 B  | 
							
								
								
									
										2
									
								
								license.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,2 @@
 | 
			
		||||
LGPL-3.0 for code,
 | 
			
		||||
CC-BY-SA-4.0 for media.
 | 
			
		||||
							
								
								
									
										1
									
								
								modpack.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1 @@
 | 
			
		||||
name = home_workshop_modpack
 | 
			
		||||