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
0bba88c7
Commit
0bba88c7
authored
8 years ago
by
Tim
Browse files
Options
Downloads
Patches
Plain Diff
Fix paintings to not destroy unprotected items.
parent
4c06f81a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nodes.lua
+3
-11
3 additions, 11 deletions
nodes.lua
with
3 additions
and
11 deletions
nodes.lua
+
3
−
11
View file @
0bba88c7
...
...
@@ -364,17 +364,9 @@ xdecor.register("painting_1", {
node_box
=
painting_box
,
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
local
num
=
math.random
(
4
)
local
leftover
=
minetest
.
item_place_node
(
ItemStack
(
"xdecor:painting_"
..
num
),
placer
,
pointed_thing
)
if
leftover
:
get_count
()
==
0
and
not
minetest
.
setting_getbool
(
"creative_mode"
)
then
itemstack
:
take_item
()
end
return
itemstack
...
...
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