add player made paths w/ api and make hoes use right mouse
parent
16d169072c
commit
bcb8788161
|
@ -110,7 +110,7 @@ minetest.register_tool("farming:hoe_wood", {
|
|||
description = "Wooden Hoe",
|
||||
inventory_image = "farming_tool_woodhoe.png",
|
||||
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
return farming.hoe_on_use(itemstack, user, pointed_thing, 30)
|
||||
end,
|
||||
})
|
||||
|
@ -119,7 +119,7 @@ minetest.register_tool("farming:hoe_stone", {
|
|||
description = "Stone Hoe",
|
||||
inventory_image = "farming_tool_stonehoe.png",
|
||||
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
return farming.hoe_on_use(itemstack, user, pointed_thing, 90)
|
||||
end,
|
||||
})
|
||||
|
@ -128,7 +128,7 @@ minetest.register_tool("farming:hoe_steel", {
|
|||
description = "Steel Hoe",
|
||||
inventory_image = "farming_tool_steelhoe.png",
|
||||
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
return farming.hoe_on_use(itemstack, user, pointed_thing, 200)
|
||||
end,
|
||||
})
|
||||
|
@ -137,7 +137,7 @@ minetest.register_tool("farming:hoe_bronze", {
|
|||
description = "Bronze Hoe",
|
||||
inventory_image = "farming_tool_bronzehoe.png",
|
||||
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
return farming.hoe_on_use(itemstack, user, pointed_thing, 220)
|
||||
end,
|
||||
})
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -3,7 +3,8 @@
|
|||
|
||||
minetest.register_node(":flowers:dandelion_white", {
|
||||
description = "White Dandelion",
|
||||
drawtype = "plantlike",
|
||||
drawtype = "mesh",
|
||||
mesh = "dandelion.b3d",
|
||||
tiles = { "flowers_dandelion_white.png" },
|
||||
inventory_image = "flowers_dandelion_white.png",
|
||||
wield_image = "flowers_dandelion_white.png",
|
||||
|
@ -22,7 +23,8 @@ minetest.register_node(":flowers:dandelion_white", {
|
|||
|
||||
minetest.register_node(":flowers:dandelion_yellow", {
|
||||
description = "Yellow Dandelion",
|
||||
drawtype = "plantlike",
|
||||
drawtype = "mesh",
|
||||
mesh = "dandelion.b3d",
|
||||
tiles = { "flowers_dandelion_yellow.png" },
|
||||
inventory_image = "flowers_dandelion_yellow.png",
|
||||
wield_image = "flowers_dandelion_yellow.png",
|
||||
|
@ -41,7 +43,8 @@ minetest.register_node(":flowers:dandelion_yellow", {
|
|||
|
||||
minetest.register_node(":flowers:geranium", {
|
||||
description = "Blue Geranium",
|
||||
drawtype = "plantlike",
|
||||
drawtype = "mesh",
|
||||
mesh = "geranium.b3d",
|
||||
tiles = { "flowers_geranium.png" },
|
||||
inventory_image = "flowers_geranium.png",
|
||||
wield_image = "flowers_geranium.png",
|
||||
|
@ -60,7 +63,8 @@ minetest.register_node(":flowers:geranium", {
|
|||
|
||||
minetest.register_node(":flowers:rose", {
|
||||
description = "Rose",
|
||||
drawtype = "plantlike",
|
||||
drawtype = "mesh",
|
||||
mesh = "rose.b3d",
|
||||
tiles = { "flowers_rose.png" },
|
||||
inventory_image = "flowers_rose.png",
|
||||
wield_image = "flowers_rose.png",
|
||||
|
@ -79,7 +83,8 @@ minetest.register_node(":flowers:rose", {
|
|||
|
||||
minetest.register_node(":flowers:tulip", {
|
||||
description = "Tulip",
|
||||
drawtype = "plantlike",
|
||||
drawtype = "mesh",
|
||||
mesh = "tulip.b3d",
|
||||
tiles = { "flowers_tulip.png" },
|
||||
inventory_image = "flowers_tulip.png",
|
||||
wield_image = "flowers_tulip.png",
|
||||
|
@ -98,7 +103,8 @@ minetest.register_node(":flowers:tulip", {
|
|||
|
||||
minetest.register_node(":flowers:viola", {
|
||||
description = "Viola",
|
||||
drawtype = "plantlike",
|
||||
drawtype = "mesh",
|
||||
mesh = "viola.b3d",
|
||||
tiles = { "flowers_viola.png" },
|
||||
inventory_image = "flowers_viola.png",
|
||||
wield_image = "flowers_viola.png",
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
default
|
|
@ -0,0 +1,46 @@
|
|||
-- init.lua
|
||||
-- for making playermade paths with specialised tools.
|
||||
|
||||
local function register_path_node(name, textures, desc, sound, group, drops)
|
||||
minetest.register_node("paths_api:"..name, {
|
||||
description = desc,
|
||||
tiles = textures,
|
||||
sounds = sound,
|
||||
groups = group,
|
||||
drop = drops,
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0.5, (0.5-0.0625), 0.5, -0.5, -0.5, -0.5},
|
||||
},
|
||||
},
|
||||
paramtype = "light",
|
||||
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craftitem("paths_api:path_tool", {
|
||||
description = "Path Creation Tool",
|
||||
inventory_image = "paths_api_path_tool.png",
|
||||
stack_max = 1,
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
node = minetest.get_node(pointed_thing.under)
|
||||
|
||||
--print (node.name)
|
||||
|
||||
if node.name == "mapgen:grass" or node.name == "mapgen:grass1" or node.name == "mapgen:grass2" or node.name == "mapgen:grass3" or node.name == "mapgen:grass4" or node.name == "mapgen:snowy_grass" then
|
||||
minetest.add_node(pointed_thing.under,{name="paths_api:grass_path"})
|
||||
elseif node.name == "mapgen:dirt" then
|
||||
minetest.add_node(pointed_thing.under,{name="paths_api:dirt_path"})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
register_path_node("grass_path", {"paths_grass_top.png", "mapgen_dirt.png", "mapgen_dirt.png^paths_grass_side.png"}, "Grass Path", default.node_sound_dirt_defaults(), {crumbly=3}, "mapgen:dirt 1")
|
||||
|
||||
register_path_node("dirt_path", {"paths_dirt.png"}, "Dirt Path", default.node_sound_dirt_defaults(), {crumbly=3}, "mapgen:dirt 1")
|
Binary file not shown.
After Width: | Height: | Size: 364 B |
Binary file not shown.
After Width: | Height: | Size: 825 B |
Binary file not shown.
After Width: | Height: | Size: 672 B |
Binary file not shown.
After Width: | Height: | Size: 550 B |
|
@ -414,3 +414,6 @@ stairs.register_stair_and_slab("red_wool", "wool:red", {snappy=2,c
|
|||
stairs.register_stair_and_slab("violet_wool", "wool:violet", {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1}, {"wool_violet.png"}, "Violet Wool Stair", "Violet Wool Slab", "Violet Wool Corner Stair")
|
||||
stairs.register_stair_and_slab("white_wool", "wool:white", {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1}, {"wool_white.png"}, "White Wool Stair", "White Wool Slab", "White Wool Corner Stair")
|
||||
stairs.register_stair_and_slab("yellow_wool", "wool:yellow", {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1}, {"wool_yellow.png"}, "Yellow Wool Stair", "Yellow Wool Slab", "Yellow Wool Corner Stair")
|
||||
|
||||
stairs.register_stair_and_slab("dirt", "mapgen:dirt", {crumbly=3}, {"mapgen_dirt.png"}, "Dirt Stair", "Dirt Slab", "Dirt Corner Stair", default.node_sound_dirt_defaults())
|
||||
stairs.register_stair_and_slab("grass", "mapgen:grass", {crumbly=3}, {"mapgen_grass.png"}, "Grassy Stair", "Grassy Slab", "Grassy Corner Stair", default.node_sound_dirt_defaults())
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
-- special variable used to concatenate
|
||||
|
||||
co = "player_"
|
||||
local co = "player_"
|
||||
|
||||
-- create a table to store skins texture names and player names, requires -two tables- one table
|
||||
-- i worked out an optimisation
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 194 B After Width: | Height: | Size: 312 B |
Loading…
Reference in New Issue