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
e9e25590
Commit
e9e25590
authored
9 years ago
by
jp
Browse files
Options
Downloads
Patches
Plain Diff
Prevent placing items in some slots and rename itemframe file
parent
89b1db07
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
hive.lua
+9
-1
9 additions, 1 deletion
hive.lua
init.lua
+1
-1
1 addition, 1 deletion
init.lua
itemframe.lua
+0
-0
0 additions, 0 deletions
itemframe.lua
worktable.lua
+15
-3
15 additions, 3 deletions
worktable.lua
with
25 additions
and
5 deletions
hive.lua
+
9
−
1
View file @
e9e25590
...
...
@@ -15,6 +15,7 @@ end
local
function
hive_dig
(
pos
,
player
)
local
meta
=
minetest
.
get_meta
(
pos
)
local
inv
=
meta
:
get_inventory
()
if
not
inv
:
is_empty
(
"honey"
)
then
return
false
end
...
...
@@ -37,7 +38,14 @@ xdecor.register("hive", {
on_punch
=
function
(
pos
,
node
,
puncher
,
pointed_thing
)
local
health
=
puncher
:
get_hp
()
puncher
:
set_hp
(
health
-
4
)
end
end
,
allow_metadata_inventory_put
=
function
(
pos
,
listname
,
index
,
stack
,
player
)
local
meta
=
minetest
.
get_meta
(
pos
)
local
inv
=
meta
:
get_inventory
()
local
to_stack
=
inv
:
get_stack
(
listname
,
index
)
if
listname
==
"honey"
then
return
0
end
end
,
})
minetest
.
register_abm
({
...
...
This diff is collapsed.
Click to expand it.
init.lua
+
1
−
1
View file @
e9e25590
...
...
@@ -5,7 +5,7 @@ dofile(modpath.."/handlers/nodeboxes.lua")
dofile
(
modpath
..
"/handlers/registration.lua"
)
dofile
(
modpath
..
"/crafts.lua"
)
dofile
(
modpath
..
"/hive.lua"
)
dofile
(
modpath
..
"/itemframe
s
.lua"
)
dofile
(
modpath
..
"/itemframe.lua"
)
dofile
(
modpath
..
"/mailbox.lua"
)
dofile
(
modpath
..
"/rope.lua"
)
dofile
(
modpath
..
"/nodes.lua"
)
...
...
This diff is collapsed.
Click to expand it.
itemframe
s
.lua
→
itemframe.lua
+
0
−
0
View file @
e9e25590
File moved
This diff is collapsed.
Click to expand it.
worktable.lua
+
15
−
3
View file @
e9e25590
...
...
@@ -99,13 +99,24 @@ local function xdig(pos, player)
local
inv
=
meta
:
get_inventory
()
if
not
inv
:
is_empty
(
"input"
)
or
not
inv
:
is_empty
(
"output"
)
or
not
inv
:
is_empty
(
"fuel"
)
or
not
inv
:
is_empty
(
"src"
)
then
or
not
inv
:
is_empty
(
"fuel"
)
or
not
inv
:
is_empty
(
"src"
)
then
return
false
end
return
true
end
local
function
xput
(
pos
,
listname
,
index
,
stack
,
player
)
local
meta
=
minetest
.
get_meta
(
pos
)
local
inv
=
meta
:
get_inventory
()
local
to_stack
=
inv
:
get_stack
(
listname
,
index
)
if
listname
==
"output"
then
return
0
else
return
99
end
end
xdecor
.
register
(
"worktable"
,
{
description
=
"Work Table"
,
groups
=
{
snappy
=
3
},
...
...
@@ -117,7 +128,8 @@ xdecor.register("worktable", {
},
on_construct
=
xconstruct
,
on_receive_fields
=
xfields
,
can_dig
=
xdig
can_dig
=
xdig
,
allow_metadata_inventory_put
=
xput
})
local
function
light
(
mat
)
...
...
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