- make redstone dust an attached node
- Fixed treecaptitator not cutting down part of tree when lever is powering one of it's nodes
- Added command for users with "server" privelage to control weather
+- Added craft recipe to shears
---
minetest.register_node("buildtest:glass_pipe", {
description = "Glass Pipe",
tiles = {"glass_pipe.png"},
- groups = {stone = 1, hard = 1, pickaxe = 1, hand = 4},
+ groups = {glass = 1},
sounds = main.stoneSound(),
drawtype = "nodebox",
paramtype = "light",
end
for level,material in pairs(material) do
- local wear = 5000-(950*level)
- print(wear)
+ local wear = 100*(6-level)
+ local groupcaps2
+ if material == "wood" then
+ groupcaps2={
+ dirt = {times={[1]=0.4,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=59, maxlevel=1},
+ snow = {times={[1]=0.4,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=59, maxlevel=1},
+ grass = {times={[1]=0.45,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=59, maxlevel=1},
+ sand = {times={[1]=0.4,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=59, maxlevel=1},
+ }
+ damage = 2.5
+ elseif material == "stone" then
+ groupcaps2={
+ dirt = {times={[1]=0.2,[2]=0.2,[3]=1.5,[4]=3,[5]=6}, uses=131, maxlevel=1},
+ snow = {times={[1]=0.2,[2]=0.2,[3]=1.5,[4]=3,[5]=6}, uses=131, maxlevel=1},
+ grass = {times={[1]=0.25,[2]=0.25,[3]=1.5,[4]=3,[5]=6}, uses=131, maxlevel=1},
+ sand = {times={[1]=0.2,[2]=0.2,[3]=1.5,[4]=3,[5]=6}, uses=131, maxlevel=1},
+ }
+ damage = 3.5
+ elseif material == "iron" then
+ groupcaps2={
+ dirt = {times={[1]=0.15,[2]=0.15,[3]=0.15,[4]=1.5,[5]=3}, uses=250, maxlevel=1},
+ snow = {times={[1]=0.15,[2]=0.15,[3]=0.15,[4]=1.5,[5]=3}, uses=250, maxlevel=1},
+ grass = {times={[1]=0.15,[2]=0.15,[3]=0.15,[4]=1.5,[5]=3}, uses=250, maxlevel=1},
+ sand = {times={[1]=0.15,[2]=0.15,[3]=0.15,[4]=1.5,[5]=3}, uses=250, maxlevel=1},
+ }
+ damage = 4.5
+ elseif material == "gold" then
+ groupcaps2={
+ dirt = {times={[1]=0.1,[2]=0.1,[3]=0.1,[4]=0.1,[5]=1.5}, uses=32, maxlevel=1},
+ snow = {times={[1]=0.1,[2]=0.1,[3]=0.1,[4]=0.1,[5]=1.5}, uses=32, maxlevel=1},
+ grass = {times={[1]=0.1,[2]=0.1,[3]=0.1,[4]=0.1,[5]=1.5}, uses=32, maxlevel=1},
+ sand = {times={[1]=0.1,[2]=0.1,[3]=0.1,[4]=0.1,[5]=1.5}, uses=32, maxlevel=1},
+ }
+ damage = 2.5
+ elseif material == "diamond" then
+ groupcaps2={
+ dirt = {times={[1]= 0.1,[2]=0.1,[3]=0.1,[4]=0.1,[5]=1.5}, uses=1561, maxlevel=1},
+ snow = {times={[1]= 0.1,[2]=0.1,[3]=0.1,[4]=0.1,[5]=1.5}, uses=1561, maxlevel=1},
+ grass = {times={[1]= 0.15,[2]=0.15,[3]=0.15,[4]=0.15,[5]=1.5}, uses=1561, maxlevel=1},
+ sand = {times={[1]= 0.1,[2]=0.1,[3]=0.1,[4]=0.1,[5]=1.5}, uses=1561, maxlevel=1},
+ }
+ damage = 5.5
+ end
minetest.register_tool("farming:"..material.."hoe", {
description = material:gsub("^%l", string.upper).." Hoe",
inventory_image = material.."hoe.png",
tool_capabilities = {
- --full_punch_interval = 1.2,
- --max_drop_level=0,
- groupcaps={
- dirt = {times={[4]=4-level/4,[3]=3.5-level/4,[2]=3.0-level/4,[1]=2.8-level/4}, uses=(level/2)*3, maxlevel=level},
- sand = {times={[4]=4-level/4,[3]=3.5-level/4,[2]=3.0-level/4,[1]=2.8-level/4}, uses=(level/2)*3, maxlevel=level},
+ --full_punch_interval = 1.2,
+ --max_drop_level=0,
+ groupcaps=groupcaps2,
+ damage_groups = {damage=damage},
},
- damage_groups = {fleshy=1},
- },
sound = {breaks = {name="tool_break",gain=0.4}}, -- change this
groups = {flammable = 2, tool=1 },
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level = 0,
- groupcaps = {
- stone = {times={[4]=11.5,[3]=8.5,[2]=6.70,[1]=5.5}, uses=0, maxlevel=1},
- dirt = {times={[4]=11.0,[3]=8.4,[2]=6.40,[1]=4.2}, uses=0, maxlevel=1},
- sand = {times={[4]=11.0,[3]=8.4,[2]=6.40,[1]=4.2}, uses=0, maxlevel=1},
- wood = {times={[4]=11.5,[3]=8.5,[2]=6.70,[1]=5.5}, uses=0, maxlevel=1},
- leaves = {times={[4]=4.5,[3]=3.2,[2]=2.20,[1]=1.2}, uses=0, maxlevel=0},
- wool = {times={[4]=4.5,[3]=3.2,[2]=2.20,[1]=1.2}, uses=0, maxlevel=0},
- instant = {times={[1]=0.1,},uses=0,maxlevel=1},
+ groupcaps = {
+ stone = {times={[1]=7.5,[2]=16,[3]=32,[4]=64,[5]=128}, uses=0, maxlevel=1}, --
+ dirt = {times={[1]=0.75,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=0, maxlevel=1}, --
+ snow = {times={[1]=0.75,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=0, maxlevel=1}, --
+ grass = {times={[1]=0.9,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=0, maxlevel=1}, --
+ sand = {times={[1]=0.75,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=0, maxlevel=1}, --
+ wood = {times={[1]=3,[2]=6,[3]=9,[4]=12,[5]=15}, uses=0, maxlevel=1}, --
+ leaves ={times={[1]=0.75,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=0, maxlevel=1}, --
+ wool = {times={[1]=0.75,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=0, maxlevel=1}, --
+ glass = {times={[1]=0.75,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=0, maxlevel=1}, --
+
+ --instant = {times={[1]=0.1,},uses=0,maxlevel=1},
dig_immediate = {times={[2]=0,[3]=0,[1]=0,},uses=0,maxlevel=1},
},
- damage_groups = {fleshy=1},
+ damage_groups = {damage=1},
}
})
{"main:stick", "", "main:stick"}
}
})
+
+minetest.register_craft({
+ output = "main:shears",
+ recipe = {
+ {"","main:iron"},
+ {"main:iron",""},
+ }
+})
+
+
local drops = {"main:"..ore.."ore"}
if ore == "diamond" then drops = {"main:diamond"} elseif ore == "coal" then drops = {"main:coal"} end
+ print(ore,id)
minetest.register_node("main:"..ore.."ore", {
description = ore:gsub("^%l", string.upper).." Ore",
tiles = {"stone.png^"..ore.."ore.png"},
- groups = {stone = id, hard = id, pickaxe = 1, hand = 4,pathable = 1},
+ groups = {stone = id, pathable = 1},
sounds = main.stoneSound(),
--light_source = 14,--debugging ore spawn
drop = {
minetest.register_node("main:stone", {
description = "Stone",
tiles = {"stone.png"},
- groups = {stone = 1, hard = 1, pickaxe = 1, hand = 4,pathable = 1},
+ groups = {stone = 1, hand = 1,pathable = 1},
sounds = main.stoneSound(),
--[[
redstone_activation = function(pos)
minetest.register_node("main:cobble", {
description = "Cobblestone",
tiles = {"cobble.png"},
- groups = {stone = 2, hard = 1, pickaxe = 2, hand = 4,pathable = 1},
+ groups = {stone = 1, pathable = 1},
sounds = main.stoneSound(),
--[[
redstone_activation = function(pos)
tiles = {"glass.png"},
drawtype = "glasslike",
paramtype = "light",
- --paramtype2 = "glasslikeliquidlevel",
sunlight_propagates = true,
is_ground_content = false,
- groups = {stone = 1, hard = 1, pickaxe = 1, hand = 4,pathable = 1},
+ groups = {glass = 1, pathable = 1},
sounds = main.stoneSound({
footstep = {name = "glass_footstep", gain = 0.4},
dug = {name = "break_glass", gain = 0.4},
minetest.register_node("main:dirt", {
description = "Dirt",
tiles = {"dirt.png"},
- groups = {dirt = 1, soft = 1, shovel = 1, hand = 1, soil=1,pathable = 1, farm_tillable=1},
+ groups = {dirt = 1, soil=1,pathable = 1, farm_tillable=1},
sounds = main.dirtSound(),
paramtype = "light",
})
minetest.register_node("main:grass", {
description = "Grass",
tiles = {"grass.png"},
- groups = {dirt = 1, soft = 1, shovel = 1, hand = 1, soil=1,pathable = 1, farm_tillable=1},
+ groups = {grass = 1, soil=1,pathable = 1, farm_tillable=1},
sounds = main.dirtSound(),
drop="main:dirt",
})
minetest.register_node("main:sand", {
description = "Sand",
tiles = {"sand.png"},
- groups = {sand = 1, soft = 1, shovel = 1, hand = 1, falling_node = 1,pathable = 1},
+ groups = {sand = 1, falling_node = 1,pathable = 1},
sounds = main.sandSound(),
})
minetest.register_node("main:tree", {
description = "Tree",
tiles = {"treeCore.png","treeCore.png","treeOut.png","treeOut.png","treeOut.png","treeOut.png"},
- groups = {wood = 2, tree = 1, hard = 1, axe = 1, hand = 3,pathable = 1},
+ groups = {wood = 1, tree = 1, pathable = 1},
sounds = main.woodSound(),
--set metadata so treecapitator doesn't destroy houses
on_place = function(itemstack, placer, pointed_thing)
minetest.register_node("main:wood", {
description = "Wood",
tiles = {"wood.png"},
- groups = {wood = 1, hard = 1, axe = 1, hand = 3,pathable = 1},
+ groups = {wood = 1, pathable = 1},
sounds = main.woodSound(),
})
paramtype = "light",
is_ground_content = false,
tiles = {"leaves.png"},
- groups = {leaves = 1, plant = 1, axe = 1, hand = 0, leafdecay = 1},
+ groups = {leaves = 1, leafdecay = 1},
sounds = main.grassSound(),
drop = {
max_items = 1,
--wall_bottom = = <default>
--wall_side = = <default>
},
- groups = {wood = 2, flammable = 2, attached_node=1},
+ groups = {wood = 1, flammable = 1, attached_node=1},
sounds = main.woodSound(),
on_place = function(itemstack, placer, pointed_thing)
--copy from torch
--Quick definition of tools
local tool = {"shovel","axe","pick"}
-local group = {[1]="dirt",[2]="wood",[3]="stone"}
local material = {"wood","stone","iron","gold","diamond"}
-for level,material in pairs(material) do
+for _,material in pairs(material) do
for id,tool in pairs(tool) do
--print(id,tool,level,material)
local groupcaps
- if group[id] == "dirt" then
- groupcaps2={
- dirt = {times={[4]=4-level/2,[3]=3.5-level/2,[2]=3.0-level/2,[1]=2.8-level/2}, uses=(level/2)*5, maxlevel=level},
- sand = {times={[4]=4-level/2,[3]=3.5-level/2,[2]=3.0-level/2,[1]=2.8-level/2}, uses=(level/2)*5, maxlevel=level},
- }
+ local damage
+ --shovel
+ if tool == "shovel" then
+ if material == "wood" then
+ groupcaps2={
+ dirt = {times={[1]=0.4,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=59, maxlevel=1},
+ snow = {times={[1]=0.4,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=59, maxlevel=1},
+ grass = {times={[1]=0.45,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=59, maxlevel=1},
+ sand = {times={[1]=0.4,[2]=1.5,[3]=3,[4]=6,[5]=12}, uses=59, maxlevel=1},
+ }
+ damage = 2.5
+ elseif material == "stone" then
+ groupcaps2={
+ dirt = {times={[1]=0.2,[2]=0.2,[3]=1.5,[4]=3,[5]=6}, uses=131, maxlevel=1},
+ snow = {times={[1]=0.2,[2]=0.2,[3]=1.5,[4]=3,[5]=6}, uses=131, maxlevel=1},
+ grass = {times={[1]=0.25,[2]=0.25,[3]=1.5,[4]=3,[5]=6}, uses=131, maxlevel=1},
+ sand = {times={[1]=0.2,[2]=0.2,[3]=1.5,[4]=3,[5]=6}, uses=131, maxlevel=1},
+ }
+ damage = 3.5
+ elseif material == "iron" then
+ groupcaps2={
+ dirt = {times={[1]=0.15,[2]=0.15,[3]=0.15,[4]=1.5,[5]=3}, uses=250, maxlevel=1},
+ snow = {times={[1]=0.15,[2]=0.15,[3]=0.15,[4]=1.5,[5]=3}, uses=250, maxlevel=1},
+ grass = {times={[1]=0.15,[2]=0.15,[3]=0.15,[4]=1.5,[5]=3}, uses=250, maxlevel=1},
+ sand = {times={[1]=0.15,[2]=0.15,[3]=0.15,[4]=1.5,[5]=3}, uses=250, maxlevel=1},
+ }
+ damage = 4.5
+ elseif material == "gold" then
+ groupcaps2={
+ dirt = {times={[1]=0.1,[2]=0.1,[3]=0.1,[4]=0.1,[5]=1.5}, uses=32, maxlevel=1},
+ snow = {times={[1]=0.1,[2]=0.1,[3]=0.1,[4]=0.1,[5]=1.5}, uses=32, maxlevel=1},
+ grass = {times={[1]=0.1,[2]=0.1,[3]=0.1,[4]=0.1,[5]=1.5}, uses=32, maxlevel=1},
+ sand = {times={[1]=0.1,[2]=0.1,[3]=0.1,[4]=0.1,[5]=1.5}, uses=32, maxlevel=1},
+ }
+ damage = 2.5
+ elseif material == "diamond" then
+ groupcaps2={
+ dirt = {times={[1]= 0.1,[2]=0.1,[3]=0.1,[4]=0.1,[5]=1.5}, uses=1561, maxlevel=1},
+ snow = {times={[1]= 0.1,[2]=0.1,[3]=0.1,[4]=0.1,[5]=1.5}, uses=1561, maxlevel=1},
+ grass = {times={[1]= 0.15,[2]=0.15,[3]=0.15,[4]=0.15,[5]=1.5}, uses=1561, maxlevel=1},
+ sand = {times={[1]= 0.1,[2]=0.1,[3]=0.1,[4]=0.1,[5]=1.5}, uses=1561, maxlevel=1},
+ }
+ damage = 5.5
+ end
end
- if group[id] == "wood" then
- groupcaps2={wood = {times={[4]=4-level/2,[3]=3.5-level/2,[2]=3.0-level/2,[1]=2.8-level/2}, uses=(level/2)*5, maxlevel=level},}
+ --axe
+ if tool == "axe" then
+ if material == "wood" then
+ groupcaps2={
+ wood = {times={[1]=1.5,[2]=3,[3]=6,[4]=9,[5]=12}, uses=59, maxlevel=1}
+ }
+ damage = 7
+ elseif material == "stone" then
+ groupcaps2={
+ wood = {times={[1]=0.75,[2]=0.75,[3]=3,[4]=6,[5]=9}, uses=131, maxlevel=1}
+ }
+ damage=9
+ elseif material == "iron" then
+ groupcaps2={
+ wood = {times={[1]=0.5,[2]=0.5,[3]=0.5,[4]=3,[5]=6}, uses=250, maxlevel=1}
+ }
+ damage = 9
+ elseif material == "gold" then
+ groupcaps2={
+ wood = {times={[1]=0.25,[2]=0.25,[3]=0.25,[4]=0.25,[5]=3}, uses=32, maxlevel=1}
+ }
+ damage = 7
+ elseif material == "diamond" then
+ groupcaps2={
+ wood = {times={[1]= 0.4,[2]=0.4,[3]=0.4,[4]=0.4,[5]=3}, uses=1561, maxlevel=1}
+ }
+ damage = 9
+ end
end
- if group[id] == "stone" then
- groupcaps2={stone = {times={[4]=4-level/2,[3]=3.5-level/2,[2]=3.0-level/2,[1]=2.8-level/2}, uses=(level/2)*5, maxlevel=level},}
+
+
+ --pickaxe
+ if tool == "pick" then
+ if material == "wood" then
+ groupcaps2={
+ --ore hardness
+ --1 stone, 1 coal, 2 iron, 3 gold, 4 diamond, 5 obsidian
+ stone = {times={[1]=1.15,[2]=16,[3]=32,[4]=64,[5]=128}, uses=59, maxlevel=1},
+ glass = {times={[1]=1.15,[2]=16,[3]=32,[4]=64,[5]=128}, uses=59, maxlevel=1},
+ }
+ damage = 3
+ elseif material == "stone" then
+ groupcaps2={
+ stone = {times={[1]=0.6,[2]=0.6,[3]=32,[4]=64,[5]=128}, uses=131, maxlevel=1},
+ glass = {times={[1]=0.6,[2]=0.6,[3]=32,[4]=64,[5]=128}, uses=131, maxlevel=1},
+ }
+ damage=4
+ elseif material == "iron" then
+ groupcaps2={
+ stone = {times={[1]=0.4,[2]=0.4,[3]=0.4,[4]=32,[5]=64}, uses=250, maxlevel=1},
+ glass = {times={[1]=0.4,[2]=0.4,[3]=0.4,[4]=32,[5]=64}, uses=250, maxlevel=1},
+ }
+ damage = 5
+ elseif material == "gold" then
+ groupcaps2={
+ stone = {times={[1]=0.2,[2]=0.2,[3]=0.2,[4]=0.2,[5]=32}, uses=32, maxlevel=1},
+ glass = {times={[1]=0.2,[2]=0.2,[3]=0.2,[4]=0.2,[5]=32}, uses=32, maxlevel=1},
+ }
+ damage = 3
+ elseif material == "diamond" then
+ groupcaps2={
+ stone = {times={[1]= 0.3,[2]=0.3,[3]=0.3,[4]=0.3,[5]=4}, uses=1561, maxlevel=1},
+ glass = {times={[1]= 0.3,[2]=0.3,[3]=0.3,[4]=0.3,[5]=4}, uses=1561, maxlevel=1},
+ }
+ damage = 6
+ end
end
minetest.register_tool("main:"..material..tool, {
description = material:gsub("^%l", string.upper).." "..tool:gsub("^%l", string.upper),
--full_punch_interval = 1.2,
--max_drop_level=0,
groupcaps=groupcaps2,
- damage_groups = {fleshy=1},
+ damage_groups = {damage=damage},
},
sound = {breaks = {name="tool_break",gain=0.4}}, -- change this
groups = {flammable = 2, tool=1 },
end,
})
end
+
+
+
+ if material == "wood" then
+ damage = 4
+ elseif material == "stone" then
+ damage = 5
+ elseif material == "iron" then
+ damage = 6
+ elseif material == "gold" then
+ damage = 4
+ elseif material == "diamond" then
+ damage = 7
+ end
+
--add swords
minetest.register_tool("main:"..material.."sword", {
description = material:gsub("^%l", string.upper).." Sword",
tool_capabilities = {
--full_punch_interval = 1.2,
--max_drop_level=0,
- groupcaps={leaves = {times={[4]=0.7,[3]=0.7,[2]=0.7,[1]=0.7}, uses=level*20, maxlevel=4},},
- damage_groups = {fleshy=level},
+ groupcaps={leaves = {times={[4]=0.7,[3]=0.7,[2]=0.7,[1]=0.7}, uses=10, maxlevel=1},},
+ damage_groups = {damage = damage},
},
sound = {breaks = {name="tool_break",gain=0.4}}, -- change this
- groups = {weapon=1 }
+ groups = {damage=damage }
})
end
minetest.register_tool("main:shears", {
- description = "Shears",
- inventory_image = "shears.png",
- tool_capabilities = {
- --full_punch_interval = 1.2,
- --max_drop_level=0,
- groupcaps={leaves = {times={[4]=0.2,[3]=0.2,[2]=0.2,[1]=0.2}, uses=300, maxlevel=4},},
- --damage_groups = {fleshy=2},
- },
- sound = {breaks = "default_tool_breaks"}, -- change this
- groups = {shears = 1}
- })
+ description = "Shears",
+ inventory_image = "shears.png",
+ tool_capabilities = {
+ groupcaps = {
+ leaves = {times={[1]= 0.05,[2]=0.05,[3]=0.05,[4]=0.05,[5]=0.05}, uses=500, maxlevel=1},
+ }
+ },
+ sound = {breaks = "default_tool_breaks"}, -- change this
+ groups = {shears = 1}
+})
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
},
+ sounds = main.stoneSound(),
on_place = function(itemstack, placer, pointed_thing)
if not pointed_thing.type == "node" then
return
if minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name].walkable and minetest.get_node(pointed_thing.above).name == "air" then
minetest.set_node(pointed_thing.above, {name="minecart:rail"})
itemstack:take_item(1)
- --print(minetest.get_node(pointed_thing.above).param1)
+ minetest.sound_play("stone",{pos=pointed_thing.above})
return(itemstack)
end
end,
- groups={instant=1,rail=1},
+ groups={stone=1,wood=1,rail=1},
})
minetest.register_craft({
if walkable then
local distance = vector.subtract(collision_point,pos).y-self.object:get_properties().collisionbox[2]+0.4
if distance >= -0.11 then
- print("Jumping")
local vel = self.object:get_velocity()
self.jump_timer = 0.5
self.object:add_velocity(vector.new(vel.x,5,vel.z))
connect_right = { -1/16, -1/2, -1/16, 1/2, 1/2, 1/16},
}
-def2.connects_to = {"group:fence", "group:wood", "group:tree", "group:wall", "group:stone", "group:sand"}
+def2.connects_to = {"group:fence", "group:wood", "group:wall", "group:stone", "group:sand","group:glass"}
def2.sunlight_propagates = true
minetest.register_node(newname,def2)
minetest.register_node("weather:snow", {
description = "Snow",
tiles = {"snow_block.png"},
- groups = {soft = 1, shovel = 1, hand = 1,pathable = 1,wool=1,dirt=1,falling_node=1},
+ groups = {pathable = 1,snow = 1, falling_node=1},
sounds = main.woolSound(),
paramtype = "light",
drawtype = "nodebox",