Hendrik Langer
5 years ago
2 changed files with 49 additions and 0 deletions
@ -0,0 +1,46 @@ |
|||||
|
-- creative_hand/init.lua |
||||
|
|
||||
|
-- Load support for MT game translation. |
||||
|
local S = minetest.get_translator("creative") |
||||
|
|
||||
|
creative = {} |
||||
|
creative.get_translator = S |
||||
|
|
||||
|
local creative_mode_cache = minetest.settings:get_bool("creative_mode") |
||||
|
|
||||
|
function creative.is_enabled_for(name) |
||||
|
return creative_mode_cache or |
||||
|
minetest.check_player_privs(name, {creative = true}) |
||||
|
end |
||||
|
|
||||
|
-- Dig time is modified according to difference (leveldiff) between tool |
||||
|
-- 'maxlevel' and node 'level'. Digtime is divided by the larger of |
||||
|
-- leveldiff and 1. |
||||
|
-- To speed up digging in creative, hand 'maxlevel' and 'digtime' have been |
||||
|
-- increased such that nodes of differing levels have an insignificant |
||||
|
-- effect on digtime. |
||||
|
local digtime = 42 |
||||
|
local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 256} |
||||
|
|
||||
|
-- Override the hand tool |
||||
|
minetest.override_item("", { |
||||
|
range = 6, |
||||
|
tool_capabilities = { |
||||
|
full_punch_interval = 0.7, |
||||
|
max_drop_level = 0, |
||||
|
groupcaps = { |
||||
|
crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1}, |
||||
|
snappy = {times={[3]=0.40}, uses=0, maxlevel=1}, |
||||
|
oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0}, |
||||
|
-- crumbly = caps, |
||||
|
-- cracky = caps, |
||||
|
-- snappy = caps, |
||||
|
-- choppy = caps, |
||||
|
-- oddly_breakable_by_hand = caps, |
||||
|
-- -- dig_immediate group doesn't use value 1. Value 3 is instant dig |
||||
|
-- dig_immediate = |
||||
|
-- {times = {[2] = digtime, [3] = 0}, uses = 0, maxlevel = 256}, |
||||
|
}, |
||||
|
damage_groups = {fleshy = 1}, |
||||
|
} |
||||
|
}) |
@ -0,0 +1,3 @@ |
|||||
|
name = creative_hands |
||||
|
description = Makes hand and tools stronger |
||||
|
depends = default, sfinv |
Loading…
Reference in new issue