123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- minetest.register_craftitem("farming:cotton_seed", {
- description = "Cotton Seeds",
- inventory_image = "farming_cotton_seed.png",
- on_place = function(itemstack, placer, pointed_thing)
- local above = minetest.env:get_node(pointed_thing.above)
- if above.name == "air" then
- above.name = "farming:cotton_1"
- minetest.env:set_node(pointed_thing.above, above)
- itemstack:take_item(1)
- return itemstack
- end
- end
- })
- minetest.register_node("farming:cotton_1", {
- paramtype = "light",
- sunlight_propagates = true,
- walkable = false,
- drawtype = "raillike",
- drop = "",
- tiles = {"farming_cotton_seed.png"},
- selection_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.5, 0.5, -0.5, 0.5}
- },
- },
- groups = {snappy=3, flammable=2, not_in_creative_inventory=1, attached_node=1},
- sounds = default.node_sound_leaves_defaults(),
- })
- minetest.register_node("farming:cotton_2", {
- paramtype = "light",
- sunlight_propagates = true,
- walkable = false,
- drawtype = "plantlike",
- drop = "",
- tiles = {"farming_cotton_2.png"},
- selection_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.5, 0.5, -0.5+12/16, 0.5}
- },
- },
- groups = {snappy=3, flammable=2, not_in_creative_inventory=1, attached_node=1},
- sounds = default.node_sound_leaves_defaults(),
- })
- minetest.register_node("farming:cotton", {
- paramtype = "light",
- sunlight_propagates = true,
- walkable = false,
- drawtype = "nodebox",
- tiles = {"farming_cotton.png"},
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5/5, -2.5/5, -0.5/5, 0.5/5, -1.5/5, 0.5/5},
- {0.5/5, -1.5/5, -1.5/5, 1.5/5, 1.5/5, -0.5/5},
- {-1.5/5, -1.5/5, 0.5/5, -0.5/5, 1.5/5, 1.5/5},
- {0.5/5, -1.5/5, 0.5/5, 1.5/5, 1.5/5, 1.5/5},
- {-1.5/5, -1.5/5, -1.5/5, -0.5/5, 1.5/5, -0.5/5},
- {-2.5/5, 0.5/5, -2.5/5, -1.5/5, 2.5/5, -1.5/5},
- {1.5/5, 0.5/5, -2.5/5, 2.5/5, 2.5/5, -1.5/5},
- {1.5/5, 0.5/5, 1.5/5, 2.5/5, 2.5/5, 2.5/5},
- {-2.5/5, 0.5/5, 1.5/5, -1.5/5, 2.5/5, 2.5/5},
- }
- },
- drop = {
- max_items = 6,
- items = {
- { items = {'farming:cotton_seed'} },
- { items = {'farming:cotton_seed'}, rarity = 2},
- { items = {'farming:cotton_seed'}, rarity = 5},
- { items = {'farming:string'} },
- { items = {'farming:string'}, rarity = 2 },
- { items = {'farming:string'}, rarity = 5 }
- }
- },
- groups = {snappy=3, flammable=2, not_in_creative_inventory=1, attached_node=1},
- sounds = default.node_sound_leaves_defaults(),
- })
- farming:add_plant("farming:cotton", {"farming:cotton_1", "farming:cotton_2"}, 50, 20)
- minetest.register_craftitem("farming:string", {
- description = "String",
- inventory_image = "farming_string.png",
- })
- minetest.register_craft({
- output = "wool:white",
- recipe = {{"farming:string"}}
- })
- -- ========= FUEL =========
- minetest.register_craft({
- type = "fuel",
- recipe = "farming:cotton_seed",
- burntime = 1
- })
- minetest.register_craft({
- type = "fuel",
- recipe = "farming:string",
- burntime = 1
- })
|