Add files via upload

master
wintersknight94 2022-01-24 15:12:43 -06:00 committed by GitHub
parent bea0e3e310
commit f5bdffe182
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 79 additions and 0 deletions

9
init.lua Normal file
View File

@ -0,0 +1,9 @@
-- LUALOCALS < ---------------------------------------------------------
local include, nodecore
= include, nodecore
-- LUALOCALS > ---------------------------------------------------------
include("turbine")
include("waterwheel")
--include("pipes_glass")
--include("pipes_bamboo")

6
mod.conf Normal file
View File

@ -0,0 +1,6 @@
depends = nc_api_all, nc_items, nc_terrain, nc_fire, nc_lux, nc_lode, nc_igneous, nc_optics, nc_doors, wc_steam
optional_depends = wc_dynamics, wc_naturae
author = Winter94
description = For all of your engineering needs!
name = wc_steampunk
title = NodeCore Steampunk Engineering

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

33
turbine.lua Normal file
View File

@ -0,0 +1,33 @@
-- LUALOCALS < ---------------------------------------------------------
local minetest, nodecore, math, pairs
= minetest, nodecore, math, pairs
-- LUALOCALS > ---------------------------------------------------------
local modname = minetest.get_current_modname()
local directions = {
{x=0, y=1, z=0},
{x=0, y=-1, z=0},
{x=1, y=0, z=0},
{x=-1, y=0, z=0},
{x=0, y=0, z=1},
{x=0, y=0, z=-1},
}
nodecore.register_abm({
label = "steam power",
nodenames = {"group:dense_gas"},
neighbors = {"group:door"},
interval = 1,
chance = 1,
action = function(pos)
for _, dir in pairs(directions) do
local outpos = vector.add(pos, dir)
nodecore.operate_door(outpos, nil, dir)
nodecore.set_node(pos, {name = "wc_steam:steam"})
nodecore.sound_play("nc_api_craft_hiss", {pos = pos, gain = 0.02, fade = 1})
end
end
})

31
waterwheel.lua Normal file
View File

@ -0,0 +1,31 @@
-- LUALOCALS < ---------------------------------------------------------
local minetest, nodecore, math, pairs
= minetest, nodecore, math, pairs
-- LUALOCALS > ---------------------------------------------------------
local modname = minetest.get_current_modname()
local directions = {
-- {x=0, y=1, z=0},
{x=0, y=-1, z=0},
-- {x=1, y=0, z=0},
-- {x=-1, y=0, z=0},
-- {x=0, y=0, z=1},
-- {x=0, y=0, z=-1},
}
nodecore.register_abm({
label = "waterwheel",
nodenames = {"group:water"},
neighbors = {"group:door"},
neighbors_invert = true,
interval = 1,
chance = 1,
action = function(pos)
for _, dir in pairs(directions) do
local outpos = vector.add(pos, dir)
nodecore.operate_door(outpos, nil, dir)
end
end
})