]> git.lizzy.rs Git - Crafter.git/commitdiff
Chickens now drop eggs and feathers
authoroilboi <47129783+oilboi@users.noreply.github.com>
Thu, 28 May 2020 08:46:55 +0000 (04:46 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Thu, 28 May 2020 08:46:55 +0000 (04:46 -0400)
README.md
mods/mob/api/interaction.lua
mods/mob/init.lua
mods/mob/items.lua
mods/mob/textures/attributes.txt
mods/mob/textures/feather.png [new file with mode: 0644]

index dacf7f73877739738582dc298db6342dd5ce5d52..74e926e18ad9f102732b7cf804481ba34000d4c0 100644 (file)
--- a/README.md
+++ b/README.md
@@ -37,6 +37,7 @@ enable_mod_channels = true
 - Players now use the same damage mechaninism as mobs
 - Fixed wrong variable for durability assigned to all swords
 - Fix bug in experience
+- Fully implemented bows and arrows
 ---
 
 
index c1a4b4753563aa8375304ddab47f5df8102c70b8..3efcbac6ac9a3f62d1ea0933d75f5f31c4c358f3 100644 (file)
@@ -242,14 +242,20 @@ mobs.create_interaction_functions = function(def,mob_register)
                
                --only throw items if registered
                if self.item_drop then
+                       local item
+                       if type(self.item_drop) == "string" then
+                               item = self.item_drop
+                       elseif type(self.item_drop) == "table" then
+                               item = self.item_drop[math.random(1,table.getn(self.item_drop))]
+                       end
                        --detect if multiple items are going to be added
                        if self.item_max then
                                local data_item_amount = math.random(self.item_minimum, self.item_max)
                                for i = 1 ,data_item_amount do
-                                       minetest.throw_item(vector.new(pos.x,pos.y+0.1,pos.z),self.item_drop)
+                                       minetest.throw_item(vector.new(pos.x,pos.y+0.1,pos.z),item)
                                end
                        else
-                               minetest.throw_item(vector.new(pos.x,pos.y+0.1,pos.z),self.item_drop)
+                               minetest.throw_item(vector.new(pos.x,pos.y+0.1,pos.z),item)
                        end
                end
                        
index 10cc5fb57f54db3f499d1e6fbc8f0e963a8dff4e..abcc7fe51f08476550d469706a5b95f959e34cfc 100644 (file)
@@ -117,7 +117,7 @@ mobs.register_mob(
         state = 0,
         view_distance = 15,
         
-        item_drop = "mob:egg"
+        item_drop = {"mob:egg","mob:feather"}
         standing_frame = {x=20,y=20},
         moving_frame = {x=0,y=20},
         animation_multiplier = 15,
index 681c46f7fd0735ec7364cd056b6f3fee58a06fc4..7ad1adf0852b2ce62626c4b29b84ead1ef2daea7 100644 (file)
@@ -26,6 +26,12 @@ minetest.register_craftitem("mob:slimeball", {
        description = "Slimeball",
        inventory_image = "slimeball.png",
 })
+
+minetest.register_craftitem("mob:feather", {
+       description = "Feather",
+       inventory_image = "feather.png",
+})
+
 minetest.register_craftitem("mob:gunpowder", {
        description = "Gunpowder",
        inventory_image = "gunpowder.png",
index 3ef248ca529f19c3273c4a1932b4f8e2e99be555..03aa87b123ce33066001546804b09dbc5d5189e7 100644 (file)
@@ -1,4 +1,5 @@
 mob skins - 22i https://github.com/22i
 gunpowder, porkchop - https://github.com/minetest-texture-packs/Pixel-Perfection
 string, slimeball - oil_boi
-egg - Mineclone
\ No newline at end of file
+egg - Mineclone
+feather - Mineclone
\ No newline at end of file
diff --git a/mods/mob/textures/feather.png b/mods/mob/textures/feather.png
new file mode 100644 (file)
index 0000000..a3d0a3d
Binary files /dev/null and b/mods/mob/textures/feather.png differ