Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xdecor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
xdecor
Commits
1dbcf701
Commit
1dbcf701
authored
8 years ago
by
kilbith
Browse files
Options
Downloads
Patches
Plain Diff
Painting: Use on_place for random placing
parent
28877e7b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mailbox.lua
+1
-1
1 addition, 1 deletion
mailbox.lua
nodes.lua
+17
-6
17 additions, 6 deletions
nodes.lua
with
18 additions
and
7 deletions
mailbox.lua
+
1
−
1
View file @
1dbcf701
...
...
@@ -94,7 +94,7 @@ function mailbox.put(pos, listname, _, stack, player)
if
inv
:
room_for_item
(
"mailbox"
,
stack
)
then
return
-
1
else
minetest
.
chat_send_player
(
player
:
get_player_name
(),
"
[!]
The mailbox is full"
)
minetest
.
chat_send_player
(
player
:
get_player_name
(),
"The mailbox is full"
)
end
end
return
0
...
...
This diff is collapsed.
Click to expand it.
nodes.lua
+
17
−
6
View file @
1dbcf701
...
...
@@ -54,7 +54,7 @@ xdecor.register("baricade", {
groups
=
{
choppy
=
2
,
oddly_breakable_by_hand
=
1
,
flammable
=
2
},
damage_per_second
=
4
,
selection_box
=
xdecor
.
nodebox
.
slab_y
(
0
.
3
),
collision_box
=
xdecor
.
pixelbox
(
2
,
{{
0
,
0
,
1
,
2
,
2
,
0
}})
collision_box
=
xdecor
.
pixelbox
(
2
,
{{
0
,
0
,
1
,
2
,
2
,
0
}})
})
xdecor
.
register
(
"barrel"
,
{
...
...
@@ -359,11 +359,22 @@ xdecor.register("painting_1", {
groups
=
{
choppy
=
3
,
oddly_breakable_by_hand
=
2
,
flammable
=
2
,
attached_node
=
1
},
sounds
=
default
.
node_sound_wood_defaults
(),
node_box
=
painting_box
,
on_construct
=
function
(
pos
)
local
node
=
minetest
.
get_node
(
pos
)
local
random
=
math.random
(
4
)
if
random
==
1
then
return
end
minetest
.
set_node
(
pos
,
{
name
=
"xdecor:painting_"
..
random
,
param2
=
node
.
param2
})
node_placement_prediction
=
""
,
on_place
=
function
(
itemstack
,
placer
,
pointed_thing
)
local
player_name
=
placer
:
get_player_name
()
local
pos
=
pointed_thing
.
above
if
not
minetest
.
is_protected
(
pos
,
player_name
)
then
local
num
=
math.random
(
4
)
local
dir
=
minetest
.
dir_to_wallmounted
(
placer
:
get_look_dir
())
minetest
.
set_node
(
pos
,
{
name
=
"xdecor:painting_"
..
num
,
param2
=
dir
})
else
minetest
.
chat_send_player
(
player_name
,
"This area is protected"
)
end
if
not
minetest
.
setting_getbool
(
"creative_mode"
)
then
itemstack
:
take_item
()
return
itemstack
end
end
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment