54 lines
1.3 KiB
Lua
54 lines
1.3 KiB
Lua
-- player setup
|
|
minetest.register_on_joinplayer(function (player)
|
|
if player == nil then return end
|
|
player:get_inventory():set_width("main", 8)
|
|
player:get_inventory():set_size("main", 8 * 4)
|
|
player:hud_set_hotbar_itemcount(9)
|
|
end)
|
|
|
|
-- player physics
|
|
local function set_player_speed(player, speed)
|
|
player:set_physics_override({
|
|
speed = speed,
|
|
})
|
|
end
|
|
|
|
minetest.register_globalstep(function(dtime)
|
|
local players = minetest.get_connected_players()
|
|
for p=1, #players do
|
|
local ctrl = players[p]:get_player_control()
|
|
if ctrl.aux1 then
|
|
set_player_speed(players[p], 1.65)
|
|
else
|
|
set_player_speed(players[p], 1)
|
|
end
|
|
end
|
|
end)
|
|
|
|
-- player hand
|
|
minetest.register_item(":", {
|
|
type = "none",
|
|
wield_image = "hand.png"
|
|
})
|
|
|
|
minetest.override_item("", {
|
|
range = 6,
|
|
tool_capabilities = {
|
|
groupcaps = {
|
|
block = {
|
|
times = {
|
|
[PyuTestCore.BLOCK_BREAKABLE_INSTANT] = 0.35,
|
|
[PyuTestCore.BLOCK_BREAKABLE_NORMAL] = 0.85,
|
|
[PyuTestCore.BLOCK_BREAKABLE_CHOPPY] = 3,
|
|
[PyuTestCore.BLOCK_BREAKABLE_MIDDLE] = 5.5,
|
|
[PyuTestCore.BLOCK_BREAKABLE_LONG] = 8,
|
|
[PyuTestCore.BLOCK_BREAKABLE_FOREVER] = 12
|
|
},
|
|
uses = 0
|
|
}
|
|
},
|
|
punch_attack_uses = 0,
|
|
damage_groups = {fleshy = 1}
|
|
}
|
|
})
|