Compare commits

...

5 Commits

Author SHA1 Message Date
Emojigit 4c22387816
Unknown addtional files 2021-05-03 13:14:36 +08:00
Emojigit 16dc7a29c4
Unknown addtional files 2021-05-03 13:03:41 +08:00
Emojigit 319b7dd484
import steps: rename items 2021-05-03 13:02:39 +08:00
Emojigit c77b42d6b3
Update mod.conf 2021-05-03 12:59:53 +08:00
Emojigit ded540d6f8
Update LICENSE 2021-05-03 12:59:14 +08:00
6 changed files with 14 additions and 14 deletions

View File

@ -1,5 +1,5 @@
MIT License
Copyright (c) 2016 Elijah Duffy
Copyright (c) 2016 Elijah Duffy and Cato Yiu
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

View File

@ -15,7 +15,7 @@ digicompute.register_computer("<computer_string>", {
})
```
The definition is formed just like that of a normal node definition, except digicompute uses it to do a lot of groundwork rather than requiring you to do it manually. **Note:** do not put a modname in the computer string, `digicompute:` is automatically inserted.
The definition is formed just like that of a normal node definition, except digicompute uses it to do a lot of groundwork rather than requiring you to do it manually. **Note:** do not put a modname in the computer string, `digicompute_redo:` is automatically inserted.
**Example:**
```lua

View File

@ -1 +1 @@
name = digicompute
name = digicompute_redo

View File

@ -25,7 +25,7 @@ local check_booting = coroutine.create(function()
local temp = get_node(c.pos)
local ddef = minetest.registered_nodes[temp.name].digicompute
if ddef.state == "off" or ddef.state == "bios" then
local name, param2 = "digicompute:"..ddef.base, temp.param2
local name, param2 = "digicompute_redo:"..ddef.base, temp.param2
digicompute.c:complete_boot(c.pos, id, name, param2)
else
c.booting = nil
@ -158,7 +158,7 @@ end
-- [function] turn computer off
function digicompute.c:off(pos, player)
local temp = minetest.get_node(pos) -- Get basic node information
local offname = "digicompute:"..minetest.registered_nodes[temp.name].digicompute.base
local offname = "digicompute_redo:"..minetest.registered_nodes[temp.name].digicompute.base
local meta = minetest.get_meta(pos)
-- Swap node to off
minetest.swap_node({x = pos.x, y = pos.y, z = pos.z}, {name = offname, param2 = temp.param2})
@ -190,7 +190,7 @@ end
function digicompute.register_computer(itemstring, def)
-- off
minetest.register_node("digicompute:"..itemstring, {
minetest.register_node("digicompute_redo:"..itemstring, {
digicompute = {
state = "off",
base = itemstring,
@ -201,7 +201,7 @@ function digicompute.register_computer(itemstring, def)
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 2},
drop = "digicompute:"..itemstring,
drop = "digicompute_redo:"..itemstring,
sounds = default.node_sound_stone_defaults(),
node_box = def.node_box,
after_place_node = function(pos, player)
@ -230,7 +230,7 @@ function digicompute.register_computer(itemstring, def)
end,
})
-- bios
minetest.register_node("digicompute:"..itemstring.."_bios", {
minetest.register_node("digicompute_redo:"..itemstring.."_bios", {
light_source = def.light_source or 7,
digicompute = {
state = "bios",
@ -242,7 +242,7 @@ function digicompute.register_computer(itemstring, def)
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 2, not_in_creative_inventory = 1},
drop = "digicompute:"..itemstring,
drop = "digicompute_redo:"..itemstring,
sounds = default.node_sound_stone_defaults(),
node_box = def.node_box,
on_destruct = function(pos)
@ -252,7 +252,7 @@ function digicompute.register_computer(itemstring, def)
end,
})
-- on
minetest.register_node("digicompute:"..itemstring.."_on", {
minetest.register_node("digicompute_redo:"..itemstring.."_on", {
light_source = def.light_source or 7,
digicompute = {
state = "on",
@ -264,7 +264,7 @@ function digicompute.register_computer(itemstring, def)
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 2, not_in_creative_inventory = 1},
drop = "digicompute:"..itemstring,
drop = "digicompute_redo:"..itemstring,
sounds = default.node_sound_stone_defaults(),
node_box = def.node_box,
on_rightclick = function(pos, node, player)

View File

@ -282,7 +282,7 @@ function digicompute.c:open(pos, player, formname)
digicompute.c:set_user(pos, name)
computer_contexts[name] = minetest.get_meta(pos):get_string("id")
minetest.show_formspec(name, "digicompute:"..formname, form.get(pos, player))
minetest.show_formspec(name, "digicompute_redo:"..formname, form.get(pos, player))
return true
end
else

View File

@ -34,7 +34,7 @@ function digicompute.c:set_user(pos, name)
local formname = meta:get_string("formname")
-- if formname is defined, close that formspec
if formname ~= "" then
minetest.close_formspec(current_user, "digicompute:"..formname)
minetest.close_formspec(current_user, "digicompute_redo:"..formname)
end
-- Remove from current users
current_users[current_user] = nil
@ -56,7 +56,7 @@ function digicompute.c:unset_user(pos, name)
local formname = meta:get_string("formname")
-- if formname is defined, close that formspec
if formname ~= "" then
minetest.close_formspec(name, "digicompute:"..formname)
minetest.close_formspec(name, "digicompute_redo:"..formname)
end
end
end