Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
illuna
Compare revisions
46e0138f853e107d79889244443453c7a8dc7057 to 9b6e44b7adc7925e12c1d07bd246383a546dffdb
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
Illuna-Minetest/illuna
Select target project
No results found
9b6e44b7adc7925e12c1d07bd246383a546dffdb
Select Git revision
Branches
master
Swap
Target
Illuna-Minetest/illuna
Select target project
Illuna-Minetest/illuna
1 result
46e0138f853e107d79889244443453c7a8dc7057
Select Git revision
Branches
master
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
add admin replacer tool
· 9b6e44b7
Milan
authored
7 years ago
9b6e44b7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
replacer.lua
+53
-0
53 additions, 0 deletions
replacer.lua
textures/replacer_replacer_admin.png
+0
-0
0 additions, 0 deletions
textures/replacer_replacer_admin.png
with
53 additions
and
0 deletions
replacer.lua
0 → 100644
View file @
9b6e44b7
-- Admin replacer extension for Sokomine's replacer mod
-- range was added and texture updated.
-- Everything else below is code by Sokomine.
minetest
.
register_tool
(
":replacer:replacer_admin"
,
{
description
=
"Admin node replacement tool"
,
groups
=
{},
inventory_image
=
"replacer_replacer_admin.png"
,
wield_image
=
""
,
wield_scale
=
{
x
=
1
,
y
=
1
,
z
=
1
},
stack_max
=
1
,
-- it has to store information - thus only one can be stacked
liquids_pointable
=
true
,
-- it is ok to painit in/with water
node_placement_prediction
=
nil
,
metadata
=
"default:dirt"
,
-- default replacement: common dirt
range
=
12
,
on_place
=
function
(
itemstack
,
placer
,
pointed_thing
)
if
(
placer
==
nil
or
pointed_thing
==
nil
)
then
return
itemstack
;
-- nothing consumed
end
local
name
=
placer
:
get_player_name
();
local
keys
=
placer
:
get_player_control
();
if
(
not
(
keys
[
"sneak"
]
))
then
return
replacer
.
replace
(
itemstack
,
placer
,
pointed_thing
,
0
);
end
if
(
pointed_thing
.
type
~=
"node"
)
then
minetest
.
chat_send_player
(
name
,
" Error: No node selected."
);
return
nil
;
end
local
pos
=
minetest
.
get_pointed_thing_position
(
pointed_thing
,
under
);
local
node
=
minetest
.
env
:
get_node_or_nil
(
pos
);
local
metadata
=
"default:dirt 0 0"
;
if
(
node
~=
nil
and
node
.
name
)
then
metadata
=
node
.
name
..
' '
..
node
.
param1
..
' '
..
node
.
param2
;
end
itemstack
:
set_metadata
(
metadata
);
minetest
.
chat_send_player
(
name
,
"Node replacement tool set to: '"
..
metadata
..
"'."
);
return
itemstack
;
-- nothing consumed but data changed
end
,
on_use
=
function
(
itemstack
,
user
,
pointed_thing
)
return
replacer
.
replace
(
itemstack
,
user
,
pointed_thing
,
above
);
end
,
})
This diff is collapsed.
Click to expand it.
textures/replacer_replacer_admin.png
0 → 100644
View file @
9b6e44b7
461 B
This diff is collapsed.
Click to expand it.