forked from MineClone5/MineClone5
Add carrot on a stick
This commit is contained in:
parent
77e9502945
commit
4bc5320f95
|
@ -208,6 +208,13 @@ minetest.register_craftitem("mcl_mobitems:rabbit_stew", {
|
||||||
groups = { food = 3, eatable = 10 },
|
groups = { food = 3, eatable = 10 },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_tool("mcl_mobitems:carrot_on_a_stick", {
|
||||||
|
description = "Carrot on a Stick",
|
||||||
|
wield_image = "mcl_mobitems_carrot_on_a_stick.png",
|
||||||
|
inventory_image = "mcl_mobitems_carrot_on_a_stick.png",
|
||||||
|
groups = { transport = 1 },
|
||||||
|
})
|
||||||
|
|
||||||
-----------
|
-----------
|
||||||
-- Crafting
|
-- Crafting
|
||||||
-----------
|
-----------
|
||||||
|
@ -234,6 +241,22 @@ minetest.register_craft({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "mcl_mobitems:carrot_on_a_stick",
|
||||||
|
recipe = {
|
||||||
|
{ "mcl_fishing:fishing_rod", "", },
|
||||||
|
{ "", "mcl_farming:carrot_item" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "mcl_mobitems:carrot_on_a_stick",
|
||||||
|
recipe = {
|
||||||
|
{ "", "mcl_fishing:fishing_rod", },
|
||||||
|
{ "mcl_farming:carrot_item", "" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "mcl_mobitems:magma_cream",
|
output = "mcl_mobitems:magma_cream",
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 366 B |
|
@ -89,26 +89,25 @@ mobs:register_mob("mobs_mc:pig", {
|
||||||
if self.driver and clicker == self.driver then
|
if self.driver and clicker == self.driver then
|
||||||
self.driver = nil
|
self.driver = nil
|
||||||
clicker:set_detach()
|
clicker:set_detach()
|
||||||
default.player_attached[name] = false
|
mcl_core.player_attached[name] = false
|
||||||
default.player_set_animation(clicker, "stand" , 30)
|
mcl_core.player_set_animation(clicker, "stand" , 30)
|
||||||
elseif not self.driver and self.saddle == "yes" then
|
elseif not self.driver and self.saddle == "yes" then
|
||||||
self.driver = clicker
|
self.driver = clicker
|
||||||
clicker:set_attach(self.object, "", {x = 0, y = 19, z = 0}, {x = 0, y = 0, z = 0})
|
clicker:set_attach(self.object, "", {x = 0, y = 19, z = 0}, {x = 0, y = 0, z = 0})
|
||||||
default.player_attached[name] = true
|
mcl_core.player_attached[name] = true
|
||||||
minetest.after(0.2, function()
|
minetest.after(0.2, function()
|
||||||
default.player_set_animation(clicker, "sit" , 30)
|
mcl_core.player_set_animation(clicker, "sit" , 30)
|
||||||
end)
|
end)
|
||||||
----[[
|
----[[
|
||||||
-- ridable pigs
|
-- ridable pigs
|
||||||
if self.name == "mobs:pig" and self.saddle == "yes" and self.driver then
|
if self.name == "mobs_mc:pig" and self.saddle == "yes" and self.driver then
|
||||||
local item = self.driver:get_wielded_item()
|
local item = self.driver:get_wielded_item()
|
||||||
if item:get_name() == "mobs:carrotstick" then
|
if item:get_name() == "mcl_mobitems:carrot_on_a_stick" then
|
||||||
local yaw = self.driver:get_look_yaw() - math.pi / 2
|
local yaw = self.driver:get_look_yaw() - math.pi / 2
|
||||||
local velo = self.object:getvelocity()
|
local velo = self.object:getvelocity()
|
||||||
local v = 1.5
|
local v = 1.5
|
||||||
if math.abs(velo.x) + math.abs(velo.z) < .6 then velo.y = 5 end
|
if math.abs(velo.x) + math.abs(velo.z) < .6 then velo.y = 5 end
|
||||||
self.state = "walk"
|
self.state = "walk"
|
||||||
self:set_animation("walk")
|
|
||||||
self.object:setyaw(yaw)
|
self.object:setyaw(yaw)
|
||||||
self.object:setvelocity({x = -math.sin(yaw) * v, y = velo.y, z = math.cos(yaw) * v})
|
self.object:setvelocity({x = -math.sin(yaw) * v, y = velo.y, z = math.cos(yaw) * v})
|
||||||
|
|
||||||
|
@ -116,7 +115,7 @@ mobs:register_mob("mobs_mc:pig", {
|
||||||
local stack = inv:get_stack("main", self.driver:get_wield_index())
|
local stack = inv:get_stack("main", self.driver:get_wield_index())
|
||||||
stack:add_wear(100)
|
stack:add_wear(100)
|
||||||
if stack:get_wear() > 65400 then
|
if stack:get_wear() > 65400 then
|
||||||
stack = {name = "fishing:pole", count = 1}
|
stack = {name = "mcl_fishing:fishing_rod", count = 1}
|
||||||
end
|
end
|
||||||
inv:set_stack("main", self.driver:get_wield_index(), stack)
|
inv:set_stack("main", self.driver:get_wield_index(), stack)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue