Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
minetest_game
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
minetest_game
Commits
3f2e35e8
Commit
3f2e35e8
authored
10 years ago
by
jp
Committed by
BlockMen
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add vessels shelf
parent
ccb4b925
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mods/vessels/init.lua
+81
-0
81 additions, 0 deletions
mods/vessels/init.lua
mods/vessels/textures/vessels_shelf.png
+0
-0
0 additions, 0 deletions
mods/vessels/textures/vessels_shelf.png
with
81 additions
and
0 deletions
mods/vessels/init.lua
+
81
−
0
View file @
3f2e35e8
-- Minetest 0.4 mod: vessels
-- See README.txt for licensing and other information.
local
vessels_shelf_formspec
=
"size[8,7;]"
..
default
.
gui_bg
..
default
.
gui_bg_img
..
default
.
gui_slots
..
"list[context;vessels;0,0.3;8,2;]"
..
"list[current_player;main;0,2.85;8,1;]"
..
"list[current_player;main;0,4.08;8,3;8]"
..
default
.
get_hotbar_bg
(
0
,
2
.
85
)
minetest
.
register_node
(
"vessels:shelf"
,
{
description
=
"Vessels shelf"
,
tiles
=
{
"default_wood.png"
,
"default_wood.png"
,
"default_wood.png^vessels_shelf.png"
},
is_ground_content
=
false
,
groups
=
{
choppy
=
3
,
oddly_breakable_by_hand
=
2
,
flammable
=
3
},
sounds
=
default
.
node_sound_wood_defaults
(),
on_construct
=
function
(
pos
)
local
meta
=
minetest
.
get_meta
(
pos
)
meta
:
set_string
(
"formspec"
,
vessels_shelf_formspec
)
local
inv
=
meta
:
get_inventory
()
inv
:
set_size
(
"vessels"
,
8
*
2
)
end
,
can_dig
=
function
(
pos
,
player
)
local
meta
=
minetest
.
get_meta
(
pos
);
local
inv
=
meta
:
get_inventory
()
return
inv
:
is_empty
(
"vessels"
)
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
==
"vessels"
then
if
minetest
.
get_item_group
(
stack
:
get_name
(),
"vessel"
)
~=
0
and
to_stack
:
is_empty
()
then
return
1
else
return
0
end
end
end
,
allow_metadata_inventory_move
=
function
(
pos
,
from_list
,
from_index
,
to_list
,
to_index
,
count
,
player
)
local
meta
=
minetest
.
get_meta
(
pos
)
local
inv
=
meta
:
get_inventory
()
local
stack
=
inv
:
get_stack
(
from_list
,
from_index
)
local
to_stack
=
inv
:
get_stack
(
to_list
,
to_index
)
if
to_list
==
"vessels"
then
if
minetest
.
get_item_group
(
stack
:
get_name
(),
"vessel"
)
~=
0
and
to_stack
:
is_empty
()
then
return
1
else
return
0
end
end
end
,
on_metadata_inventory_move
=
function
(
pos
,
from_list
,
from_index
,
to_list
,
to_index
,
count
,
player
)
minetest
.
log
(
"action"
,
player
:
get_player_name
()
..
" moves stuff in vessels shelf at "
..
minetest
.
pos_to_string
(
pos
))
end
,
on_metadata_inventory_put
=
function
(
pos
,
listname
,
index
,
stack
,
player
)
minetest
.
log
(
"action"
,
player
:
get_player_name
()
..
" moves stuff to vessels shelf at "
..
minetest
.
pos_to_string
(
pos
))
end
,
on_metadata_inventory_take
=
function
(
pos
,
listname
,
index
,
stack
,
player
)
minetest
.
log
(
"action"
,
player
:
get_player_name
()
..
" takes stuff from vessels shelf at "
..
minetest
.
pos_to_string
(
pos
))
end
,
})
minetest
.
register_craft
({
output
=
'vessels:shelf'
,
recipe
=
{
{
'group:wood'
,
'group:wood'
,
'group:wood'
},
{
'group:vessel'
,
'group:vessel'
,
'group:vessel'
},
{
'group:wood'
,
'group:wood'
,
'group:wood'
},
}
})
minetest
.
register_node
(
"vessels:glass_bottle"
,
{
description
=
"Glass Bottle (empty)"
,
drawtype
=
"plantlike"
,
...
...
This diff is collapsed.
Click to expand it.
mods/vessels/textures/vessels_shelf.png
0 → 100644
+
0
−
0
View file @
3f2e35e8
354 B
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