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
Snippets
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
Zadrog Pzvotrügen
minetest_game
Commits
c80473af
Commit
c80473af
authored
8 years ago
by
tenplus1
Committed by
Milan
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
merge upstream commit: TNT: When disabled leave some useful functionality enabled
parent
f6535a97
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mods/tnt/init.lua
+55
-17
55 additions, 17 deletions
mods/tnt/init.lua
with
55 additions
and
17 deletions
mods/tnt/init.lua
+
55
−
17
View file @
c80473af
tnt
=
{}
<<<<<<<
HEAD
core
.
register_privilege
(
"trusted_player"
,
"special grantings, used for tnt for example"
)
=======
-- Default to enabled when in singleplayer
local
enable_tnt
=
minetest
.
setting_getbool
(
"enable_tnt"
)
if
enable_tnt
==
nil
enable_tnt
=
minetest
.
is_singleplayer
()
end
>>>>>>>
497e6
f6
...
TNT
:
When
disabled
leave
some
useful
functionality
enabled
-- loss probabilities array (one in X will be lost)
local
loss_prob
=
{}
...
...
@@ -488,28 +496,30 @@ minetest.register_node("tnt:gunpowder_burning", {
end
,
})
minetest
.
register_abm
({
nodenames
=
{
"group:tnt"
,
"tnt:gunpowder"
},
neighbors
=
{
"fire:basic_flame"
,
"default:lava_source"
,
"default:lava_flowing"
},
interval
=
4
,
chance
=
1
,
action
=
tnt
.
burn
,
})
minetest
.
register_craft
({
output
=
"tnt:gunpowder"
,
type
=
"shapeless"
,
recipe
=
{
"default:coal_lump"
,
"default:gravel"
}
})
minetest
.
register_craft
({
output
=
"tnt:tnt"
,
recipe
=
{
{
""
,
"group:wood"
,
""
},
{
"group:wood"
,
"tnt:gunpowder"
,
"group:wood"
},
{
""
,
"group:wood"
,
""
}
}
})
if
enable_tnt
then
minetest
.
register_craft
({
output
=
"tnt:tnt"
,
recipe
=
{
{
""
,
"group:wood"
,
""
},
{
"group:wood"
,
"tnt:gunpowder"
,
"group:wood"
},
{
""
,
"group:wood"
,
""
}
}
})
minetest
.
register_abm
({
nodenames
=
{
"group:tnt"
,
"tnt:gunpowder"
},
neighbors
=
{
"fire:basic_flame"
,
"default:lava_source"
,
"default:lava_flowing"
},
interval
=
4
,
chance
=
1
,
action
=
tnt
.
burn
,
})
end
function
tnt
.
register_tnt
(
def
)
local
name
=
""
...
...
@@ -526,6 +536,7 @@ function tnt.register_tnt(def)
local
tnt_burning
=
def
.
tiles
.
burning
or
def
.
name
..
"_top_burning_animated.png"
if
not
def
.
damage_radius
then
def
.
damage_radius
=
def
.
radius
*
2
end
<<<<<<<
HEAD
minetest
.
register_node
(
":"
..
name
,
{
description
=
def
.
description
,
tiles
=
{
tnt_top
,
tnt_bottom
,
tnt_side
},
...
...
@@ -552,6 +563,34 @@ function tnt.register_tnt(def)
-- }
--},
})
=======
if
enable_tnt
then
minetest
.
register_node
(
":"
..
name
,
{
description
=
def
.
description
,
tiles
=
{
tnt_top
,
tnt_bottom
,
tnt_side
},
is_ground_content
=
false
,
groups
=
{
dig_immediate
=
2
,
mesecon
=
2
,
tnt
=
1
},
sounds
=
default
.
node_sound_wood_defaults
(),
on_punch
=
function
(
pos
,
node
,
puncher
)
if
puncher
:
get_wielded_item
():
get_name
()
==
"default:torch"
then
minetest
.
set_node
(
pos
,
{
name
=
name
..
"_burning"
})
end
end
,
on_blast
=
function
(
pos
,
intensity
)
minetest
.
after
(
0
.
1
,
function
()
tnt
.
boom
(
pos
,
def
)
end
)
end
,
mesecons
=
{
effector
=
{
action_on
=
function
(
pos
)
tnt
.
boom
(
pos
,
def
)
end
}
},
})
end
>>>>>>>
497e6
f6
...
TNT
:
When
disabled
leave
some
useful
functionality
enabled
minetest
.
register_node
(
":"
..
name
..
"_burning"
,
{
tiles
=
{
...
...
@@ -588,4 +627,3 @@ tnt.register_tnt({
description
=
"TNT"
,
radius
=
radius
,
})
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