Compare commits

...

5 Commits

Author SHA1 Message Date
Brandon 6d236fe10d Fix pl_hook player loop and timing bug 2016-09-25 21:40:13 -05:00
Brandon 680943fb10 Ooops 2016-09-23 18:29:34 -05:00
Brandon 42f6fd5190 Fix bug in player hook 2016-09-23 18:27:14 -05:00
Brandon da692cd4bb Add wood bucket 2016-09-21 17:17:31 -05:00
Brandon f3ca7a4473 Remove ABM Limiter, label ABMs 2016-09-21 17:16:34 -05:00
28 changed files with 318 additions and 54 deletions

View File

@ -22,15 +22,16 @@ end
adventuretest.pl_hooks = {}
function adventuretest.player_loop(dtime)
local p = minetest.get_connected_players()
for _, player in pairs(p) do
local name = player:get_player_name()
for k,hook in pairs(adventuretest.pl_hooks) do
adventuretest.pl_hooks[k].timer = adventuretest.pl_hooks[k].timer + dtime
if adventuretest.pl_hooks[k].timer >= adventuretest.pl_hooks[k].timeout then
local reset_hooks = {}
for k,hook in pairs(adventuretest.pl_hooks) do
adventuretest.pl_hooks[k].timer = adventuretest.pl_hooks[k].timer + dtime
if adventuretest.pl_hooks[k].timer >= adventuretest.pl_hooks[k].timeout then
for _, player in pairs(p) do
local name = player:get_player_name()
adventuretest.pl_hooks[k].timer = 0
adventuretest.pl_hooks[k].func(player,name,dtime)
end
end
end
end
end
end

View File

@ -8,7 +8,9 @@ local replaceable_node_types = {
"default:lava_flowing",
"default:water_source",
"default:water_flowing",
"air"
"air",
"default:mg_water_source",
"default:mg_water_flowing"
}

View File

@ -0,0 +1,26 @@
Minetest 0.4 mod: bucket
=========================
License of source code:
-----------------------
Copyright (C) 2011-2012 Kahrl <kahrl@gmx.net>
Copyright (C) 2011-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
Authors of media files
-----------------------
Everything not listed in here:
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>

View File

@ -0,0 +1,2 @@
default

187
mods/bucket_wood/init.lua Normal file
View File

@ -0,0 +1,187 @@
-- Minetest 0.4 mod: bucket
-- See README.txt for licensing and other information.
local LIQUID_MAX = 8 --The number of water levels when liquid_finite is enabled
minetest.register_craft({
output = 'bucket_wood:bucket_empty 1',
recipe = {
{'group:wood', '', 'group:wood'},
{'', 'group:wood', ''},
}
})
bucket_wood = {}
bucket_wood.liquids = {}
bucket_wood.swaps = {}
local function check_protection(pos, name, text)
if minetest.is_protected(pos, name) then
minetest.log("action", (name ~= "" and name or "A mod")
.. " tried to " .. text
.. " at protected position "
.. minetest.pos_to_string(pos)
.. " with a bucket")
minetest.record_protection_violation(pos, name)
return true
end
return false
end
-- Register a new liquid
-- source = name of the source node
-- flowing = name of the flowing node
-- itemname = name of the new bucket item (or nil if liquid is not takeable)
-- inventory_image = texture of the new bucket item (ignored if itemname == nil)
-- This function can be called from any mod (that depends on bucket).
function bucket_wood.register_liquid(source, flowing, itemname, inventory_image, name)
bucket_wood.liquids[source] = {
source = source,
flowing = flowing,
itemname = itemname,
}
bucket_wood.liquids[flowing] = bucket_wood.liquids[source]
if itemname ~= nil then
minetest.register_craftitem(itemname, {
description = name,
inventory_image = inventory_image,
stack_max = 1,
liquids_pointable = true,
groups = {not_in_creative_inventory=1},
on_place = function(itemstack, user, pointed_thing)
-- Must be pointing to node
if pointed_thing.type ~= "node" then
return
end
local node = minetest.get_node_or_nil(pointed_thing.under)
local ndef
if node then
ndef = minetest.registered_nodes[node.name]
end
-- Call on_rightclick if the pointed node defines it
if ndef and ndef.on_rightclick and
user and not user:get_player_control().sneak then
return ndef.on_rightclick(
pointed_thing.under,
node, user,
itemstack) or itemstack
end
local place_liquid = function(pos, node, source, flowing, fullness)
if bucket_wood.swaps[source] ~= nil then
source = bucket_wood.swaps[source]
end
if bucket_wood.swaps[flowing] ~= nil then
flowing = bucket_wood.swaps[flowing]
end
if check_protection(pos,
user and user:get_player_name() or "",
"place "..source) then
return
end
if math.floor(fullness/128) == 1 or
not minetest.setting_getbool("liquid_finite") then
minetest.add_node(pos, {name=source,
param2=fullness})
return
elseif node.name == flowing then
fullness = fullness + node.param2
elseif node.name == source then
fullness = LIQUID_MAX
end
if fullness >= LIQUID_MAX then
minetest.add_node(pos, {name=source,
param2=LIQUID_MAX})
else
minetest.add_node(pos, {name=flowing,
param2=fullness})
end
end
-- Check if pointing to a buildable node
local fullness = tonumber(itemstack:get_metadata())
if not fullness then fullness = LIQUID_MAX end
if ndef and ndef.buildable_to then
-- buildable; replace the node
place_liquid(pointed_thing.under, node,
source, flowing, fullness)
else
-- not buildable to; place the liquid above
-- check if the node above can be replaced
local node = minetest.get_node_or_nil(pointed_thing.above)
if node and minetest.registered_nodes[node.name].buildable_to then
place_liquid(pointed_thing.above,
node, source,
flowing, fullness)
else
-- do not remove the bucket with the liquid
return
end
end
return {name="bucket_wood:bucket_empty"}
end
})
end
end
function bucket_wood.register_swap(source, flowing, new_source, new_flowing)
bucket_wood.swaps[source] = new_source
bucket_wood.swaps[flowing] = new_flowing
end
minetest.register_craftitem("bucket_wood:bucket_empty", {
description = "Empty Wooden Bucket",
inventory_image = "bucket_wood.png",
stack_max = 1,
liquids_pointable = true,
on_use = function(itemstack, user, pointed_thing)
-- Must be pointing to node
if pointed_thing.type ~= "node" then
return
end
-- Check if pointing to a liquid source
local node = minetest.get_node(pointed_thing.under)
local liquiddef = bucket_wood.liquids[node.name]
if liquiddef ~= nil and liquiddef.itemname ~= nil and
(node.name == liquiddef.source or
(node.name == liquiddef.flowing and
minetest.setting_getbool("liquid_finite"))) then
if check_protection(pointed_thing.under,
user:get_player_name(),
"take ".. node.name) then
return
end
minetest.add_node(pointed_thing.under, {name="air"})
if node.name == liquiddef.source then
node.param2 = LIQUID_MAX
end
return ItemStack({name = liquiddef.itemname,
metadata = tostring(node.param2)})
end
end,
groups = { guide = GUIDE_TOOLS },
})
bucket_wood.register_liquid(
"default:water_source",
"default:water_flowing",
"bucket_wood:bucket_water",
"bucket_wood_water.png",
"Wooden Water Bucket"
)
bucket_wood.register_liquid(
"default:mg_water_source",
"default:mg_water_flowing",
"bucket_wood:bucket_water",
"bucket_wood_water.png",
"Wooden Water Bucket"
)
bucket_wood.register_swap("default:mg_water_source","default:mg_water_flowing","default:water_source","default:water_flowing")

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

View File

@ -171,6 +171,7 @@ local function swap_node(pos,name)
end
minetest.register_abm({
label = "campfire",
nodenames = {"campfire:campfire","campfire:campfire_burning"},
interval = 1.0,
chance = 1,

View File

@ -104,11 +104,12 @@ minetest.register_node("cottages:window_shutter_closed", {
-- open shutters in the morning
minetest.register_abm({
label = "open shutters",
nodenames = {"cottages:window_shutter_closed"},
interval = 20, -- change this to 600 if your machine is too slow
chance = 3, -- not all people wake up at the same time!
action = function(pos)
if abm_limiter() then return end
--if abm_limiter() then return end
-- at this time, sleeping in a bed is not possible
if( not(minetest.get_timeofday() < 0.2 or minetest.get_timeofday() > 0.805)) then
local old_node = minetest.get_node( pos );
@ -121,11 +122,12 @@ minetest.register_abm({
-- close them at night
minetest.register_abm({
label = "close shutters",
nodenames = {"cottages:window_shutter_open"},
interval = 20, -- change this to 600 if your machine is too slow
chance = 2,
action = function(pos)
if abm_limiter() then return end
--if abm_limiter() then return end
-- same time at which sleeping is allowed in beds
if( minetest.get_timeofday() < 0.2 or minetest.get_timeofday() > 0.805) then
local old_node = minetest.get_node( pos );

View File

@ -103,11 +103,12 @@ function default.register_falling_node(nodename, texture)
end
minetest.register_abm({
label = "grow sapling",
nodenames = {"default:sapling"},
interval = 10,
chance = 50,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
local nu = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
local is_soil = minetest.get_item_group(nu, "soil")
if is_soil == 0 then
@ -127,6 +128,7 @@ minetest.register_abm({
})
minetest.register_abm({
label = "grow jungle sapling",
nodenames = {"default:junglesapling"},
interval = 10,
chance = 50,
@ -164,29 +166,32 @@ default.cool_lava_flowing = function(pos)
end
minetest.register_abm({
label = "cool lava flow",
nodenames = {"default:lava_flowing"},
neighbors = {"group:water"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if abm_limiter() then return end
--if abm_limiter() then return end
default.cool_lava_flowing(pos, node, active_object_count, active_object_count_wider)
end,
})
minetest.register_abm({
label = "cool lava source",
nodenames = {"default:lava_source"},
neighbors = {"group:water"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if abm_limiter() then return end
--if abm_limiter() then return end
default.cool_lava_source(pos, node, active_object_count, active_object_count_wider)
end,
})
-- freeze things
minetest.register_abm({
label = "freeze things",
nodenames = {"group:freezes"},
neighbors = {"group:cold"},
interval = 10,
@ -207,6 +212,7 @@ minetest.register_abm({
-- melt things
minetest.register_abm({
label = "melt things",
nodenames = {"group:melts"},
neighbors = {"group:hot"},
interval = 10,
@ -226,12 +232,13 @@ minetest.register_abm({
--
minetest.register_abm({
label = "grow cactus",
nodenames = {"default:cactus"},
neighbors = {"group:sand"},
interval = 50,
chance = 20,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
pos.y = pos.y-1
local name = minetest.get_node(pos).name
if minetest.get_item_group(name, "sand") ~= 0 then
@ -251,12 +258,13 @@ minetest.register_abm({
})
minetest.register_abm({
label = "grow papyrus",
nodenames = {"default:papyrus"},
neighbors = {"default:dirt", "default:dirt_with_grass"},
interval = 50,
chance = 20,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
pos.y = pos.y-1
local name = minetest.get_node(pos).name
if name == "default:dirt" or name == "default:dirt_with_grass" then
@ -305,6 +313,7 @@ function default.leaf_globalstep(dtime)
end
minetest.register_abm({
label = "leaf decay",
nodenames = {"group:leafdecay"},
neighbors = {"air", "group:liquid"},
-- A low interval and a high inverse chance spreads the load
@ -312,7 +321,7 @@ minetest.register_abm({
chance = 5,
action = function(p0, node, _, _)
if abm_limiter() then return end
----if abm_limiter() then return end
--print("leafdecay ABM at "..p0.x..", "..p0.y..", "..p0.z..")")
local do_preserve = false
local d = minetest.registered_nodes[node.name].groups.leafdecay

View File

@ -40,13 +40,14 @@ minetest.register_node("default:stone_with_iron", {
})
minetest.register_abm({
label = "lava on iron",
nodenames = {"default:stone_with_iron"},
neighbors = {"group:lava"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
-- change to a fused iron node
if abm_limiter() then return end
--if abm_limiter() then return end
minetest.set_node(pos, {name = "default:cobble"})
end,
})
@ -146,12 +147,13 @@ minetest.register_node("default:dirt", {
})
minetest.register_abm({
label = "convert dirt",
nodenames = {"default:dirt"},
neighbors = {"default:dirt_with_grass","default:water_source","default:water_flowing","default:dirt_with_snow","default:snow","default:snowblock"},
interval = 2,
interval = 15,
chance = 200,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
@ -168,12 +170,13 @@ minetest.register_abm({
})
minetest.register_abm({
label = "convert dirt to dry grass",
nodenames = {"default:dirt"},
neighbors = {"mg:dirt_with_dry_grass"},
interval = 6,
interval = 15,
chance = 200,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
@ -192,7 +195,7 @@ minetest.register_abm({
interval = 2,
chance = 20,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
@ -270,15 +273,16 @@ minetest.register_node("default:clay", {
-- Regenerative clay
minetest.register_abm({
label = "regenerate clay",
nodenames = {"default:sand"},
neighbors = {"default:dirt"},
interval = 2,
chance = 600,
interval = 15,
chance = 250,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
if name == "default:water_source" then
if name == "default:water_source" or name == "default:mg_water_source" then
minetest.set_node(pos, {name = "default:clay"})
end
end
@ -904,11 +908,12 @@ minetest.register_node("default:npc_chest", {
-- respawn random items in the npc chests
minetest.register_abm({
label = "npc chest",
nodenames = {"default:npc_chest"},
interval = 10,
chance = 600,
action = function(pos, node, active_object_count, active_object_count_wider)
if abm_limiter() then return end
--if abm_limiter() then return end
local item_count = math.random(0,5)
local items_available = { [0] = "default:apple", [1] = "mobs:meat_raw", [2]="farming_plus:bread",[3]="bushes:berry_pie_cooked",[4]="bushes:basket_empty",[5]="farming_plus:wheat",[6]="throwing:arrow",[7]="default:torch",[8]="farming_plus:string"}
local meta = minetest.get_meta(pos)
@ -1242,6 +1247,7 @@ local function swap_node(pos,name)
end
minetest.register_abm({
label = "furnace",
nodenames = {"default:furnace","default:furnace_active"},
interval = 1.0,
chance = 1,

View File

@ -218,7 +218,7 @@ adventuretest.register_pl_hook(default.player_globalstep,0)
if minetest.register_on_punchplayer ~= nil then
minetest.register_on_punchplayer( function(player, hitter, time_from_last_punch, tool_capabilities, dir)
local name = player:get_player_name()
process_weapon(player,time_from_last_punch,tool_capabilities)
process_weapon(hitter,time_from_last_punch,tool_capabilities)
blood_particles(player:getpos(),0.5,27,"mobs_blood.png")
if player_anim[name] == "lay" or player_anim[name] == "sit" then
player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0})
@ -236,3 +236,12 @@ if minetest.register_on_punchplayer ~= nil then
end)
end
minetest.register_on_player_hpchange(function(player,hp_change)
if hp_change < 0 then
if math.random(0,3) == 3 then
local snum = math.random(1,4)
minetest.sound_play("default_hurt"..tostring(snum),{object = player})
end
end
end
,false)

View File

@ -38,11 +38,12 @@ minetest.register_node("farming_plus:banana_leaves", {
})
minetest.register_abm({
label = "grow banana sapling",
nodenames = {"farming_plus:banana_sapling"},
interval = 60,
chance = 20,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
farming:generate_tree(pos, "default:tree", "farming_plus:banana_leaves", {"default:dirt", "default:dirt_with_grass"}, {["farming_plus:banana"]=20})
end
})

View File

@ -38,11 +38,12 @@ minetest.register_node("farming_plus:cocoa_leaves", {
})
minetest.register_abm({
label = "grow cocoa sapling",
nodenames = {"farming_plus:cocoa_sapling"},
interval = 60,
chance = 20,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
farming:generate_tree(pos, "default:tree", "farming_plus:cocoa_leaves", {"default:sand", "default:desert_sand"}, {["farming_plus:cocoa"]=20})
end
})

View File

@ -56,6 +56,7 @@ end
function farming:add_plant(full_grown, names, interval, chance)
minetest.register_abm({
label = "growing "..full_grown,
nodenames = names,
neighbors = {"group:soil"},
interval = interval,

View File

@ -17,11 +17,12 @@ minetest.register_node("farming_plus:soil_wet", {
})
minetest.register_abm({
label = "wetting / drying soil",
nodenames = {"farming_plus:soil", "farming_plus:soil_wet"},
interval = 15,
chance = 4,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
pos.y = pos.y+1
local nn = minetest.get_node(pos).name
pos.y = pos.y-1

View File

@ -23,11 +23,12 @@ minetest.register_node(":farming_plus:weed", {
})
minetest.register_abm({
label = "growing weeds",
nodenames = {"farming_plus:soil_wet", "farming_plus:soil"},
interval = 150,
chance = 4,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
if minetest.find_node_near(pos, 4, {"farming_plus:scarecrow", "farming_plus:scarecrow_light"}) ~= nil then
return
end
@ -47,6 +48,7 @@ minetest.register_abm({
-- if something is overrun with weeds too long turn it back to regular dirt
minetest.register_abm({
label = "return to earth",
nodenames = {"farming_plus:weed"},
interval = 700,
chance = 3,

View File

@ -167,6 +167,7 @@ end
-- Extinguish all flames quickly with water, snow, ice
minetest.register_abm({
label = "extinguish fire",
nodenames = {"fire:basic_flame", "fire:permanent_flame"},
neighbors = {"group:puts_out_fire"},
interval = 3,
@ -187,6 +188,7 @@ if minetest.setting_getbool("disable_fire") then
-- Remove basic flames only
minetest.register_abm({
label = "fire",
nodenames = {"fire:basic_flame"},
interval = 7,
chance = 2,
@ -200,6 +202,7 @@ else
-- Ignite neighboring nodes, add basic flames
minetest.register_abm({
label = "ignite",
nodenames = {"group:flammable"},
neighbors = {"group:igniter"},
interval = 7,
@ -220,6 +223,7 @@ else
-- Remove basic flames and flammable nodes
minetest.register_abm({
label = "flame die",
nodenames = {"fire:basic_flame"},
interval = 5,
chance = 16,

View File

@ -39,7 +39,7 @@ minetest.register_node("flowers:magic", {
wield_image = "flowers_magic.png",
sunlight_propagates = true,
paramtype = "light",
light_source = 12,
light_source = 6,
walkable = false,
buildable_to = true,
floodable = true,
@ -148,14 +148,15 @@ minetest.register_node("flowers:viola", {
-- regrow some magic flowers
minetest.register_abm({
nodenames = {"default:dirt_with_snow","default:snowblock"},
label = "regrow magic flowers",
nodenames = {"default:dirt_with_snow","default:snowblock","fireswamp:swamp_grass"},
interval = 80,
chance = 600,
action = function(pos, node)
if pos.y < 300 then
if ( minetest.get_node(pos).name == "default:dirt_with_snow" or minetest.get_node(pos).name == "default:snowblock") and pos.y < 300 then
return
end
if abm_limiter() then return end
--if abm_limiter() then return end
local light = minetest.get_node_light(pos)
if not light or light < 10 then
return
@ -163,18 +164,19 @@ minetest.register_abm({
local pos2 = {x=pos.x,y=(pos.y+1),z=pos.z}
local above = minetest.get_node(pos2).name
if above == "default:snow" or above == "air" then
minetest.set_node(pos2,"flowers:magic")
minetest.set_node(pos2,{name="flowers:magic"})
end
end,
})
minetest.register_abm({
label = "regrow all flowers",
nodenames = {"group:flora"},
neighbors = {"default:dirt_with_grass", "default:desert_sand","mg:dirt_with_dry_grass"},
interval = 50,
chance = 25,
chance = 75,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
pos.y = pos.y - 1
local under = minetest.get_node(pos)
pos.y = pos.y + 1

View File

@ -185,6 +185,7 @@ minetest.register_node("glowcrystals:wall", {
-- convert old torches and remove ceiling placed
minetest.register_abm({
label = "convert old glow crystal torches",
nodenames = {"glowcrystals:glowcrystal_torch"},
interval = 1,
chance = 1,

View File

@ -89,7 +89,7 @@ minetest.register_abm({
interval = 10,
chance = 50,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map({x=pos.x-10, y=pos.y, z=pos.z-10}, {x=pos.x+10, y=pos.y+20, z=pos.z+10})
local a = VoxelArea:new{MinEdge=minp, MaxEdge=maxp}
@ -113,12 +113,13 @@ minetest.register_node("mg:dirt_with_dry_grass", {
})
minetest.register_abm({
label = "convert dirt with dry grass",
nodenames = {"mg:dirt_with_dry_grass"},
neighbors = {"default:water_source","default:water_flowing","default:dirt_with_snow","default:snow","default:snowblock"},
interval = 2,
chance = 200,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
@ -135,11 +136,12 @@ minetest.register_abm({
})
minetest.register_abm({
label = "dirt with dry grass to dirt with grass",
nodenames = {"mg:dirt_with_dry_grass"},
interval = 2,
chance = 20,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
@ -216,11 +218,12 @@ minetest.register_node("mg:pinesapling", {
})
minetest.register_abm({
label = "grow pine sapling",
nodenames = {"mg:pinesapling"},
interval = 10,
chance = 50,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map({x=pos.x-10, y=pos.y, z=pos.z-10}, {x=pos.x+10, y=pos.y+30, z=pos.z+10})
local a = VoxelArea:new{MinEdge=minp, MaxEdge=maxp}

View File

@ -63,7 +63,7 @@ minetest.register_abm({
interval = 1,
chance = 1,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
if node.name == "moreblocks:horizontal_tree" then
node.name = "default:tree"
else

View File

@ -79,7 +79,7 @@ function stairsplus:register_6dfacedir_conversion(modname, material)
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if abm_limiter() then return end
--if abm_limiter() then return end
local fdir = node.param2 or 0
if flip_upside_down and not flip_to_wall then
@ -123,7 +123,7 @@ function stairsplus:register_6dfacedir_conversion(modname, material)
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if abm_limiter() then return end
--if abm_limiter() then return end
local fdir = node.param2
local nfdir = 20

View File

@ -46,7 +46,7 @@ minetest.register_chatcommand("home", {
end
local last_moved = pd.get_number(pname,"last_moved")
local homepos = pd.get(pname,"homepos")
local player = minetest.get_player_by_name(name)
local player = minetest.get_player_by_name(pname)
if player == nil then
-- just a check to prevent server death
return false

View File

@ -180,8 +180,11 @@ minetest.register_chatcommand("skills", {
function skills_on_dieplayer (player)
local name = player:get_player_name()
local level = skills.get_player_level(name)
local decrease = level.exp * -0.1
skills.add_exp(name,decrease)
if level ~= nil then
local decrease = level.exp * -0.1
skills.add_exp(name,decrease)
end
end
dofile(minetest.get_modpath("skills").."/register_skills.lua")

View File

@ -1,11 +1,11 @@
-- REGISTER THE SKILLS
skills.register_skill(SKILL_WOOD, { desc = 'Wood', max_level = 10, level_exp = 3, level = 1 })
skills.register_skill(SKILL_STONE, { desc = 'Stone', max_level = 10, level_exp = 5, level = 1 })
skills.register_skill(SKILL_METAL, { desc = 'Metals', max_level = 20, level_exp = 9, level = 5 })
skills.register_skill(SKILL_CRYSTAL, { desc = 'Crystals', max_level = 20, level_exp = 10, level = 10 })
skills.register_skill(SKILL_METAL, { desc = 'Metals', max_level = 20, level_exp = 9, level = 4 })
skills.register_skill(SKILL_CRYSTAL, { desc = 'Crystals', max_level = 20, level_exp = 10, level = 8 })
skills.register_skill(SKILL_SMELTING, { desc = 'Smelting', max_level = 50, level_exp = 5, level = 1 })
skills.register_skill(SKILL_CRAFTING, { desc = 'Crafting', max_level = 50, level_exp = 5, level = 1 })
skills.register_skill(SKILL_ARROW, { desc = 'Bow and Arrow', max_level=10, level_exp = 10, level = 10 })
skills.register_skill(SKILL_MAGIC, { desc = 'Magic', max_level=15, level_exp = 10, level =5 })
skills.register_skill(SKILL_MAGIC, { desc = 'Magic', max_level=15, level_exp = 10, level =3 })

View File

@ -195,7 +195,7 @@ minetest.register_abm({
interval = 1,
chance = 1,
action = function(pos, node)
if abm_limiter() then return end
--if abm_limiter() then return end
node.name = minetest.registered_nodes[node.name].replace_name
node.param2 = node.param2 + 20
if node.param2 == 21 then

View File

@ -6,7 +6,7 @@ function ts_doors.register_door(recipe, description, texture)
local groups = node.groups
local door_groups = {}
for k,v in pairs(groups) do
if k ~= "wood" then
if k ~= "wood" and k ~= "tree" then
door_groups[k] = v
end
end