]> git.lizzy.rs Git - Crafter.git/commitdiff
Added sugarcane, paper, sugar. Sugar is food. Books are now made out of paper. Sugarc...
authoroilboi <47129783+oilboi@users.noreply.github.com>
Wed, 22 Apr 2020 10:18:30 +0000 (06:18 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Wed, 22 Apr 2020 10:18:30 +0000 (06:18 -0400)
README.md
mods/book/init.lua
mods/farming/init.lua
mods/main/craft_recipes.lua
mods/main/items.lua
mods/main/mapgen.lua
mods/main/nodes.lua
mods/main/textures/paper.png [new file with mode: 0644]
mods/main/textures/sugar.png [new file with mode: 0644]
mods/main/textures/sugarcane.png [new file with mode: 0644]
mods/too_many_items/init.lua

index ef709b6296c20d22cc7d631cee8fc8126ba3ade6..db032156ca5ad2dd84adb2b3af30106b206fa96d 100644 (file)
--- a/README.md
+++ b/README.md
 - Added in the early prototype of the VOID (made of bedrock for now)
 - Make it so you can place down beds in the nether and void, but they explode when you try to sleep in them
 - Made TNT even more efficient, stopped dropping of bedrock and obsidian
+- Added sugarcane, sugar, and paper
+- Books are now made out of paper and wood
+- Made sugarcane grow near water
 ---
 
 
index 27f2f9427a4ee660d311ec75fce0a966af43e2a0..40345aefa54e59a017ef6826b4bd6aa8d2b2a90b 100644 (file)
@@ -86,7 +86,7 @@ minetest.register_craftitem("book:book",{
                        minetest.item_place(itemstack, user, pointed_thing)
                        return
                end
-               print("make books placable on the ground")
+               --print("make books placable on the ground")
                open_book_gui(itemstack, user)
        end,
 
@@ -112,7 +112,7 @@ minetest.register_craftitem("book:book_written",{
                        minetest.item_place(itemstack, user, pointed_thing)
                        return
                end
-               print("make books placable on the ground")
+               --print("make books placable on the ground")
                open_book_inked_gui(itemstack, user)
        end,
 
@@ -125,9 +125,9 @@ minetest.register_craftitem("book:book_written",{
 minetest.register_craft({
        output = "book:book",
        recipe = {
-               {"main:wood","weather:snowball","main:wood"},
-               {"main:wood","weather:snowball","main:wood"},
-               {"main:wood","weather:snowball","main:wood"},
+               {"main:wood","main:wood","main:wood"},
+               {"main:paper","main:paper","main:paper"},
+               {"main:wood","main:wood","main:wood"},
        }
 })
 --book book book
index 3d6ed12a3b335ea4aea403e8f45f7440b8971ae8..4c7d085d104e023a1f6979a633f24bb71f9224a6 100644 (file)
@@ -175,6 +175,7 @@ minetest.register_node("farming:grass", {
     description = "Tall Grass",
     drawtype = "plantlike",
        waving = 1,
+       inventory_image = "tallgrass.png",
        walkable = false,
        climbable = false,
        paramtype = "light",
@@ -206,6 +207,23 @@ minetest.register_node("farming:grass", {
        },
 })
 
+--register sugarcane in here since it's part of farming
+minetest.register_abm({
+       label = "Sugarcane Grow",
+       nodenames = {"main:sugarcane"},
+       neighbors = {"air"},
+       interval = 3,
+       chance = 150,
+       action = function(pos)
+               local found = minetest.find_node_near(pos, 4, {"main:water","main:waterflow"})
+               if found then
+                       pos.y = pos.y + 1
+                       if minetest.get_node(pos).name == "air" then
+                               minetest.set_node(pos,{name="main:sugarcane"})
+                       end
+               end
+       end,
+})
 
 --wheat definitions
 local wheat_max = 7
index 01115ac3c726b99986bf4b8d3a4fa04a31bc711c..40d1e63b2501fd536fdb380eda0a9826a0524484 100644 (file)
@@ -57,6 +57,11 @@ minetest.register_craft({
        recipe = "main:sapling",
        burntime = 1,
 })
+minetest.register_craft({
+       type = "fuel",
+       recipe = "main:paper",
+       burntime = 1,
+})
 minetest.register_craft({
        type = "fuel",
        recipe = "main:tree",
@@ -83,6 +88,11 @@ minetest.register_craft({
        output = "main:wood 4",
        recipe = {"main:tree"},
 })
+minetest.register_craft({
+       type = "shapeless",
+       output = "main:sugar 3",
+       recipe = {"main:sugarcane"},
+})
 
 minetest.register_craft({
        output = "main:stick 4",
@@ -92,6 +102,13 @@ minetest.register_craft({
        }
 })
 
+minetest.register_craft({
+       output = "main:paper",
+       recipe = {
+               {"main:sugarcane","main:sugarcane","main:sugarcane"},
+       }
+})
+
 local tool =     {"wood","stone", "iron","gold","diamond"}--the tool name
 local material = {"wood","cobble","iron","gold","diamond"}--material to craft
 
index 10e32871edb5f182c22a267e87cece30c043edaf..3bd50dfbbaa910b4ccd6fb11348bf6535e364e5f 100644 (file)
@@ -6,11 +6,22 @@ minetest.register_craftitem("main:apple", {
        health = 1,
 })
 
+minetest.register_craftitem("main:sugar", {
+       description = "Sugar",
+       inventory_image = "sugar.png",
+       health = 1,
+})
+
 minetest.register_craftitem("main:stick", {
        description = "Stick",
        inventory_image = "stick.png",
        groups = {stick = 1}
 })
+minetest.register_craftitem("main:paper", {
+       description = "Paper",
+       inventory_image = "paper.png",
+       groups = {paper = 1}
+})
 
 minetest.register_craftitem("main:coal", {
        description = "Coal",
index 0146e221ce26ea1df899a12fcb55b6b47f10e8eb..cf210eea4cbe35d4914bd4a3e82a97eb48c79454 100644 (file)
@@ -102,3 +102,25 @@ minetest.register_decoration({
        flags = "place_center_x, place_center_z",
        rotation = "random",
 })
+
+minetest.register_decoration({
+       name = "main:sugarcane",
+       deco_type = "simple",
+       place_on = {"main:dirt","main:grass","main:sand"},
+       sidelen = 16,
+       noise_params = {
+               offset = -0.3,
+               scale = 0.7,
+               spread = {x = 100, y = 100, z = 100},
+               seed = 354,
+               octaves = 3,
+               persist = 0.7
+       },
+       y_max = 1,
+       y_min = 1,
+       decoration = "main:sugarcane",
+       height = 2,
+       height_max = 5,
+       spawn_by = "main:water",
+       num_spawn_by = 1,
+})
index bccea10639f420ff61a6c1ca1b943ee7dea3a473..d9f6a0c71972319ffa3c5e2c7d4515d102386ba9 100644 (file)
@@ -97,10 +97,47 @@ minetest.register_node("main:grass", {
 minetest.register_node("main:sand", {
     description = "Sand",
     tiles = {"sand.png"},
-    groups = {sand = 1, falling_node = 1,pathable = 1},
+    groups = {sand = 1, falling_node = 1,pathable = 1,soil=1},
     sounds = main.sandSound(),
 })
 
+minetest.register_node("main:sugarcane", {
+    description = "Sugarcane",
+    drawtype = "plantlike",
+    inventory_image = "sugarcane.png",
+       waving = 1,
+       walkable = false,
+       paramtype = "light",
+       is_ground_content = false,      
+    tiles = {"sugarcane.png"},
+    buildable_to = false,
+    node_placement_prediction = "",
+    groups = {dig_immediate=1,flammable=1},
+    sounds = main.grassSound(),
+    floodable = true,
+    on_place = function(itemstack, placer, pointed_thing)
+               local n =  minetest.get_node_group(minetest.get_node(pointed_thing.under).name,"soil") > 0
+               if n then
+                       return(minetest.item_place(itemstack, placer, pointed_thing))
+               end
+    end,
+    after_dig_node = function(pos, node, metadata, digger)
+               if digger == nil then return end
+               local np = {x = pos.x, y = pos.y + 1, z = pos.z}
+               local nn = minetest.get_node(np)
+               if nn.name == node.name then
+                       minetest.node_dig(np, nn, digger)
+               end
+       end,
+    on_flood = function(pos, oldnode, newnode)
+               minetest.throw_item(pos, "main:sugarcane")
+       end,
+    selection_box = {
+               type = "fixed",
+               fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.5, 7 / 16}
+       },
+})
+
 minetest.register_node("main:gravel", {
     description = "Gravel",
     tiles = {"gravel.png"},
diff --git a/mods/main/textures/paper.png b/mods/main/textures/paper.png
new file mode 100644 (file)
index 0000000..083964e
Binary files /dev/null and b/mods/main/textures/paper.png differ
diff --git a/mods/main/textures/sugar.png b/mods/main/textures/sugar.png
new file mode 100644 (file)
index 0000000..66625c1
Binary files /dev/null and b/mods/main/textures/sugar.png differ
diff --git a/mods/main/textures/sugarcane.png b/mods/main/textures/sugarcane.png
new file mode 100644 (file)
index 0000000..b6e2062
Binary files /dev/null and b/mods/main/textures/sugarcane.png differ
index 986de9f1a2f3c74afbea500687f63245b69bbc69..ef93e4eba480ee3c8cb1e7f931d4f7b99128a9b4 100644 (file)
@@ -11,16 +11,18 @@ minetest.register_on_mods_loaded(function()
                                --single drop parents
                                if type(data.drop) == "string" then
                                        --add parent to dropped items
-                                       local droppers = minetest.registered_items[data.drop].parent_dropper
-                                       if not droppers then
-                                               --print(data.name)
-                                               droppers = {}
+                                       if minetest.registered_items[data.drop] then
+                                               local droppers = minetest.registered_items[data.drop].parent_dropper
+                                               if not droppers then
+                                                       --print(data.name)
+                                                       droppers = {}
+                                               end
+                                               
+                                               table.insert(droppers, data.name)
+                                               minetest.override_item(data.drop, {
+                                                       parent_dropper = droppers
+                                               })
                                        end
-                                       
-                                       table.insert(droppers, data.name)
-                                       minetest.override_item(data.drop, {
-                                               parent_dropper = droppers
-                                       })
                                --multiple drop parents
                                elseif type(data.drop) == "table" then
                                        if data.drop.items then