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
05fad37b
Unverified
Commit
05fad37b
authored
4 years ago
by
An0n3m0us
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Sort items into correct categories (#2612)
parent
8863527b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
game_api.txt
+7
-0
7 additions, 0 deletions
game_api.txt
mods/creative/inventory.lua
+22
-3
22 additions, 3 deletions
mods/creative/inventory.lua
mods/doors/init.lua
+4
-4
4 additions, 4 deletions
mods/doors/init.lua
mods/xpanes/init.lua
+2
-2
2 additions, 2 deletions
mods/xpanes/init.lua
with
35 additions
and
9 deletions
game_api.txt
+
7
−
0
View file @
05fad37b
...
...
@@ -103,6 +103,13 @@ The contents of `creative.formspec_add` is appended to every creative inventory
page. Mods can use it to add additional formspec elements onto the default
creative inventory formspec to be drawn after each update.
Group overrides can be used for any registered item, node or tool. Use one of
the groups stated below to pick which category it will appear in.
node = 1 -- Appears in the Nodes category
tool = 1 -- Appears in the Tools category
craftitem = 1 -- Appears in the Items category
Chests API
----------
...
...
This diff is collapsed.
Click to expand it.
mods/creative/inventory.lua
+
22
−
3
View file @
05fad37b
...
...
@@ -199,10 +199,29 @@ function creative.register_tab(name, title, items)
})
end
-- Sort registered items
local
registered_nodes
=
{}
local
registered_tools
=
{}
local
registered_craftitems
=
{}
minetest
.
register_on_mods_loaded
(
function
()
for
name
,
def
in
pairs
(
minetest
.
registered_items
)
do
local
group
=
def
.
groups
or
{}
if
group
.
node
or
minetest
.
registered_nodes
[
name
]
then
registered_nodes
[
name
]
=
def
elseif
group
.
tool
or
minetest
.
registered_tools
[
name
]
then
registered_tools
[
name
]
=
def
elseif
group
.
craftitem
or
minetest
.
registered_craftitems
[
name
]
then
registered_craftitems
[
name
]
=
def
end
end
end
)
creative
.
register_tab
(
"all"
,
S
(
"All"
),
minetest
.
registered_items
)
creative
.
register_tab
(
"nodes"
,
S
(
"Nodes"
),
minetest
.
registered_nodes
)
creative
.
register_tab
(
"tools"
,
S
(
"Tools"
),
minetest
.
registered_tools
)
creative
.
register_tab
(
"craftitems"
,
S
(
"Items"
),
minetest
.
registered_craftitems
)
creative
.
register_tab
(
"nodes"
,
S
(
"Nodes"
),
registered_nodes
)
creative
.
register_tab
(
"tools"
,
S
(
"Tools"
),
registered_tools
)
creative
.
register_tab
(
"craftitems"
,
S
(
"Items"
),
registered_craftitems
)
local
old_homepage_name
=
sfinv
.
get_homepage_name
function
sfinv
.
get_homepage_name
(
player
)
...
...
This diff is collapsed.
Click to expand it.
mods/doors/init.lua
+
4
−
4
View file @
05fad37b
...
...
@@ -457,7 +457,7 @@ doors.register("door_wood", {
tiles
=
{{
name
=
"doors_door_wood.png"
,
backface_culling
=
true
}},
description
=
S
(
"Wooden Door"
),
inventory_image
=
"doors_item_wood.png"
,
groups
=
{
choppy
=
2
,
oddly_breakable_by_hand
=
2
,
flammable
=
2
},
groups
=
{
node
=
1
,
choppy
=
2
,
oddly_breakable_by_hand
=
2
,
flammable
=
2
},
recipe
=
{
{
"group:wood"
,
"group:wood"
},
{
"group:wood"
,
"group:wood"
},
...
...
@@ -470,7 +470,7 @@ doors.register("door_steel", {
description
=
S
(
"Steel Door"
),
inventory_image
=
"doors_item_steel.png"
,
protected
=
true
,
groups
=
{
cracky
=
1
,
level
=
2
},
groups
=
{
node
=
1
,
cracky
=
1
,
level
=
2
},
sounds
=
default
.
node_sound_metal_defaults
(),
sound_open
=
"doors_steel_door_open"
,
sound_close
=
"doors_steel_door_close"
,
...
...
@@ -485,7 +485,7 @@ doors.register("door_glass", {
tiles
=
{
"doors_door_glass.png"
},
description
=
S
(
"Glass Door"
),
inventory_image
=
"doors_item_glass.png"
,
groups
=
{
cracky
=
3
,
oddly_breakable_by_hand
=
3
},
groups
=
{
node
=
1
,
cracky
=
3
,
oddly_breakable_by_hand
=
3
},
sounds
=
default
.
node_sound_glass_defaults
(),
sound_open
=
"doors_glass_door_open"
,
sound_close
=
"doors_glass_door_close"
,
...
...
@@ -500,7 +500,7 @@ doors.register("door_obsidian_glass", {
tiles
=
{
"doors_door_obsidian_glass.png"
},
description
=
S
(
"Obsidian Glass Door"
),
inventory_image
=
"doors_item_obsidian_glass.png"
,
groups
=
{
cracky
=
3
},
groups
=
{
node
=
1
,
cracky
=
3
},
sounds
=
default
.
node_sound_glass_defaults
(),
sound_open
=
"doors_glass_door_open"
,
sound_close
=
"doors_glass_door_close"
,
...
...
This diff is collapsed.
Click to expand it.
mods/xpanes/init.lua
+
2
−
2
View file @
05fad37b
...
...
@@ -223,7 +223,7 @@ if minetest.get_modpath("doors") then
description
=
S
(
"Steel Bar Door"
),
inventory_image
=
"xpanes_item_steel_bar.png"
,
protected
=
true
,
groups
=
{
cracky
=
1
,
level
=
2
},
groups
=
{
node
=
1
,
cracky
=
1
,
level
=
2
},
sounds
=
default
.
node_sound_metal_defaults
(),
sound_open
=
"xpanes_steel_bar_door_open"
,
sound_close
=
"xpanes_steel_bar_door_close"
,
...
...
@@ -241,7 +241,7 @@ if minetest.get_modpath("doors") then
tile_front
=
"xpanes_trapdoor_steel_bar.png"
,
tile_side
=
"xpanes_trapdoor_steel_bar_side.png"
,
protected
=
true
,
groups
=
{
cracky
=
1
,
level
=
2
,
door
=
1
},
groups
=
{
node
=
1
,
cracky
=
1
,
level
=
2
,
door
=
1
},
sounds
=
default
.
node_sound_metal_defaults
(),
sound_open
=
"xpanes_steel_bar_door_open"
,
sound_close
=
"xpanes_steel_bar_door_close"
,
...
...
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