Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
sztest
NodeCore
Commits
695ab1ce
Commit
695ab1ce
authored
Jul 05, 2020
by
Aaron Suen
Browse files
Merge branch 'dev' into mapocalypse
parents
742c5896
8074e0a6
Changes
71
Hide whitespace changes
Inline
Side-by-side
Showing
71 changed files
with
620 additions
and
142 deletions
+620
-142
.cdb-release.jpg
.cdb-release.jpg
+0
-0
.cdbrelease.lua
.cdbrelease.lua
+1
-0
docs/issues-docs.txt
docs/issues-docs.txt
+0
-2
docs/screenshot-world/README
docs/screenshot-world/README
+22
-0
docs/screenshot-world/map.sqlite
docs/screenshot-world/map.sqlite
+0
-0
docs/screenshot-world/world.mt.dist
docs/screenshot-world/world.mt.dist
+0
-1
docs/screenshot-world/worldmods/mockinv/init.lua
docs/screenshot-world/worldmods/mockinv/init.lua
+29
-25
docs/screenshot-world/worldmods/mockinv/mod.conf
docs/screenshot-world/worldmods/mockinv/mod.conf
+0
-0
docs/screenshot-world/worldmods/mockplayer/init.lua
docs/screenshot-world/worldmods/mockplayer/init.lua
+7
-0
docs/screenshot-world/worldmods/mockplayer/mod.conf
docs/screenshot-world/worldmods/mockplayer/mod.conf
+1
-0
docs/screenshot-world/worldmods/mockplayer/model.lua
docs/screenshot-world/worldmods/mockplayer/model.lua
+71
-0
docs/screenshot-world/worldmods/mockplayer/wield.lua
docs/screenshot-world/worldmods/mockplayer/wield.lua
+134
-0
docs/screenshot-world/worldmods/mocksetup/init.lua
docs/screenshot-world/worldmods/mocksetup/init.lua
+26
-0
docs/screenshot-world/worldmods/mocksetup/mod.conf
docs/screenshot-world/worldmods/mocksetup/mod.conf
+1
-0
docs/screenshot-world/worldmods/noanim/init.lua
docs/screenshot-world/worldmods/noanim/init.lua
+23
-0
docs/screenshot-world/worldmods/noanim/mod.conf
docs/screenshot-world/worldmods/noanim/mod.conf
+1
-0
docs/screenshot-world/worldmods/smokegen/init.lua
docs/screenshot-world/worldmods/smokegen/init.lua
+60
-0
docs/screenshot-world/worldmods/smokegen/mod.conf
docs/screenshot-world/worldmods/smokegen/mod.conf
+1
-0
docs/screenshot-world/worldmods/stasis/init.lua
docs/screenshot-world/worldmods/stasis/init.lua
+6
-0
docs/screenshot-world/worldmods/stasis/mod.conf
docs/screenshot-world/worldmods/stasis/mod.conf
+1
-0
mods/nc_api/init.lua
mods/nc_api/init.lua
+3
-3
mods/nc_api/item_punch_sounds.lua
mods/nc_api/item_punch_sounds.lua
+26
-4
mods/nc_api/item_txp_overlay.lua
mods/nc_api/item_txp_overlay.lua
+20
-3
mods/nc_api/mapgen_limits.lua
mods/nc_api/mapgen_limits.lua
+1
-1
mods/nc_api/util_gametime.lua
mods/nc_api/util_gametime.lua
+1
-1
mods/nc_api/util_misc.lua
mods/nc_api/util_misc.lua
+20
-13
mods/nc_api/util_stack.lua
mods/nc_api/util_stack.lua
+33
-2
mods/nc_concrete/textures/txp_nc_concrete_aggregate_wet_flowing_special1.png
...xtures/txp_nc_concrete_aggregate_wet_flowing_special1.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_aggregate_wet_flowing_special2.png
...xtures/txp_nc_concrete_aggregate_wet_flowing_special2.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_aggregate_wet_source_special1.png
...extures/txp_nc_concrete_aggregate_wet_source_special1.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_aggregate_wet_source_special2.png
...extures/txp_nc_concrete_aggregate_wet_source_special2.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_coalaggregate_wet_flowing_special1.png
...es/txp_nc_concrete_coalaggregate_wet_flowing_special1.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_coalaggregate_wet_flowing_special2.png
...es/txp_nc_concrete_coalaggregate_wet_flowing_special2.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_coalaggregate_wet_source_special1.png
...res/txp_nc_concrete_coalaggregate_wet_source_special1.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_coalaggregate_wet_source_special2.png
...res/txp_nc_concrete_coalaggregate_wet_source_special2.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_mud_wet_flowing_special1.png
...ete/textures/txp_nc_concrete_mud_wet_flowing_special1.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_mud_wet_flowing_special2.png
...ete/textures/txp_nc_concrete_mud_wet_flowing_special2.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_mud_wet_source_special1.png
...rete/textures/txp_nc_concrete_mud_wet_source_special1.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_mud_wet_source_special2.png
...rete/textures/txp_nc_concrete_mud_wet_source_special2.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_render_wet_flowing_special1.png
.../textures/txp_nc_concrete_render_wet_flowing_special1.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_render_wet_flowing_special2.png
.../textures/txp_nc_concrete_render_wet_flowing_special2.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_render_wet_source_special1.png
...e/textures/txp_nc_concrete_render_wet_source_special1.png
+0
-0
mods/nc_concrete/textures/txp_nc_concrete_render_wet_source_special2.png
...e/textures/txp_nc_concrete_render_wet_source_special2.png
+0
-0
mods/nc_lux/textures/txp_nc_lux_flux_flowing_special1.png
mods/nc_lux/textures/txp_nc_lux_flux_flowing_special1.png
+0
-0
mods/nc_lux/textures/txp_nc_lux_flux_flowing_special2.png
mods/nc_lux/textures/txp_nc_lux_flux_flowing_special2.png
+0
-0
mods/nc_lux/textures/txp_nc_lux_flux_source_special1.png
mods/nc_lux/textures/txp_nc_lux_flux_source_special1.png
+0
-0
mods/nc_lux/textures/txp_nc_lux_flux_source_special2.png
mods/nc_lux/textures/txp_nc_lux_flux_source_special2.png
+0
-0
mods/nc_optics/api.lua
mods/nc_optics/api.lua
+111
-75
mods/nc_optics/lens.lua
mods/nc_optics/lens.lua
+3
-3
mods/nc_optics/prism.lua
mods/nc_optics/prism.lua
+3
-3
mods/nc_optics/textures/txp_nc_optics_glass_hot_flowing_special1.png
...ics/textures/txp_nc_optics_glass_hot_flowing_special1.png
+0
-0
mods/nc_optics/textures/txp_nc_optics_glass_hot_flowing_special2.png
...ics/textures/txp_nc_optics_glass_hot_flowing_special2.png
+0
-0
mods/nc_optics/textures/txp_nc_optics_glass_hot_source_special1.png
...tics/textures/txp_nc_optics_glass_hot_source_special1.png
+0
-0
mods/nc_optics/textures/txp_nc_optics_glass_hot_source_special2.png
...tics/textures/txp_nc_optics_glass_hot_source_special2.png
+0
-0
mods/nc_player_model/api.lua
mods/nc_player_model/api.lua
+11
-2
mods/nc_player_model/hooks.lua
mods/nc_player_model/hooks.lua
+3
-3
mods/nc_player_pickup/rearrange.lua
mods/nc_player_pickup/rearrange.lua
+1
-1
mods/nc_terrain/textures/txp_nc_terrain_lava_flowing_special1.png
...terrain/textures/txp_nc_terrain_lava_flowing_special1.png
+0
-0
mods/nc_terrain/textures/txp_nc_terrain_lava_flowing_special2.png
...terrain/textures/txp_nc_terrain_lava_flowing_special2.png
+0
-0
mods/nc_terrain/textures/txp_nc_terrain_lava_source_special1.png
..._terrain/textures/txp_nc_terrain_lava_source_special1.png
+0
-0
mods/nc_terrain/textures/txp_nc_terrain_lava_source_special2.png
..._terrain/textures/txp_nc_terrain_lava_source_special2.png
+0
-0
mods/nc_terrain/textures/txp_nc_terrain_water_flowing_special1.png
...errain/textures/txp_nc_terrain_water_flowing_special1.png
+0
-0
mods/nc_terrain/textures/txp_nc_terrain_water_flowing_special2.png
...errain/textures/txp_nc_terrain_water_flowing_special2.png
+0
-0
mods/nc_terrain/textures/txp_nc_terrain_water_gray_flowing_special1.png
...n/textures/txp_nc_terrain_water_gray_flowing_special1.png
+0
-0
mods/nc_terrain/textures/txp_nc_terrain_water_gray_flowing_special2.png
...n/textures/txp_nc_terrain_water_gray_flowing_special2.png
+0
-0
mods/nc_terrain/textures/txp_nc_terrain_water_gray_source_special1.png
...in/textures/txp_nc_terrain_water_gray_source_special1.png
+0
-0
mods/nc_terrain/textures/txp_nc_terrain_water_gray_source_special2.png
...in/textures/txp_nc_terrain_water_gray_source_special2.png
+0
-0
mods/nc_terrain/textures/txp_nc_terrain_water_source_special1.png
...terrain/textures/txp_nc_terrain_water_source_special1.png
+0
-0
mods/nc_terrain/textures/txp_nc_terrain_water_source_special2.png
...terrain/textures/txp_nc_terrain_water_source_special2.png
+0
-0
mods/nc_tree/textures/txp_nc_tree_eggcorn_planted_special1.png
...nc_tree/textures/txp_nc_tree_eggcorn_planted_special1.png
+0
-0
screenshot.png
screenshot.png
+0
-0
No files found.
.cdb-release.jpg
View replaced file @
742c5896
View file @
695ab1ce
307 KB
|
W:
|
H:
309 KB
|
W:
|
H:
2-up
Swipe
Onion skin
.cdbrelease.lua
View file @
695ab1ce
...
...
@@ -27,6 +27,7 @@ return {
repo
=
"https://gitlab.com/sztest/nodecore"
,
website
=
"https://nodecore.mine.nu"
,
issueTracker
=
"https://discord.gg/NNYeF6f"
,
forums
=
"https://forum.minetest.net/viewtopic.php?f=15&t=24857"
,
screenshots
=
alpha
and
{
readbinary
(
'.cdb-alpha.jpg'
),
readbinary
(
'.cdb-release.jpg'
)}
or
{
readbinary
(
'.cdb-release.jpg'
)}
...
...
docs/issues-docs.txt
View file @
695ab1ce
...
...
@@ -15,8 +15,6 @@ ISSUES-DOCS: Issues related to documentation
- Add a credits file with more extensive/specific credits, including
non-copyrightable contributions to core project...?
- Add a README to the official screenshot world explaining how to use
- Design doc needs another shakedown.
- Expecially: what has "nodecorian" come to mean?
...
...
docs/screenshot-world/README
0 → 100644
View file @
695ab1ce
------------------------------------------------------------------------
This world is maintained as a "standard" screenshot to show a visual
example of a plausible game scene, including a variety of in-game
elements. It can be used freely (MIT licensed like the rest of the
game) for making screenshots for texture packs.
How To Use:
- Copy or symlink this dir into ~/.minetest/worlds, or wherever your
minetest worlds are stored.
- Copy the world.mt.dist file to world.mt.
- Enter the world (singleplayer or "host game"; either is fine).
- Do NOT move the mouse or any other controls; keep your exact position
and looking angle. If you mess up, leave and rejoin.
- Hide the chat (F2) and wait for on-screen messages to fade.
- Select the "empty" hotbar slot #6.
- Resize your window to the largest size possible, with a ~16:9 or
~16:10 aspect ratio.
- Hold the zoom key (and no other key).
- Capture an in-game screenshot (F12).
------------------------------------------------------------------------
\ No newline at end of file
docs/screenshot-world/map.sqlite
View file @
695ab1ce
No preview for this file type
docs/screenshot-world/world.mt.dist
View file @
695ab1ce
gameid = nodecore
backend = sqlite3
load_mod_nc_reative = true
docs/screenshot-world/worldmods/mock
up
/init.lua
→
docs/screenshot-world/worldmods/mock
inv
/init.lua
View file @
695ab1ce
-- LUALOCALS < ---------------------------------------------------------
local
ItemStack
,
math
,
minetest
,
nodecore
,
pairs
=
ItemStack
,
math
,
minetest
,
nodecore
,
pairs
local
math_pi
=
math.pi
local
ItemStack
,
minetest
,
nodecore
,
pairs
,
vector
=
ItemStack
,
minetest
,
nodecore
,
pairs
,
vector
-- LUALOCALS > ---------------------------------------------------------
local
modname
=
minetest
.
get_current_modname
();
minetest
.
settings
:
set
(
"time_speed"
,
0
)
minetest
.
after
(
0
,
function
()
minetest
.
set_timeofday
(
0
.
5
)
end
)
local
setinv
=
{
{
"nc_stonework:tool_pick"
,
1
,
0
.
7
},
{
"nc_stonework:tool_spade"
,
1
,
0
.
8
},
...
...
@@ -38,23 +33,8 @@ for _, v in pairs(setinv) do
v
[
1
]
=
n
end
local
startpos
=
{}
local
function
setup
(
p
)
local
n
=
p
:
get_player_name
()
local
r
=
minetest
.
get_player_privs
(
n
)
r
.
fly
=
true
r
.
fast
=
true
r
.
give
=
true
r
.
interact
=
true
r
.
nc_reative
=
true
minetest
.
set_player_privs
(
n
,
r
)
p
:
set_pos
({
x
=
-
112
.
6
,
y
=
5
,
z
=
-
92
.
6
})
p
:
set_look_horizontal
(
163
.
8
*
math_pi
/
180
)
p
:
set_look_vertical
(
9
*
math_pi
/
180
)
p
:
hud_set_flags
({
crosshair
=
false
})
local
inv
=
p
:
get_inventory
()
for
i
,
v
in
pairs
(
setinv
)
do
if
v
then
...
...
@@ -64,6 +44,30 @@ local function setup(p)
inv
:
set_stack
(
"main"
,
i
,
s
)
end
end
local
pname
=
p
:
get_player_name
()
minetest
.
after
(
0
,
function
()
p
=
minetest
.
get_player_by_name
(
pname
)
if
not
p
then
return
end
startpos
[
pname
]
=
p
:
get_pos
()
end
)
end
nodecore
.
register_on_joinplayer
(
"mock setup on join"
,
setup
)
nodecore
.
register_on_respawnplayer
(
"mock setup on respawn"
,
setup
)
nodecore
.
register_on_joinplayer
(
setup
)
nodecore
.
register_on_respawnplayer
(
setup
)
nodecore
.
register_playerstep
({
label
=
"mock inv clear"
,
action
=
function
(
p
)
local
pname
=
p
:
get_player_name
()
local
pos
=
p
:
get_pos
()
local
spos
=
startpos
[
pname
]
if
not
spos
or
vector
.
distance
(
pos
,
spos
)
<
1
then
return
end
startpos
[
pname
]
=
nil
local
inv
=
p
:
get_inventory
()
for
i
=
1
,
inv
:
get_size
(
"main"
)
do
local
sn
=
inv
:
get_stack
(
"main"
,
i
):
get_name
()
if
sn
:
sub
(
1
,
#
modname
+
1
)
==
modname
..
":"
then
inv
:
set_stack
(
"main"
,
i
,
""
)
end
end
end
})
docs/screenshot-world/worldmods/mock
up
/mod.conf
→
docs/screenshot-world/worldmods/mock
inv
/mod.conf
View file @
695ab1ce
File moved
docs/screenshot-world/worldmods/mockplayer/init.lua
0 → 100644
View file @
695ab1ce
-- LUALOCALS < ---------------------------------------------------------
local
include
=
include
-- LUALOCALS > ---------------------------------------------------------
include
(
"wield"
)
include
(
"model"
)
docs/screenshot-world/worldmods/mockplayer/mod.conf
0 → 100644
View file @
695ab1ce
depends
=
nc_api_all
,
nc_player_model
,
nc_player_wield
\ No newline at end of file
docs/screenshot-world/worldmods/mockplayer/model.lua
0 → 100644
View file @
695ab1ce
-- LUALOCALS < ---------------------------------------------------------
local
minetest
,
nodecore
,
pairs
,
vector
=
minetest
,
nodecore
,
pairs
,
vector
-- LUALOCALS > ---------------------------------------------------------
local
modname
=
minetest
.
get_current_modname
()
local
anims
=
{}
do
local
raw
=
{
0
,
53
,
165
}
raw
[
#
raw
+
1
]
=
raw
[
1
]
for
i
=
1
,
#
raw
-
1
do
anims
[
raw
[
i
]]
=
raw
[
i
+
1
]
end
end
minetest
.
register_entity
(
modname
..
":ent"
,
{
initial_properties
=
{
visual
=
"mesh"
,
visual_size
=
{
x
=
0
.
9
,
y
=
0
.
9
,
z
=
0
.
9
},
mesh
=
"nc_player_model.b3d"
,
textures
=
{
"nc_player_model_base.png"
},
collisionbox
=
{
-
0
.
25
,
0
,
-
0
.
25
,
0
.
25
,
2
,
0
.
25
},
physical
=
true
},
get_staticdata
=
function
(
self
)
return
minetest
.
serialize
(
self
.
data
)
end
,
on_activate
=
function
(
self
,
data
)
self
.
data
=
data
and
minetest
.
deserialize
(
data
)
or
{}
local
obj
=
self
.
object
obj
:
set_acceleration
({
x
=
0
,
y
=
-
10
,
z
=
0
})
local
anim
=
self
.
data
.
anim
or
0
obj
:
set_animation
({
x
=
anim
,
y
=
anim
},
1
)
nodecore
.
mock_player_wieldview
(
self
)
end
,
on_punch
=
function
(
self
,
whom
)
if
not
whom
then
return
end
local
obj
=
self
.
object
local
ctl
=
whom
:
get_player_control
()
if
ctl
.
RMB
and
ctl
.
sneak
then
return
obj
:
remove
()
end
if
ctl
.
RMB
then
local
pos
=
obj
:
get_pos
()
if
not
pos
then
return
end
pos
=
vector
.
add
(
pos
,
vector
.
multiply
(
vector
.
direction
(
whom
:
get_pos
(),
pos
),
0
.
25
))
pos
.
y
=
pos
.
y
+
1
return
obj
:
set_pos
(
pos
)
end
if
ctl
.
sneak
then
self
.
data
.
wield
=
{
inv
=
whom
:
get_inventory
():
get_list
(
"main"
),
widx
=
whom
:
get_wield_index
()
}
for
k
,
v
in
pairs
(
self
.
data
.
wield
.
inv
)
do
self
.
data
.
wield
.
inv
[
k
]
=
v
:
get_name
()
end
nodecore
.
mock_player_wieldview
(
self
)
return
end
local
pos
=
obj
:
get_pos
()
if
not
pos
then
return
end
local
dir
=
vector
.
direction
(
pos
,
whom
:
get_pos
())
obj
:
set_yaw
(
minetest
.
dir_to_yaw
(
dir
))
local
anim
=
anims
[
self
.
data
.
anim
or
0
]
self
.
data
.
anim
=
anim
obj
:
set_animation
({
x
=
anim
,
y
=
anim
},
1
)
end
})
docs/screenshot-world/worldmods/mockplayer/wield.lua
0 → 100644
View file @
695ab1ce
-- LUALOCALS < ---------------------------------------------------------
local
minetest
,
nodecore
,
pairs
=
minetest
,
nodecore
,
pairs
-- LUALOCALS > ---------------------------------------------------------
nodecore
.
amcoremod
()
local
modname
=
minetest
.
get_current_modname
()
local
xyz
=
function
(
n
)
return
{
x
=
n
,
y
=
n
,
z
=
n
}
end
local
size_w_item
=
xyz
(
0
.
2
)
local
size_w_tool
=
xyz
(
0
.
3
)
local
size_slot
=
xyz
(
0
.
075
)
local
size_item
=
xyz
(
0
.
1
)
local
hidden
=
{
is_visible
=
false
}
local
selslot
=
{
is_visible
=
true
,
visual_size
=
size_slot
,
textures
=
{
"nc_player_wield:sel"
}}
local
emptyslot
=
{
is_visible
=
true
,
visual_size
=
size_slot
,
textures
=
{
"nc_player_wield:slot"
}}
local
function
calcprops
(
itemname
,
iswield
)
local
def
=
minetest
.
registered_items
[
itemname
]
if
def
and
def
.
virtual_item
then
return
hidden
end
if
itemname
==
""
then
return
iswield
and
hidden
or
emptyslot
end
return
{
is_visible
=
true
,
visual_size
=
iswield
and
(
def
and
def
.
type
==
"tool"
and
size_w_tool
or
size_w_item
)
or
(
itemname
==
""
and
size_slot
)
or
size_item
,
textures
=
{
itemname
},
glow
=
def
and
(
def
.
light_source
or
def
.
glow
or
0
)
}
end
local
propcache_item
=
{}
local
propcache_wield
=
{}
local
function
itemprops
(
itemname
,
iswield
)
local
cache
=
iswield
and
propcache_wield
or
propcache_item
local
found
=
cache
[
itemname
]
if
found
then
return
found
end
found
=
calcprops
(
itemname
,
iswield
)
cache
[
itemname
]
=
found
return
found
end
local
entname
=
modname
..
":wv"
local
entdef
entdef
=
{
initial_properties
=
{
hp_max
=
1
,
physical
=
false
,
collide_with_objects
=
false
,
collisionbox
=
{
0
,
0
,
0
,
0
,
0
,
0
},
visual
=
"wielditem"
,
textures
=
{
""
},
is_visible
=
false
,
static_save
=
false
,
glow
=
0
},
on_activate
=
function
(
self
)
self
.
on_step
=
entdef
.
on_step
end
,
on_step
=
function
(
self
)
local
conf
=
self
.
conf
if
not
conf
then
return
self
.
object
:
remove
()
end
local
pdata
=
self
.
conf
.
ent
.
data
.
wield
if
pdata
==
nil
then
return
self
.
object
:
remove
()
end
if
not
pdata
then
return
self
.
object
:
set_properties
(
hidden
)
end
if
not
self
.
att
then
self
.
att
=
true
return
self
.
object
:
set_attach
(
self
.
conf
.
ent
.
object
,
conf
.
bone
,
conf
.
apos
,
conf
.
arot
)
end
local
widx
=
pdata
.
widx
if
conf
.
slot
==
widx
then
return
self
.
object
:
set_properties
(
selslot
)
end
return
self
.
object
:
set_properties
(
itemprops
(
pdata
.
inv
[
conf
.
slot
or
widx
],
not
conf
.
slot
))
end
}
minetest
.
register_entity
(
entname
,
entdef
)
function
nodecore
.
mock_player_wieldview
(
ent
)
local
pos
=
ent
.
object
:
get_pos
()
if
not
pos
then
return
end
for
_
,
wv
in
pairs
(
minetest
.
luaentities
)
do
if
wv
.
name
==
entname
and
wv
.
conf
.
ent
==
ent
then
wv
.
object
:
remove
()
end
end
local
function
addslot
(
n
,
b
,
x
,
y
,
z
,
rx
,
ry
,
rz
)
local
obj
=
minetest
.
add_entity
(
pos
,
entname
)
obj
:
get_luaentity
().
conf
=
{
ent
=
ent
,
slot
=
n
,
pos
=
pos
,
bone
=
b
,
apos
=
{
x
=
x
,
y
=
y
,
z
=
z
},
arot
=
{
x
=
rx
or
0
,
y
=
ry
or
180
,
z
=
rz
or
0
}
}
end
addslot
(
nil
,
"Arm_Right"
,
0
,
7
,
2
,
-
90
,
200
,
90
)
local
function
cslot
(
n
,
x
,
y
,
z
)
return
addslot
(
n
,
"Bandolier"
,
x
*
0
.
8
,
0
.
75
+
y
*
1
.
6
,
-
0
.
25
+
z
)
end
cslot
(
1
,
1
.
75
,
0
,
0
)
cslot
(
2
,
-
1
,
1
,
0
.
05
)
cslot
(
3
,
1
,
2
,
0
.
1
)
cslot
(
4
,
-
1
.
75
,
3
,
0
.
02
)
cslot
(
5
,
1
.
75
,
3
,
0
.
02
)
cslot
(
6
,
-
1
,
2
,
0
.
1
)
cslot
(
7
,
1
,
1
,
0
.
05
)
cslot
(
8
,
-
1
.
75
,
0
,
0
)
end
docs/screenshot-world/worldmods/mocksetup/init.lua
0 → 100644
View file @
695ab1ce
-- LUALOCALS < ---------------------------------------------------------
local
math
,
minetest
,
nodecore
=
math
,
minetest
,
nodecore
local
math_pi
=
math.pi
-- LUALOCALS > ---------------------------------------------------------
local
function
setup
(
p
)
local
n
=
p
:
get_player_name
()
local
r
=
minetest
.
get_player_privs
(
n
)
r
.
fly
=
true
r
.
fast
=
true
r
.
give
=
true
r
.
interact
=
true
r
.
nc_reative
=
true
minetest
.
set_player_privs
(
n
,
r
)
p
:
set_pos
({
x
=
-
112
.
6
,
y
=
5
,
z
=
-
92
.
6
})
p
:
set_look_horizontal
(
163
.
8
*
math_pi
/
180
)
p
:
set_look_vertical
(
9
*
math_pi
/
180
)
p
:
hud_set_flags
({
crosshair
=
false
})
end
nodecore
.
register_on_joinplayer
(
setup
)
nodecore
.
register_on_respawnplayer
(
setup
)
docs/screenshot-world/worldmods/mocksetup/mod.conf
0 → 100644
View file @
695ab1ce
depends
=
nc_api_all
\ No newline at end of file
docs/screenshot-world/worldmods/noanim/init.lua
0 → 100644
View file @
695ab1ce
-- LUALOCALS < ---------------------------------------------------------
local
minetest
,
nodecore
,
pairs
,
rawset
,
type
=
minetest
,
nodecore
,
pairs
,
rawset
,
type
-- LUALOCALS > ---------------------------------------------------------
local
function
noanim
(
t
)
if
type
(
t
)
~=
"table"
then
return
t
end
if
t
.
animation
then
rawset
(
t
.
animation
,
"length"
,
1000000
)
end
for
_
,
v
in
pairs
(
t
)
do
noanim
(
v
)
end
return
t
end
for
_
,
v
in
pairs
(
minetest
.
registered_nodes
)
do
noanim
(
v
.
tiles
)
noanim
(
v
.
special_tiles
)
end
nodecore
.
register_on_register_item
(
function
(
_
,
def
)
noanim
(
def
.
tiles
)
noanim
(
def
.
special_tiles
)
end
)
docs/screenshot-world/worldmods/noanim/mod.conf
0 → 100644
View file @
695ab1ce
depends
=
nc_api_all
\ No newline at end of file
docs/screenshot-world/worldmods/smokegen/init.lua
0 → 100644
View file @
695ab1ce
-- LUALOCALS < ---------------------------------------------------------
local
PcgRandom
,
minetest
,
nodecore
=
PcgRandom
,
minetest
,
nodecore
-- LUALOCALS > ---------------------------------------------------------
local
modname
=
minetest
.
get_current_modname
()
local
genname
=
modname
..
":gen"
minetest
.
register_node
(
genname
,
{
description
=
"Smoke Generator"
,
inventory_image
=
"nc_api_craft_smoke.png"
,
wield_image
=
"nc_api_craft_smoke.png"
,
drawtype
=
"airlike"
,
paramtype
=
"light"
,
sunlight_propagates
=
true
,
walkable
=
false
,
groups
=
{
snappy
=
1
}
})
nodecore
.
register_dnt
({
name
=
genname
,
nodenames
=
{
genname
},
time
=
2
,
loop
=
true
,
ignore_stasis
=
true
,
action
=
function
(
pos
)
local
pcg
=
PcgRandom
(
minetest
.
hash_node_position
(
pos
))
local
rng
=
function
()
return
pcg
:
next
()
/
2
^
32
+
0
.
5
end
for
_
=
1
,
10
do
local
p
=
{
x
=
pos
.
x
+
rng
()
-
0
.
5
,
y
=
pos
.
y
+
rng
()
*
2
-
0
.
5
,
z
=
pos
.
z
+
rng
()
-
0
.
5
,
}
minetest
.
add_particle
({
pos
=
p
,
texture
=
"nc_api_craft_smoke.png"
,
size
=
rng
()
*
2
+
1
,
expirationtime
=
2
.
1
})
end
end
})
nodecore
.
register_abm
({
label
=
"smokegen"
,
nodenames
=
{
genname
},
interval
=
1
,
chance
=
1
,
ignore_stasis
=
true
,
action
=
function
(
pos
)
return
nodecore
.
dnt_set
(
pos
,
genname
)
end
})
nodecore
.
register_lbm
({
name
=
genname
,
nodenames
=
{
genname
},
run_at_every_load
=
true
,
action
=
function
(
pos
)
return
nodecore
.
dnt_reset
(
pos
,
genname
,
0
.
01
)
end
})
docs/screenshot-world/worldmods/smokegen/mod.conf
0 → 100644
View file @
695ab1ce
depends
=
nc_api_all
\ No newline at end of file
docs/screenshot-world/worldmods/stasis/init.lua
0 → 100644
View file @
695ab1ce
-- LUALOCALS < ---------------------------------------------------------
local
nodecore
=
nodecore
-- LUALOCALS > ---------------------------------------------------------
nodecore
.
stasis
=
true
docs/screenshot-world/worldmods/stasis/mod.conf
0 → 100644
View file @
695ab1ce
depends
=
nc_api_all
\ No newline at end of file
mods/nc_api/init.lua
View file @
695ab1ce
...
...
@@ -58,7 +58,7 @@ function nodecore.log(level, ...)
return
minetest
.
log
(
level
,
...
)
end
nodecore
.
log
(
"
info
"
,
nodecore
.
product
..
(
nodecore
.
version
and
(
" Version "
..
nodecore
.
version
)
nodecore
.
log
(
"
action
"
,
nodecore
.
product
..
(
nodecore
.
version
and
(
" Version "
..
nodecore
.
version
)
or
" DEVELOPMENT VERSION"
))
do
...
...
@@ -70,11 +70,11 @@ do
local
t
=
{}
for
k
,
v
in
pairs
(
nodecore
)
do
if
k
:
sub
(
1
,
#
reg
)
==
reg
and
type
(
v
)
==
"table"
and
#
v
>
0
then
t
[
#
t
+
1
]
=
k
..
"
:
"
..
#
v
t
[
#
t
+
1
]
=
k
:
sub
(
#
reg
+
1
)
..
"
=
"
..
#
v
end
end
table_sort
(
t
)
for
_
,
x
in
pairs
(
t
)
do
nodecore
.
log
(
"info"
,
x
)
end
nodecore
.
log
(
"action"
,
"registered: "
..
table_concat
(
t
,
" "
))
end
minetest
.
after
(
0
,
regreport
)
end
...
...
mods/nc_api/item_punch_sounds.lua
View file @
695ab1ce
-- LUALOCALS < ---------------------------------------------------------
local
minetest
,
nodecore
=
minetest
,
nodecore
local
minetest
,
nodecore
,
vector
=
minetest
,
nodecore
,
vector
-- LUALOCALS > ---------------------------------------------------------
local
lasthit
=
{}
local
function
wearfx
(
puncher
,
wield
)
nodecore
.
sound_play
(
"nc_api_toolwear"
,
{
object
=
puncher
,
gain
=
0
.
5
})
local
ppos
=
puncher
:
get_pos
()
if
not
ppos
then
return
end
ppos
.
y
=
ppos
.
y
+
puncher
:
get_properties
().
eye_height
-
0
.
1
local
look
=
puncher
:
get_look_dir
()
for
_
=
1
,
3
do
nodecore
.
digparticles
(
wield
:
get_definition
(),
{
time
=
0
.
05
,
amount
=
1
,
minpos
=
ppos
,
maxpos
=
ppos
,
minvel
=
vector
.
add
(
look
,
{
x
=
-
1
,
y
=
-
1
,
z
=
-
1
}),
maxvel
=
vector
.
add
(
look
,
{
x
=
1
,
y
=
1
,
z
=
1
}),
minacc
=
{
x
=
0
,
y
=
-
8
,
z
=
0
},
maxacc
=
{
x
=
0
,
y
=
-
8
,
z
=
0
},
minexptime
=
0
.
25
,
maxexptime
=
1
})
end
end
nodecore
.
register_on_punchnode
(
"node punch sounds"
,
function
(
pos
,
node
,
puncher
)
if
not
nodecore
.
player_visible
(
puncher
)
then
return
end
...
...
@@ -25,8 +48,7 @@ nodecore.register_on_punchnode("node punch sounds", function(pos, node, puncher)
end
if
wield
:
get_wear
()
>=
(
65536
*
0
.
95
)
then
nodecore
.
sound_play
(
"nc_api_toolwear"
,
{
object
=
puncher
,
gain
=
0
.
5
})
wearfx
(
puncher
,
wield
)
end
end
)
...
...
mods/nc_api/item_txp_overlay.lua