Skip to content

Commit

Permalink
Add support for Aurum.
Browse files Browse the repository at this point in the history
  • Loading branch information
linewriter1024 committed Jun 14, 2021
1 parent babd508 commit ca1c776
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
root = true

[*]
indent_style = space
indent_size = 4
34 changes: 25 additions & 9 deletions components.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ local get_node = elevator.get_node
local homedecor_path = minetest.get_modpath("homedecor")
local mineclone_path = core.get_modpath("mcl_core") and mcl_core
local default_path = core.get_modpath("default") and default
local aurum_path = core.get_modpath("aurum") and aurum

local moditems = {} -- local table to hold substitutes

Expand Down Expand Up @@ -46,7 +47,7 @@ if mineclone_path then
moditems.el_motor_gfx = "elevator_motor_mcl.png"
moditems.el_shaft_gfx = "elevator_shaft_mcl.png"
moditems.el_box_gfx = "elevator_box_mcl.png"

moditems.steel_block_image = "default_steel_block.png"
elseif default_path then
moditems.el_shaft_groups = {cracky=2,oddly_breakable_by_hand=0} -- removing ability to destroy by hand to prevent accidental breakage of whole elevators
moditems.el_motor_groups = {cracky=1}
Expand All @@ -56,14 +57,29 @@ elseif default_path then
moditems.el_motor_gfx = "elevator_motor.png"
moditems.el_shaft_gfx = "elevator_shaft.png"
moditems.el_box_gfx = "elevator_box.png"
moditems.steel_block_image = "default_steel_block.png"
elseif aurum_path then
moditems.el_shaft_groups = {dig_pick = 2}
moditems.el_motor_groups = {dig_pick = 1}
moditems.elevator_groups = {dig_pick = 1}
moditems.elevator_special_groups = {not_in_creative_inventory=1}
moditems.sounds_stone = aurum.sounds.stone
moditems.el_motor_gfx = "elevator_motor.png"
moditems.el_shaft_gfx = "elevator_shaft.png"
moditems.el_box_gfx = "elevator_box.png"
moditems.steel_block_image = "aurum_ore_white.png^[colorize:#cbcdcd:255^aurum_ore_bumps.png^aurum_ore_block.png"
end

if minetest.global_exists("screwdriver") then
moditems.on_rotate_disallow = screwdriver.disallow
end

minetest.register_node("elevator:shaft", {
description = "Elevator Shaft",
tiles = { moditems.el_shaft_gfx },
drawtype = "nodebox",
paramtype = "light",
on_rotate = screwdriver.disallow,
on_rotate = moditems.on_rotate_disallow,
sunlight_propagates = true,
groups = moditems.el_shaft_groups,
sounds = moditems.sounds_stone(),
Expand Down Expand Up @@ -100,8 +116,8 @@ minetest.register_node("elevator:shaft", {
minetest.register_node("elevator:motor", {
description = "Elevator Motor",
tiles = {
"default_steel_block.png",
"default_steel_block.png",
moditems.steel_block_image,
moditems.steel_block_image,
moditems.el_motor_gfx,
moditems.el_motor_gfx,
moditems.el_motor_gfx,
Expand Down Expand Up @@ -162,8 +178,8 @@ minetest.register_node("elevator:elevator_box", {
},

tiles = {
"default_steel_block.png",
"default_steel_block.png",
moditems.steel_block_image,
moditems.steel_block_image,
moditems.el_box_gfx,
moditems.el_box_gfx,
moditems.el_box_gfx,
Expand Down Expand Up @@ -212,7 +228,7 @@ for _,mode in ipairs({"on", "off"}) do
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
on_rotate = screwdriver.disallow,
on_rotate = moditems.on_rotate_disallow,

selection_box = {
type = "fixed",
Expand All @@ -230,8 +246,8 @@ for _,mode in ipairs({"on", "off"}) do
},

tiles = on and {
"default_steel_block.png",
"default_steel_block.png",
moditems.steel_block_image,
moditems.steel_block_image,
moditems.el_box_gfx,
moditems.el_box_gfx,
moditems.el_box_gfx,
Expand Down
26 changes: 26 additions & 0 deletions crafts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
local technic_path = minetest.get_modpath("technic")
local chains_path = minetest.get_modpath("chains")
local mineclone_path = core.get_modpath("mcl_core") and mcl_core
local aurum_path = core.get_modpath("aurum") and aurum

if mineclone_path then
minetest.register_craft({
Expand Down Expand Up @@ -29,7 +30,32 @@ if mineclone_path then
{"mcl_core:paper", "mcl_core:gold_ingot", "mcl_core:paper"}
},
})
elseif aurum_path then
minetest.register_craft({
output = "elevator:elevator",
recipe = {
{"aurum_ore:iron_ingot", "group:glass", "aurum_ore:iron_ingot"},
{"aurum_ore:iron_ingot", "aurum_ore:mana_bean", "aurum_ore:iron_ingot"},
{"aurum_ore:iron_ingot", "group:glass", "aurum_ore:iron_ingot"},
},
})

minetest.register_craft({
output = "elevator:shaft",
recipe = {
{"group:glass", "aurum_ore:iron_ingot"},
{"group:wood", "group:glass"},
},
})

minetest.register_craft({
output = "elevator:motor",
recipe = {
{"aurum_ore:gold_ingot", "aurum_ore:iron_ingot", "aurum_ore:gold_ingot"},
{"aurum_ore:iron_block", "aurum_cook:oven", "aurum_ore:iron_block"},
{"aurum_ore:gold_ingot", "aurum_ore:mana_bean", "aurum_ore:gold_ingot"}
},
})
elseif technic_path and chains_path then
minetest.register_craft({
output = "elevator:elevator",
Expand Down
4 changes: 2 additions & 2 deletions mod.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name = elevator
description = An entity-based elevator allowing fast realtime travel in Minetest. Supports Minetest Game and MineClone2.
optional_depends = default, technic, homedecor, chains, farming, mcl_core, mcl_sounds
description = An entity-based elevator allowing fast realtime travel in Minetest. Supports Minetest Game, MineClone2, and Aurum
optional_depends = default, technic, homedecor, chains, farming, mcl_core, mcl_sounds, aurum, screwdriver

0 comments on commit ca1c776

Please sign in to comment.