Add hammer

This commit is contained in:
Juraj Vajda 2023-12-28 11:14:20 -05:00
parent 899bc668df
commit 199f333ced
8 changed files with 872 additions and 4 deletions

285
api.lua
View File

@ -218,6 +218,7 @@ Everness = {
everness_feature_skybox = minetest.settings:get_bool('everness_feature_skybox', true), everness_feature_skybox = minetest.settings:get_bool('everness_feature_skybox', true),
} }
}, },
hammer_cid_data = {}
} }
function Everness.grow_cactus(self, pos, node, params) function Everness.grow_cactus(self, pos, node, params)
@ -1003,3 +1004,287 @@ function Everness.set_loot_chest_items()
Everness.loot_chest.default = table.copy(loot_items) Everness.loot_chest.default = table.copy(loot_items)
end end
--
-- Hammer
-- Modified version of default:tnt from MT
-- @license MIT
local function rand_pos(center, pos, radius)
local def
local reg_nodes = minetest.registered_nodes
local i = 0
repeat
-- Give up and use the center if this takes too long
if i > 4 then
pos.x, pos.z = center.x, center.z
break
end
pos.x = center.x + math.random(-radius, radius)
pos.z = center.z + math.random(-radius, radius)
def = reg_nodes[minetest.get_node(pos).name]
i = i + 1
until def and not def.walkable
end
local function eject_drops(drops, pos, radius)
local drop_pos = vector.new(pos)
for _, item in pairs(drops) do
local count = math.min(item:get_count(), item:get_stack_max())
while count > 0 do
local take = math.max(
1,
math.min(
radius * radius,
count,
item:get_stack_max()
)
)
-- `drop_pos` is being randomized here
rand_pos(pos, drop_pos, radius)
local dropitem = ItemStack(item)
dropitem:set_count(take)
local obj = minetest.add_item(drop_pos, dropitem)
if obj then
obj:get_luaentity().collect = true
obj:set_acceleration({ x = 0, y = -10, z = 0 })
obj:set_velocity({
x = math.random(-2, 2),
y = math.random(0, 2),
z = math.random(-2, 2)
})
end
count = count - take
end
end
end
-- Populate `drops` table
local function add_drop(drops, item)
item = ItemStack(item)
local name = item:get_name()
local drop = drops[name]
if drop == nil then
drops[name] = item
else
drop:set_count(drop:get_count() + item:get_count())
end
end
local function destroy(drops, npos, cid, c_air, can_dig, owner)
if minetest.is_protected(npos, owner) then
return cid
end
local def = Everness.hammer_cid_data[cid]
if not def then
return cid
elseif def.can_dig and not def.can_dig(npos, minetest.get_player_by_name(owner)) then
return cid
else
local node_drops = minetest.get_node_drops(def.name, '')
for _, item in pairs(node_drops) do
add_drop(drops, item)
end
return c_air
end
end
function Everness.hammer_after_dig_node(pos, node, metadata, digger, can_dig)
if not digger then
return
end
local wielditem = digger:get_wielded_item()
if wielditem:get_name() ~= 'everness:hammer' then
return
end
local radius = 1
local look_dir = vector.round(digger:get_look_dir())
local look_dir_multi = vector.round(vector.multiply(look_dir, radius / 2))
pos = vector.round(vector.add(pos, look_dir_multi))
local c_air = minetest.CONTENT_AIR
local c_ignore = minetest.CONTENT_IGNORE
local vm = VoxelManip()
local pr = PseudoRandom(os.time())
local p1 = vector.subtract(pos, radius)
local p2 = vector.add(pos, radius)
local minp, maxp = vm:read_from_map(p1, p2)
local voxel_area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
-- `drops` are being populated in `add_drop` method, called from `destroy` method
local drops = {}
local p_name = digger:get_player_name()
if not core.is_creative_enabled(p_name) then
local wielditem_meta = wielditem:get_meta()
local wielditem_wear = wielditem_meta:get_int('everness_wear')
local node_def = minetest.registered_nodes[node.name]
local wielditem_def = wielditem:get_definition()
local dig_params = minetest.get_dig_params(node_def and node_def.groups, wielditem_def and wielditem_def.tool_capabilities, wielditem:get_wear())
local new_wear = wielditem_wear + dig_params.wear
-- Add wear
wielditem_meta:set_int('everness_wear', new_wear)
-- Draw wear bar texture overlay
local px_width = 14
local px_one = 65535 / px_width
local px_color = px_width - math.floor(new_wear / px_one)
local inventory_overlay = '[combine:16x16'
for i = 1, px_width do
if i > px_color then
inventory_overlay = inventory_overlay .. ':' .. i .. ',14=[combine\\:1x1\\^[noalpha\\^[colorize\\:#000000\\:255'
else
local color
if px_color < px_width / 4 then
-- below 25%
color = '#FF0000'
elseif px_color < (px_width / 4) * 2 then
-- below 50%
color = '#FFA500'
elseif px_color < (px_width / 4) * 3 then
-- below 75%
color = '#FFFF00'
else
-- above 75%
color = '#00FF00'
end
inventory_overlay = inventory_overlay .. ':' .. i .. ',14=[combine\\:1x1\\^[noalpha\\^[colorize\\:' .. color .. '\\:255'
end
end
wielditem_meta:set_string('inventory_overlay', inventory_overlay)
if wielditem_wear > 65535 then
-- Break tool
minetest.sound_play(wielditem_def.sound.breaks, {
pos = pos,
gain = 0.5
}, true)
digger:set_wielded_item(ItemStack(''))
elseif wielditem:get_name() == 'everness:hammer' then
-- Save wear
digger:set_wielded_item(wielditem)
end
end
-- Digging blast
for z = -radius, radius do
for y = -radius, radius do
local vi = voxel_area:index(pos.x + (-radius), pos.y + y, pos.z + z)
for x = -radius, radius do
local r = vector.length(vector.new(x, y, z))
if (radius * radius) / (r * r) >= (pr:next(30, 60) / 100) then
local cid = data[vi]
local p = vector.new(pos.x + x, pos.y + y, pos.z + z)
if cid ~= c_air and cid ~= c_ignore then
data[vi] = destroy(drops, p, cid, c_air, can_dig, p_name)
end
end
vi = vi + 1
end
end
end
vm:set_data(data)
vm:write_to_map()
vm:update_map()
vm:update_liquids()
-- Call `check_single_for_falling` for everything within 1.5x blast radius
for y = math.round(-radius * 1.5), math.round(radius * 1.5) do
for z = math.round(-radius * 1.5), math.round(radius * 1.5) do
for x = math.round(-radius * 1.5), math.round(radius * 1.5) do
local rad = vector.new(x, y, z)
local s = vector.add(pos, rad)
minetest.check_single_for_falling(s)
end
end
end
eject_drops(drops, pos, radius)
-- Get texture for particles from majority of the dug nodes
local node_for_particles
local most = 0
for name, stack in pairs(drops) do
local count = stack:get_count()
if count > most then
most = count
local def = minetest.registered_nodes[name]
if def then
node_for_particles = { name = name }
end
-- Play sounds
if def and def.sounds and def.sounds.dug then
for i = 1, math.random(2, 5) do
local drop_pos = vector.new(pos)
-- `drop_pos` is being randomized here
rand_pos(pos, drop_pos, radius)
minetest.after(
math.random(2, 8) / 10,
function()
minetest.sound_play(def.sounds.dug, {
pos = drop_pos,
pitch = math.random(1, 10) / 10
}, true)
end
)
end
end
end
end
if node_for_particles then
minetest.add_particlespawner({
amount = 64,
time = 0.1,
minpos = vector.subtract(pos, radius / 2),
maxpos = vector.add(pos, radius / 2),
minvel = {x = -2, y = 0, z = -2},
maxvel = {x = 2, y = 5, z = 2},
minacc = {x = 0, y = -10, z = 0},
maxacc = {x = 0, y = -10, z = 0},
minexptime = 0.8,
maxexptime = 2.0,
minsize = radius * 0.33,
maxsize = radius,
node = node_for_particles,
collisiondetection = true,
})
end
end

Binary file not shown.

View File

@ -703,6 +703,15 @@ minetest.register_craft({
} }
}) })
minetest.register_craft({
output = 'everness:hammer',
recipe = {
{ 'group:everness_obsidian', 'group:everness_obsidian', 'group:everness_obsidian' },
{ 'group:everness_obsidian', 'everness:pyriteblock_forged', 'group:everness_obsidian' },
{ '', 'group:stick', '' }
}
})
-- --
-- Fuels -- Fuels
-- --

View File

@ -0,0 +1,478 @@
# Blender v2.83.20 OBJ File: 'everness_hammer_pick.blend'
# www.blender.org
mtllib everness_hammer_pick.mtl
o hammer_head.vox
v 0.117043 0.562218 -0.240000
v 0.117043 0.562218 0.240000
v -0.222369 0.901630 -0.240000
v -0.561780 -0.116604 -0.240000
v -0.901191 0.222807 0.240000
v -0.561780 -0.116604 0.240000
v -0.222369 0.901630 0.240000
v -0.901191 0.222807 -0.240000
v 0.097391 -0.177433 0.040000
v -0.142609 -0.017433 -0.040000
v -0.222609 0.062567 0.040000
v -0.222609 0.062567 -0.040000
v -0.142609 0.062567 -0.040000
v -0.382609 0.222567 -0.040000
v 0.577391 -0.337433 -0.040000
v 0.417391 -0.337433 -0.040000
v 0.417391 -0.337433 0.040000
v 0.417391 -0.257433 -0.040000
v 0.337391 -0.257433 0.040000
v 0.337391 -0.177433 0.040000
v 0.337391 -0.177433 -0.040000
v 0.257391 -0.177433 0.040000
v 0.257391 -0.097433 0.040000
v 0.177391 -0.017433 -0.040000
v 0.017391 0.062567 -0.040000
v -0.062609 0.222567 0.040000
v -0.142609 0.302567 -0.040000
v -0.222609 0.302567 0.040000
v -0.222609 0.382567 0.040000
v 0.577391 -0.577433 0.040000
v 0.417391 -0.257433 0.040000
v 0.257391 -0.417433 0.040000
v 0.257391 -0.337433 0.040000
v 0.177391 -0.257433 0.040000
v 0.177391 -0.337433 0.040000
v 0.097391 -0.257433 0.040000
v 0.177391 -0.097433 0.040000
v 0.097391 -0.017433 0.040000
v 0.017391 0.062567 0.040000
v -0.062609 -0.017433 0.040000
v -0.062609 0.142567 0.040000
v -0.142609 -0.017433 0.040000
v -0.142609 0.062567 0.040000
v -0.142609 0.222567 0.040000
v -0.222609 0.142567 0.040000
v -0.142609 0.302567 0.040000
v -0.302609 0.302567 0.040000
v -0.302609 0.222567 0.040000
v -0.382609 0.222567 0.040000
v 0.257391 -0.337433 -0.040000
v 0.257391 -0.177433 -0.040000
v 0.257391 -0.097433 -0.040000
v 0.177391 -0.257433 -0.040000
v 0.097391 -0.257433 -0.040000
v 0.097391 -0.177433 -0.040000
v 0.017391 -0.177433 -0.040000
v 0.017391 -0.097433 -0.040000
v 0.097391 -0.017433 -0.040000
v -0.062609 -0.017433 -0.040000
v 0.017391 0.142567 -0.040000
v -0.062609 0.222567 -0.040000
v -0.222609 0.142567 -0.040000
v -0.302609 0.222567 -0.040000
v -0.302609 0.302567 -0.040000
v -0.222609 0.302567 -0.040000
v -0.222609 0.382567 -0.040000
v 0.577391 -0.577433 -0.040000
v 0.577391 -0.337433 0.040000
v 0.337391 -0.257433 -0.040000
v 0.177391 -0.097433 -0.040000
v 0.177391 -0.017433 0.040000
v 0.097391 0.062567 -0.040000
v 0.097391 0.062567 0.040000
v 0.017391 0.142567 0.040000
v -0.062609 0.142567 -0.040000
v -0.142609 0.222567 -0.040000
v 0.337391 -0.577433 0.040000
v 0.337391 -0.577433 -0.040000
v 0.337391 -0.417433 0.040000
v 0.337391 -0.417433 -0.040000
v 0.257391 -0.417433 -0.040000
v 0.177391 -0.337433 -0.040000
v 0.017391 -0.177433 0.040000
v 0.017391 -0.097433 0.040000
v -0.062609 -0.097433 0.040000
v -0.062609 -0.097433 -0.040000
v -0.302609 0.142567 0.040000
v -0.302609 0.142567 -0.040000
v -0.302609 0.382567 0.040000
v -0.302609 0.382567 -0.040000
v -0.382609 0.302567 0.040000
v -0.382609 0.302567 -0.040000
vt 0.375000 1.000000
vt 0.000000 0.812500
vt 0.000000 1.000000
vt 0.375000 0.812500
vt 0.562500 1.000000
vt 0.375000 1.000000
vt 0.750000 0.812500
vt 0.562500 1.000000
vt 0.750000 1.000000
vt 0.000000 0.250000
vt 0.375000 0.437500
vt 0.375000 0.250000
vt 0.000000 0.812500
vt 0.375000 0.625000
vt 0.375000 0.812500
vt 0.375000 0.625000
vt 0.000000 0.437500
vt 0.375000 0.437500
vt 0.375000 0.718750
vt 0.406250 0.812500
vt 0.375000 0.812500
vt 0.375000 0.625000
vt 0.406250 0.656250
vt 0.375000 0.656250
vt 0.375000 0.531250
vt 0.406250 0.593750
vt 0.375000 0.593750
vt 0.375000 0.468750
vt 0.406250 0.500000
vt 0.375000 0.500000
vt 0.375000 0.406250
vt 0.406250 0.437500
vt 0.375000 0.437500
vt 0.375000 0.343750
vt 0.406250 0.375000
vt 0.375000 0.375000
vt 0.375000 0.281250
vt 0.406250 0.312500
vt 0.375000 0.312500
vt 0.375000 0.218750
vt 0.406250 0.250000
vt 0.375000 0.250000
vt 0.375000 0.156250
vt 0.406250 0.187500
vt 0.375000 0.187500
vt 0.375000 0.093750
vt 0.406250 0.125000
vt 0.375000 0.125000
vt 0.406250 0.625000
vt 0.437500 0.593750
vt 0.437500 0.625000
vt 0.406250 0.531250
vt 0.437500 0.500000
vt 0.437500 0.531250
vt 0.406250 0.468750
vt 0.437500 0.437500
vt 0.437500 0.468750
vt 0.406250 0.406250
vt 0.437500 0.375000
vt 0.437500 0.406250
vt 0.406250 0.343750
vt 0.437500 0.312500
vt 0.437500 0.343750
vt 0.406250 0.281250
vt 0.437500 0.250000
vt 0.437500 0.281250
vt 0.406250 0.218750
vt 0.437500 0.187500
vt 0.437500 0.218750
vt 0.406250 0.156250
vt 0.437500 0.125000
vt 0.437500 0.156250
vt 0.406250 0.093750
vt 0.437500 0.062500
vt 0.437500 0.093750
vt 0.406250 0.031250
vt 0.375000 0.062500
vt 0.375000 0.031250
vt 0.718750 0.687500
vt 0.750000 0.718750
vt 0.718750 0.750000
vt 0.593750 0.562500
vt 0.562500 0.531250
vt 0.531250 0.562500
vt 0.406250 0.656250
vt 0.437500 0.718750
vt 0.406250 0.718750
vt 0.437500 0.812500
vt 0.437500 0.656250
vt 0.406250 0.593750
vt 0.406250 0.500000
vt 0.406250 0.437500
vt 0.406250 0.375000
vt 0.406250 0.312500
vt 0.406250 0.250000
vt 0.406250 0.187500
vt 0.406250 0.125000
vt 0.406250 0.625000
vt 0.406250 0.531250
vt 0.406250 0.468750
vt 0.406250 0.406250
vt 0.406250 0.343750
vt 0.406250 0.281250
vt 0.406250 0.218750
vt 0.406250 0.156250
vt 0.437500 0.031250
vt 0.406250 0.093750
vt 0.375000 0.812500
vt 0.562500 0.812500
vt 0.562500 0.812500
vt 0.000000 0.437500
vt 0.000000 0.625000
vt 0.000000 0.625000
vt 0.406250 0.718750
vt 0.406250 0.062500
vt 0.406250 0.062500
vt 0.531250 0.562500
vt 0.500000 0.562500
vt 0.500000 0.531250
vt 0.437500 0.531250
vt 0.437500 0.437500
vt 0.531250 0.437500
vt 0.531250 0.500000
vt 0.562500 0.500000
vt 0.562500 0.531250
vt 0.593750 0.531250
vt 0.593750 0.562500
vt 0.625000 0.562500
vt 0.625000 0.593750
vt 0.656250 0.593750
vt 0.656250 0.625000
vt 0.687500 0.625000
vt 0.687500 0.656250
vt 0.718750 0.656250
vt 0.750000 0.687500
vt 0.781250 0.718750
vt 0.781250 0.750000
vt 0.812500 0.750000
vt 0.812500 0.781250
vt 0.781250 0.781250
vt 0.781250 0.812500
vt 0.750000 0.781250
vt 0.750000 0.812500
vt 0.718750 0.781250
vt 0.687500 0.750000
vt 0.687500 0.718750
vt 0.656250 0.718750
vt 0.656250 0.687500
vt 0.625000 0.687500
vt 0.625000 0.656250
vt 0.593750 0.656250
vt 0.593750 0.625000
vt 0.562500 0.625000
vt 0.562500 0.593750
vt 0.531250 0.593750
vt 0.625000 0.656250
vt 0.625000 0.687500
vt 0.656250 0.687500
vt 0.656250 0.718750
vt 0.687500 0.718750
vt 0.687500 0.750000
vt 0.718750 0.750000
vt 0.718750 0.781250
vt 0.750000 0.781250
vt 0.750000 0.812500
vt 0.781250 0.812500
vt 0.781250 0.781250
vt 0.812500 0.781250
vt 0.812500 0.750000
vt 0.750000 0.718750
vt 0.687500 0.656250
vt 0.718750 0.687500
vt 0.593750 0.625000
vt 0.593750 0.656250
vt 0.562500 0.593750
vt 0.562500 0.625000
vt 0.531250 0.593750
vt 0.500000 0.531250
vt 0.500000 0.562500
vt 0.437500 0.437500
vt 0.437500 0.531250
vt 0.531250 0.500000
vt 0.531250 0.437500
vt 0.562500 0.500000
vt 0.593750 0.531250
vt 0.625000 0.593750
vt 0.625000 0.562500
vt 0.656250 0.625000
vt 0.656250 0.593750
vt 0.687500 0.625000
vt 0.718750 0.656250
vt 0.750000 0.687500
vt 0.781250 0.750000
vt 0.781250 0.718750
vn 0.0000 0.0000 1.0000
vn 0.7071 0.7071 0.0000
vn -0.7071 -0.7071 0.0000
vn 0.7071 -0.7071 0.0000
vn 0.0000 0.0000 -1.0000
vn -0.7071 0.7071 0.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
vn 1.0000 -0.0000 0.0000
vn -1.0000 -0.0000 0.0000
usemtl hammer
s off
f 5/1/1 2/2/1 7/3/1
f 2/4/2 3/5/2 7/6/2
f 4/7/3 5/8/3 8/9/3
f 6/10/4 1/11/4 2/12/4
f 3/13/5 4/14/5 8/15/5
f 3/16/6 5/17/6 7/18/6
f 77/19/7 67/20/7 30/21/7
f 32/22/7 80/23/7 79/24/7
f 35/25/7 50/26/7 33/27/7
f 36/28/7 53/29/7 34/30/7
f 83/31/7 55/32/7 9/33/7
f 85/34/7 57/35/7 84/36/7
f 42/37/7 59/38/7 40/39/7
f 11/40/7 13/41/7 43/42/7
f 87/43/7 62/44/7 45/45/7
f 49/46/7 63/47/7 48/48/7
f 18/49/8 19/50/8 31/51/8
f 21/52/8 22/53/8 20/54/8
f 52/55/8 37/56/8 23/57/8
f 24/58/8 38/59/8 71/60/8
f 72/61/8 39/62/8 73/63/8
f 60/64/8 41/65/8 74/66/8
f 61/67/8 44/68/8 26/69/8
f 27/70/8 28/71/8 46/72/8
f 66/73/8 89/74/8 29/75/8
f 64/76/8 91/77/8 47/78/8
f 13/79/5 62/80/5 76/81/5
f 34/82/1 33/83/1 19/84/1
f 16/85/8 68/86/8 15/87/8
f 15/87/9 30/88/9 67/20/9
f 16/85/9 31/51/9 17/89/9
f 69/90/9 20/54/9 19/50/9
f 51/91/9 23/57/9 22/53/9
f 70/92/9 71/60/9 37/56/9
f 58/93/9 73/63/9 38/59/9
f 25/94/9 74/66/9 39/62/9
f 75/95/9 26/69/9 41/65/9
f 76/96/9 46/72/9 44/68/9
f 65/97/9 29/75/9 28/71/9
f 33/27/10 81/98/10 32/22/10
f 34/30/10 82/99/10 35/25/10
f 9/33/10 54/100/10 36/28/10
f 84/36/10 56/101/10 83/31/10
f 40/39/10 86/102/10 85/34/10
f 42/37/10 13/41/10 10/103/10
f 45/45/10 12/104/10 11/40/10
f 48/48/10 88/105/10 87/43/10
f 89/74/10 64/76/10 47/106/10
f 91/77/10 14/107/10 49/46/10
f 80/23/10 77/19/10 79/24/10
f 5/1/1 6/108/1 2/2/1
f 2/4/2 1/109/2 3/5/2
f 4/7/3 6/110/3 5/8/3
f 6/10/4 4/111/4 1/11/4
f 3/13/5 1/112/5 4/14/5
f 3/16/6 8/113/6 5/17/6
f 77/19/7 78/114/7 67/20/7
f 32/22/7 81/98/7 80/23/7
f 35/25/7 82/99/7 50/26/7
f 36/28/7 54/100/7 53/29/7
f 83/31/7 56/101/7 55/32/7
f 85/34/7 86/102/7 57/35/7
f 42/37/7 10/103/7 59/38/7
f 11/40/7 12/104/7 13/41/7
f 87/43/7 88/105/7 62/44/7
f 49/46/7 14/107/7 63/47/7
f 18/49/8 69/90/8 19/50/8
f 21/52/8 51/91/8 22/53/8
f 52/55/8 70/92/8 37/56/8
f 24/58/8 58/93/8 38/59/8
f 72/61/8 25/94/8 39/62/8
f 60/64/8 75/95/8 41/65/8
f 61/67/8 76/96/8 44/68/8
f 27/70/8 65/97/8 28/71/8
f 66/73/8 90/115/8 89/74/8
f 64/76/8 92/116/8 91/77/8
f 69/117/5 18/118/5 16/119/5
f 16/119/5 15/120/5 67/121/5
f 67/121/5 78/122/5 80/123/5
f 80/123/5 81/124/5 50/125/5
f 50/125/5 82/126/5 53/127/5
f 53/127/5 54/128/5 55/129/5
f 55/129/5 56/130/5 57/131/5
f 57/131/5 86/132/5 59/133/5
f 59/133/5 10/134/5 13/79/5
f 13/79/5 12/135/5 62/80/5
f 62/80/5 88/136/5 63/137/5
f 63/137/5 14/138/5 92/139/5
f 64/140/5 90/141/5 65/142/5
f 90/141/5 66/143/5 65/142/5
f 63/137/5 92/139/5 64/140/5
f 62/80/5 63/137/5 65/142/5
f 63/137/5 64/140/5 65/142/5
f 65/142/5 27/144/5 76/81/5
f 76/81/5 61/145/5 75/146/5
f 75/146/5 60/147/5 25/148/5
f 25/148/5 72/149/5 58/150/5
f 58/150/5 24/151/5 70/152/5
f 70/152/5 52/153/5 51/154/5
f 51/154/5 21/155/5 69/117/5
f 69/117/5 16/119/5 80/123/5
f 16/119/5 67/121/5 80/123/5
f 80/123/5 50/125/5 69/117/5
f 53/127/5 55/129/5 51/154/5
f 55/129/5 57/131/5 70/152/5
f 51/154/5 55/129/5 70/152/5
f 50/125/5 53/127/5 51/154/5
f 51/154/5 69/117/5 50/125/5
f 58/150/5 70/152/5 57/131/5
f 75/146/5 25/148/5 59/133/5
f 25/148/5 58/150/5 57/131/5
f 65/142/5 76/81/5 62/80/5
f 76/81/5 75/146/5 13/79/5
f 57/131/5 59/133/5 25/148/5
f 59/133/5 13/79/5 75/146/5
f 38/156/1 73/157/1 39/158/1
f 39/158/1 74/159/1 41/160/1
f 41/160/1 26/161/1 44/162/1
f 44/162/1 46/163/1 28/164/1
f 28/164/1 29/165/1 89/166/1
f 47/167/1 91/168/1 49/169/1
f 28/164/1 89/166/1 47/167/1
f 41/160/1 44/162/1 45/170/1
f 44/162/1 28/164/1 45/170/1
f 38/156/1 39/158/1 40/171/1
f 39/158/1 41/160/1 43/172/1
f 37/173/1 71/174/1 38/156/1
f 22/175/1 23/176/1 37/173/1
f 19/84/1 20/177/1 22/175/1
f 17/178/1 31/179/1 19/84/1
f 30/180/1 68/181/1 17/178/1
f 79/182/1 77/183/1 30/180/1
f 33/83/1 32/184/1 79/182/1
f 34/82/1 35/185/1 33/83/1
f 9/186/1 36/187/1 34/82/1
f 84/188/1 83/189/1 9/186/1
f 40/171/1 85/190/1 84/188/1
f 43/172/1 42/191/1 40/171/1
f 45/170/1 11/192/1 43/172/1
f 48/193/1 87/194/1 45/170/1
f 47/167/1 49/169/1 48/193/1
f 28/164/1 47/167/1 48/193/1
f 45/170/1 28/164/1 48/193/1
f 22/175/1 37/173/1 9/186/1
f 37/173/1 38/156/1 84/188/1
f 39/158/1 43/172/1 40/171/1
f 43/172/1 41/160/1 45/170/1
f 40/171/1 84/188/1 38/156/1
f 37/173/1 84/188/1 9/186/1
f 30/180/1 17/178/1 79/182/1
f 17/178/1 19/84/1 33/83/1
f 19/84/1 22/175/1 34/82/1
f 9/186/1 34/82/1 22/175/1
f 33/83/1 79/182/1 17/178/1
f 16/85/8 17/89/8 68/86/8
f 15/87/9 68/86/9 30/88/9
f 16/85/9 18/49/9 31/51/9
f 69/90/9 21/52/9 20/54/9
f 51/91/9 52/55/9 23/57/9
f 70/92/9 24/58/9 71/60/9
f 58/93/9 72/61/9 73/63/9
f 25/94/9 60/64/9 74/66/9
f 75/95/9 61/67/9 26/69/9
f 76/96/9 27/70/9 46/72/9
f 65/97/9 66/73/9 29/75/9
f 33/27/10 50/26/10 81/98/10
f 34/30/10 53/29/10 82/99/10
f 9/33/10 55/32/10 54/100/10
f 84/36/10 57/35/10 56/101/10
f 40/39/10 59/38/10 86/102/10
f 42/37/10 43/42/10 13/41/10
f 45/45/10 62/44/10 12/104/10
f 48/48/10 63/47/10 88/105/10
f 89/74/10 90/115/10 64/76/10
f 91/77/10 92/116/10 14/107/10
f 80/23/10 78/114/10 77/19/10

View File

@ -1304,7 +1304,9 @@ Everness:register_node('everness:blue_crying_obsidian', {
-- MCL -- MCL
pickaxey = 5, pickaxey = 5,
building_block = 1, building_block = 1,
material_stone = 1 material_stone = 1,
-- Everness
everness_obsidian = 1
}, },
_mcl_blast_resistance = 1200, _mcl_blast_resistance = 1200,
_mcl_hardness = 50, _mcl_hardness = 50,
@ -1322,7 +1324,9 @@ Everness:register_node('everness:blue_weeping_obsidian', {
-- MCL -- MCL
pickaxey = 5, pickaxey = 5,
building_block = 1, building_block = 1,
material_stone = 1 material_stone = 1,
-- Everness
everness_obsidian = 1
}, },
_mcl_blast_resistance = 1200, _mcl_blast_resistance = 1200,
_mcl_hardness = 50, _mcl_hardness = 50,
@ -1342,7 +1346,9 @@ Everness:register_node('everness:weeping_obsidian', {
-- MCL -- MCL
pickaxey = 5, pickaxey = 5,
building_block = 1, building_block = 1,
material_stone = 1 material_stone = 1,
-- Everness
everness_obsidian = 1
}, },
_mcl_blast_resistance = 1200, _mcl_blast_resistance = 1200,
_mcl_hardness = 50, _mcl_hardness = 50,
@ -9353,7 +9359,7 @@ Everness:register_node('everness:floating_crystal', {
minetest.sound_play( minetest.sound_play(
'everness_thin_glass_footstep', 'everness_thin_glass_footstep',
{ {
gain = 1.0, gain = 0.7,
max_hear_distance = 16, max_hear_distance = 16,
pos = pos pos = pos
}, },

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -212,3 +212,93 @@ minetest.register_tool('everness:shell_of_underwater_breathing', {
-- MCL -- MCL
_mcl_toollike_wield = true, _mcl_toollike_wield = true,
}) })
--
-- Hammer
--
minetest.register_on_mods_loaded(function()
for name, def in pairs(minetest.registered_nodes) do
if def.walkable and def.pointable and def.diggable then
local prev_after_dig = def.after_dig_node
local func = function(pos, node, metadata, digger)
Everness.hammer_after_dig_node(pos, node, metadata, digger, def.can_dig)
end
if prev_after_dig then
func = function(pos, node, metadata, digger)
prev_after_dig(pos, node, metadata, digger)
Everness.hammer_after_dig_node(pos, node, metadata, digger, def.can_dig)
end
end
minetest.override_item(name, { after_dig_node = func })
Everness.hammer_cid_data[minetest.get_content_id(name)] = {
name = name,
drops = def.drops,
can_dig = def.can_dig,
sounds = def.sounds
}
end
end
end)
minetest.register_node('everness:hammer', {
description = S('Hammer'),
mod_origin = 'evermess',
inventory_image = 'everness_hammer_item.png',
use_texture_alpha = 'clip',
drawtype = 'mesh',
mesh = 'everness_hammer_pick.obj',
tiles = { 'everness_hammer_mesh.png' },
wield_scale = { x = 2, y = 2, z = 2 },
node_placement_prediction = '',
range = 4.0,
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level = 3,
groupcaps = {
cracky = { times = { [1] = 2.0, [2] = 1.0, [3] = 0.50 }, uses = 30, maxlevel = 3 },
},
damage_groups = { fleshy = 5 },
-- MCL
punch_attack_uses = 781,
},
stack_max = 1,
sound = { breaks = 'everness_tool_breaks' },
-- MCL
_mcl_toollike_wield = true,
groups = {
-- MCL
tool = 1,
dig_speed_class = 5
},
-- MCL
_mcl_diggroups = {
pickaxey = { speed = 8, level = 5, uses = 1562 }
},
on_place = function(itemstack, placer, pointed_thing)
-- disable placing (returns `nil`)
if pointed_thing.type == 'node' then
local pos = minetest.get_pointed_thing_position(pointed_thing)
if not pos or not placer then
return
end
local pointed_node = minetest.get_node(pos)
local pointed_node_def = minetest.registered_nodes[pointed_node.name]
if not pointed_node then
return
end
-- check if we have to use default on_place first
if pointed_node_def.on_rightclick then
return pointed_node_def.on_rightclick(pos, pointed_node, placer, itemstack, pointed_thing)
end
end
end
})