Added square mode

This commit is contained in:
DonBatman 2015-08-29 13:00:51 -07:00
parent f497ef554c
commit fdd9090f7c
3 changed files with 138 additions and 1 deletions

View File

@ -122,6 +122,24 @@ minetest.register_tool( "mychisel:chisel",{
parti(pos) parti(pos)
end end
end end
if mode == "5" then
if node.name == item then
minetest.set_node(pos,{name = "mychisel:square_"..mat.."1", param2=minetest.dir_to_facedir(user:get_look_dir())})
parti(pos)
end
if node.name == "mychisel:square_"..mat.."1" then
minetest.set_node(pos,{name = "mychisel:square_"..mat.."2", param2=minetest.dir_to_facedir(user:get_look_dir())})
parti(pos)
end
if node.name == "mychisel:square_"..mat.."2" then
minetest.set_node(pos,{name = "mychisel:square_"..mat.."3", param2=minetest.dir_to_facedir(user:get_look_dir())})
parti(pos)
end
if node.name == "mychisel:square_"..mat.."3" then
minetest.set_node(pos,{name = "mychisel:square_"..mat.."4", param2=minetest.dir_to_facedir(user:get_look_dir())})
parti(pos)
end
end
end end
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
itemstack:add_wear(65535 / (USES - 1)) itemstack:add_wear(65535 / (USES - 1))
@ -142,6 +160,9 @@ end,
mode = "4" mode = "4"
minetest.chat_send_player(usr,"Cross Grooves") minetest.chat_send_player(usr,"Cross Grooves")
elseif mode == "4" then elseif mode == "4" then
mode = "5"
minetest.chat_send_player(usr,"Square")
elseif mode == "5" then
mode = "1" mode = "1"
minetest.chat_send_player(usr,"Chisel 4 Edges") minetest.chat_send_player(usr,"Chisel 4 Edges")
end end

118
nodes.lua
View File

@ -137,9 +137,49 @@ local chis4 = {
{-0.25, -0.25, -0.5, 0.25, 0.25, 0.5}, {-0.25, -0.25, -0.5, 0.25, 0.25, 0.5},
} }
} }
local squar1 = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.4375, 0.5, 0.5, 0.5},
{-0.5, -0.5, -0.5, -0.3125, 0.5, -0.4375},
{0.3125, -0.5, -0.5, 0.5, 0.5, -0.4375},
{-0.5, -0.5, -0.5, 0.5, -0.3125, -0.4375},
{-0.5, 0.3125, -0.5, 0.5, 0.5, -0.4375},
}
}
local squar2 = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.375, 0.5, 0.5, 0.5},
{-0.5, -0.5, -0.5, -0.3125, 0.5, -0.375},
{0.3125, -0.5, -0.5, 0.5, 0.5, -0.375},
{-0.5, -0.5, -0.5, 0.5, -0.3125, -0.375},
{-0.5, 0.3125, -0.5, 0.5, 0.5, -0.375},
}
}
local squar3 = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.3125, 0.5, 0.5, 0.5},
{-0.5, -0.5, -0.5, -0.3125, 0.5, -0.3125},
{0.3125, -0.5, -0.5, 0.5, 0.5, -0.3125},
{-0.5, -0.5, -0.5, 0.5, -0.3125, -0.3125},
{-0.5, 0.3125, -0.5, 0.5, 0.5, -0.3125},
}
}
local squar4 = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
{-0.5, -0.5, -0.5, -0.3125, 0.5, -0.25},
{0.3125, -0.5, -0.5, 0.5, 0.5, -0.25},
{-0.5, -0.5, -0.5, 0.5, -0.3125, -0.25},
{-0.5, 0.3125, -0.5, 0.5, 0.5, -0.25},
}
}
local default_material = { local default_material = {
{"default:cobble", "default_cobble", "Cobble", {cracky = 3, not_in_creative_inventory=0}}, {"default:cobble", "default_cobble", "Cobble", {cracky = 3, not_in_creative_inventory=1}},
{"default:sandstone","default_sandstone", "Sandstone", {crumbly=2, not_in_creative_inventory=1}}, {"default:sandstone","default_sandstone", "Sandstone", {crumbly=2, not_in_creative_inventory=1}},
{"default:clay","default_clay", "Clay", {crumbly=3, not_in_creative_inventory=1}}, {"default:clay","default_clay", "Clay", {crumbly=3, not_in_creative_inventory=1}},
{"default:coalblock","default_coal_block", "Coal Block", {cracky = 3, not_in_creative_inventory=1}}, {"default:coalblock","default_coal_block", "Coal Block", {cracky = 3, not_in_creative_inventory=1}},
@ -463,5 +503,81 @@ minetest.register_node("mychisel:cross_"..mat.."4", {
node_box = cross4, node_box = cross4,
selection_box = cross4 selection_box = cross4
})
minetest.register_node("mychisel:square_"..mat.."1", {
description = "cross "..desc.."1",
drawtype = "nodebox",
tiles = {
mat..".png",
mat..".png",
mat..".png",
mat..".png",
mat..".png",
mat..".png^mychisel_stint.png",
},
paramtype = "light",
paramtype2 = "facedir",
drop = item,
groups = gro,
node_box = squar1,
selection_box = squar1
})
minetest.register_node("mychisel:square_"..mat.."2", {
description = "cross"..desc.."2",
drawtype = "nodebox",
tiles = {
mat..".png",
mat..".png",
mat..".png",
mat..".png",
mat..".png",
mat..".png^mychisel_stint.png",
},
paramtype = "light",
paramtype2 = "facedir",
drop = item,
groups = gro,
node_box = squar2,
selection_box = squar2
})
minetest.register_node("mychisel:square_"..mat.."3", {
description = "cross"..desc.."3",
drawtype = "nodebox",
tiles = {
mat..".png",
mat..".png",
mat..".png",
mat..".png",
mat..".png",
mat..".png^mychisel_stint.png",
},
paramtype = "light",
paramtype2 = "facedir",
drop = item,
groups = gro,
node_box = squar3,
selection_box = squar3
})
minetest.register_node("mychisel:square_"..mat.."4", {
description = "cross"..desc.."4",
drawtype = "nodebox",
tiles = {
mat..".png",
mat..".png",
mat..".png",
mat..".png",
mat..".png",
mat..".png^mychisel_stint.png",
},
paramtype = "light",
paramtype2 = "facedir",
drop = item,
groups = gro,
node_box = squar4,
selection_box = squar4
}) })
end end

BIN
textures/mychisel_stint.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B