]> git.lizzy.rs Git - Crafter.git/commitdiff
Creepers now drop gunpowder and tnt is made from it
authoroilboi <47129783+oilboi@users.noreply.github.com>
Tue, 19 May 2020 21:02:01 +0000 (17:02 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Tue, 19 May 2020 21:02:01 +0000 (17:02 -0400)
mods/mob/api/interaction.lua
mods/mob/init.lua
mods/mob/items.lua
mods/mob/textures/gunpowder.png [new file with mode: 0644]
mods/tnt/init.lua

index c554376e4d25727a30db80e9eea53aa06aa467a1..6cc828ed0e5021d7a5a78127f8c03e9bdf33d385 100644 (file)
@@ -207,10 +207,10 @@ mobs.create_interaction_functions = function(def,mob_register)
                        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(pos,self.item_drop)
+                                       minetest.throw_item(vector.new(pos.x,pos.y+0.1,pos.z),self.item_drop)
                                end
                        else
-                               minetest.throw_item(pos,self.item_drop)
+                               minetest.throw_item(vector.new(pos.x,pos.y+0.1,pos.z),self.item_drop)
                        end
                end
                        
index dfa2c278ab9995b5ceadb43c1ef1c7e4597f0c74..4fbfe02631124b00b0c196996b14fe942b384869 100644 (file)
@@ -445,7 +445,7 @@ mobs.register_mob(
         hostile_cooldown = false,
         state = 0,
         view_distance = 20,
-        item_drop = "mob:cooked_porkchop",
+        item_drop = "mob:gunpowder",
          
         standing_frame = {x=0,y=0},
         moving_frame = {x=0,y=40},
@@ -511,7 +511,7 @@ mobs.register_mob(
         hostile_cooldown = false,
         state = 0,
         view_distance = 20,
-        item_drop = "mob:cooked_porkchop",
+        item_drop = "mob:gunpowder",
 
         damage_color = "blue",
          
index a184fd01b922fc63b3b4b86a1dbe575dd2de62e3..663eee4b68ab11fbf537c3d8031141c5fffc50cc 100644 (file)
@@ -14,6 +14,10 @@ minetest.register_craftitem("mob:slimeball", {
        description = "Slimeball",
        inventory_image = "slimeball.png",
 })
+minetest.register_craftitem("mob:gunpowder", {
+       description = "Gunpowder",
+       inventory_image = "gunpowder.png",
+})
 --cooking
 minetest.register_craft({
        type = "cooking",
diff --git a/mods/mob/textures/gunpowder.png b/mods/mob/textures/gunpowder.png
new file mode 100644 (file)
index 0000000..e0209e8
Binary files /dev/null and b/mods/mob/textures/gunpowder.png differ
index 30c4bb48628183995cef5be26851808af9536bd7..427daf7a39370ec9fa609b7cfde57a75d9c790cb 100644 (file)
@@ -376,8 +376,8 @@ minetest.register_node("tnt:uh_oh", {
 minetest.register_craft({
        output = "tnt:tnt",
        recipe = {
-               {"main:wood", "main:wood", "main:wood"},
-               {"main:wood", "main:coal", "main:wood"},
-               {"main:wood", "main:wood", "main:wood"},
+               {"mob:gunpowder", "main:sand",     "mob:gunpowder"},
+               {"main:sand",     "mob:gunpowder", "main:sand"},
+               {"mob:gunpowder", "main:sand",     "mob:gunpowder"},
        },
 })