Compare commits
13 Commits
39f4ffa2d9
...
master
Author | SHA1 | Date | |
---|---|---|---|
68e2cea3dc | |||
fc9d714f63 | |||
aad2103dd3 | |||
2d9f94f5c7 | |||
8480571665 | |||
1d9674721f | |||
8d5fb34534 | |||
b8dade7498 | |||
810239fadc | |||
3792d1cf3c | |||
d76893ccb8 | |||
1640a32619 | |||
e4f16e4911 |
BIN
alt_textures/mobs_cheeseblock_32px.png
Normal file
After Width: | Height: | Size: 609 B |
36
bee.lua
@ -1,5 +1,5 @@
|
||||
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local S = core.get_translator("mobs_animal")
|
||||
|
||||
-- Bee by KrupnoPavel (.b3d model by sirrobzeroone)
|
||||
|
||||
@ -8,7 +8,7 @@ mobs:register_mob("mobs_animal:bee", {
|
||||
passive = true,
|
||||
hp_min = 1,
|
||||
hp_max = 2,
|
||||
armor = 200,
|
||||
armor = 100,
|
||||
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.5, 0.2},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_bee.b3d",
|
||||
@ -68,10 +68,10 @@ mobs:alias_mob("mobs:bee", "mobs_animal:bee")
|
||||
|
||||
-- honey
|
||||
|
||||
minetest.register_craftitem(":mobs:honey", {
|
||||
core.register_craftitem(":mobs:honey", {
|
||||
description = S("Honey"),
|
||||
inventory_image = "mobs_honey_inv.png",
|
||||
on_use = minetest.item_eat(4),
|
||||
on_use = core.item_eat(4),
|
||||
groups = {food_honey = 1, food_sugar = 1}
|
||||
})
|
||||
|
||||
@ -79,7 +79,7 @@ mobs.add_eatable("mobs:honey", 4)
|
||||
|
||||
-- beehive (1 in 4 chance of spawning bee when placed)
|
||||
|
||||
minetest.register_node(":mobs:beehive", {
|
||||
core.register_node(":mobs:beehive", {
|
||||
description = S("Beehive"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"mobs_beehive.png"},
|
||||
@ -93,7 +93,7 @@ minetest.register_node(":mobs:beehive", {
|
||||
|
||||
on_construct = function(pos)
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
local meta = core.get_meta(pos)
|
||||
local gui_bg = default and default.gui_bg .. default.gui_bg_img .. default.gui_slots or ""
|
||||
|
||||
meta:set_string("formspec", "size[8,6]"
|
||||
@ -110,10 +110,10 @@ minetest.register_node(":mobs:beehive", {
|
||||
|
||||
if placer and placer:is_player() then
|
||||
|
||||
minetest.set_node(pos, {name = "mobs:beehive", param2 = 1})
|
||||
core.set_node(pos, {name = "mobs:beehive", param2 = 1})
|
||||
|
||||
if math.random(4) == 1 then
|
||||
minetest.add_entity(pos, "mobs_animal:bee")
|
||||
core.add_entity(pos, "mobs_animal:bee")
|
||||
end
|
||||
end
|
||||
end,
|
||||
@ -121,7 +121,7 @@ minetest.register_node(":mobs:beehive", {
|
||||
on_punch = function(pos, node, puncher)
|
||||
|
||||
-- yep, bee's don't like having their home punched by players
|
||||
minetest.after(0.2, function()
|
||||
core.after(0.2, function()
|
||||
|
||||
local hp = puncher and puncher:get_hp()
|
||||
|
||||
@ -138,7 +138,7 @@ minetest.register_node(":mobs:beehive", {
|
||||
|
||||
can_dig = function(pos,player) -- can only dig when no honey inside
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
local meta = core.get_meta(pos)
|
||||
|
||||
return meta:get_inventory():is_empty("beehive")
|
||||
end
|
||||
@ -146,14 +146,14 @@ minetest.register_node(":mobs:beehive", {
|
||||
|
||||
-- beehive recipe
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
output = "mobs:beehive",
|
||||
recipe = {{"mobs:bee","mobs:bee","mobs:bee"}}
|
||||
})
|
||||
|
||||
-- honey block and craft recipes
|
||||
|
||||
minetest.register_node(":mobs:honey_block", {
|
||||
core.register_node(":mobs:honey_block", {
|
||||
description = S("Honey Block"),
|
||||
tiles = {"mobs_honey_block.png"},
|
||||
groups = {snappy = 3, flammable = 2},
|
||||
@ -161,7 +161,7 @@ minetest.register_node(":mobs:honey_block", {
|
||||
sounds = mobs.node_sound_dirt_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
output = "mobs:honey_block",
|
||||
recipe = {
|
||||
{"mobs:honey", "mobs:honey", "mobs:honey"},
|
||||
@ -170,7 +170,7 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
output = "mobs:honey 9",
|
||||
recipe = {
|
||||
{"mobs:honey_block"}
|
||||
@ -179,7 +179,7 @@ minetest.register_craft({
|
||||
|
||||
-- beehive workings
|
||||
|
||||
minetest.register_abm({
|
||||
core.register_abm({
|
||||
nodenames = {"mobs:beehive"},
|
||||
interval = 12,
|
||||
chance = 6,
|
||||
@ -188,18 +188,18 @@ minetest.register_abm({
|
||||
action = function(pos, node)
|
||||
|
||||
-- bee's only make honey during the day
|
||||
local tod = (minetest.get_timeofday() or 0) * 24000
|
||||
local tod = (core.get_timeofday() or 0) * 24000
|
||||
|
||||
if tod < 5500 or tod > 18500 then return end
|
||||
|
||||
local meta = minetest.get_meta(pos) ; if not meta then return end
|
||||
local meta = core.get_meta(pos) ; if not meta then return end
|
||||
local inv = meta:get_inventory()
|
||||
local honey = inv:get_stack("beehive", 1):get_count()
|
||||
|
||||
if honey > 11 then return end -- return if hive full
|
||||
|
||||
-- no flowers no honey, nuff said!
|
||||
if #minetest.find_nodes_in_area_under_air(
|
||||
if #core.find_nodes_in_area_under_air(
|
||||
{x = pos.x - 4, y = pos.y - 3, z = pos.z - 4},
|
||||
{x = pos.x + 4, y = pos.y + 3, z = pos.z + 4}, "group:flower") > 3 then
|
||||
|
||||
|
32
bunny.lua
@ -1,5 +1,5 @@
|
||||
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local S = core.get_translator("mobs_animal")
|
||||
|
||||
-- Bunny by ExeterDad
|
||||
|
||||
@ -10,7 +10,7 @@ mobs:register_mob("mobs_animal:bunny", {
|
||||
stepheight = 0.6,
|
||||
hp_min = 1,
|
||||
hp_max = 4,
|
||||
armor = 200,
|
||||
armor = 100,
|
||||
collisionbox = {-0.268, -0.5, -0.268, 0.268, 0.167, 0.268},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_bunny.b3d",
|
||||
@ -69,7 +69,7 @@ mobs:register_mob("mobs_animal:bunny", {
|
||||
end
|
||||
|
||||
-- set special bunny attributes
|
||||
local staticdata = minetest.serialize({
|
||||
local staticdata = core.serialize({
|
||||
type = "monster",
|
||||
attack_type = "dogfight",
|
||||
health = 20,
|
||||
@ -84,7 +84,7 @@ mobs:register_mob("mobs_animal:bunny", {
|
||||
})
|
||||
|
||||
-- add evil bunny
|
||||
local obj = minetest.add_entity(
|
||||
local obj = core.add_entity(
|
||||
self.object:get_pos(), "mobs_animal:bunny", staticdata)
|
||||
|
||||
obj:set_properties({textures = {"mobs_bunny_evil.png"}, hp_max = 20})
|
||||
@ -99,19 +99,19 @@ mobs:register_mob("mobs_animal:bunny", {
|
||||
local pos = self.object:get_pos() ; pos.y = pos.y - 1
|
||||
|
||||
-- white snowy bunny
|
||||
if minetest.find_node_near(pos, 1,
|
||||
if core.find_node_near(pos, 1,
|
||||
{"default:snow", "default:snowblock", "default:dirt_with_snow"}) then
|
||||
self.base_texture = {"mobs_bunny_white.png"}
|
||||
self.object:set_properties({textures = self.base_texture})
|
||||
|
||||
-- brown desert bunny
|
||||
elseif minetest.find_node_near(pos, 1,
|
||||
elseif core.find_node_near(pos, 1,
|
||||
{"default:desert_sand", "default:desert_stone"}) then
|
||||
self.base_texture = {"mobs_bunny_brown.png"}
|
||||
self.object:set_properties({textures = self.base_texture})
|
||||
|
||||
-- grey stone bunny
|
||||
elseif minetest.find_node_near(pos, 1,
|
||||
elseif core.find_node_near(pos, 1,
|
||||
{"default:stone", "default:gravel"}) then
|
||||
self.base_texture = {"mobs_bunny_grey.png"}
|
||||
self.object:set_properties({textures = self.base_texture})
|
||||
@ -127,7 +127,7 @@ if not mobs.custom_spawn_animal then
|
||||
|
||||
local spawn_on = "default:dirt_with_grass"
|
||||
|
||||
if minetest.get_modpath("ethereal") then
|
||||
if core.get_modpath("ethereal") then
|
||||
spawn_on = "ethereal:prairie_dirt"
|
||||
end
|
||||
|
||||
@ -154,10 +154,10 @@ mobs:alias_mob("mobs:bunny", "mobs_animal:bunny")
|
||||
|
||||
-- raw rabbit
|
||||
|
||||
minetest.register_craftitem(":mobs:rabbit_raw", {
|
||||
core.register_craftitem(":mobs:rabbit_raw", {
|
||||
description = S("Raw Rabbit"),
|
||||
inventory_image = "mobs_rabbit_raw.png",
|
||||
on_use = minetest.item_eat(3),
|
||||
on_use = core.item_eat(3),
|
||||
groups = {food_meat_raw = 1, food_rabbit_raw = 1}
|
||||
})
|
||||
|
||||
@ -165,16 +165,16 @@ mobs.add_eatable("mobs:rabbit_raw", 3)
|
||||
|
||||
-- cooked rabbit
|
||||
|
||||
minetest.register_craftitem(":mobs:rabbit_cooked", {
|
||||
core.register_craftitem(":mobs:rabbit_cooked", {
|
||||
description = S("Cooked Rabbit"),
|
||||
inventory_image = "mobs_rabbit_cooked.png",
|
||||
on_use = minetest.item_eat(5),
|
||||
on_use = core.item_eat(5),
|
||||
groups = {food_meat = 1, food_rabbit = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:rabbit_cooked", 5)
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs:rabbit_cooked",
|
||||
recipe = "mobs:rabbit_raw",
|
||||
@ -183,15 +183,15 @@ minetest.register_craft({
|
||||
|
||||
-- rabbit hide and recipes
|
||||
|
||||
minetest.register_craftitem(":mobs:rabbit_hide", {
|
||||
core.register_craftitem(":mobs:rabbit_hide", {
|
||||
description = S("Rabbit Hide"),
|
||||
inventory_image = "mobs_rabbit_hide.png",
|
||||
groups = {flammable = 2, pelt = 1}
|
||||
})
|
||||
|
||||
minetest.register_craft({type = "fuel", recipe = "mobs:rabbit_hide", burntime = 2})
|
||||
core.register_craft({type = "fuel", recipe = "mobs:rabbit_hide", burntime = 2})
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
output = "mobs:leather",
|
||||
recipe = {
|
||||
{"mobs:rabbit_hide", "mobs:rabbit_hide"},
|
||||
|
53
chicken.lua
@ -1,5 +1,5 @@
|
||||
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local S = core.get_translator("mobs_animal")
|
||||
|
||||
-- Chicken by JK Murray and Sirrobzeroone
|
||||
|
||||
@ -9,7 +9,7 @@ mobs:register_mob("mobs_animal:chicken", {
|
||||
passive = true,
|
||||
hp_min = 5,
|
||||
hp_max = 10,
|
||||
armor = 200,
|
||||
armor = 100,
|
||||
collisionbox = {-0.3, -0.75, -0.3, 0.3, 0.1, 0.3},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_chicken.b3d",
|
||||
@ -20,7 +20,10 @@ mobs:register_mob("mobs_animal:chicken", {
|
||||
},
|
||||
child_texture = {{"mobs_chick.png"}},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {random = "mobs_chicken"},
|
||||
sounds = {
|
||||
random = "mobs_chicken",
|
||||
replace = "default_dig_crumbly"
|
||||
},
|
||||
walk_velocity = 1,
|
||||
run_velocity = 3,
|
||||
runaway = true,
|
||||
@ -81,13 +84,13 @@ mobs:register_mob("mobs_animal:chicken", {
|
||||
|
||||
if math.random(100) == 1 then
|
||||
|
||||
minetest.add_item(pos, "mobs:egg")
|
||||
core.add_item(pos, "mobs:egg")
|
||||
|
||||
minetest.sound_play("default_place_node_hard",
|
||||
core.sound_play("default_place_node_hard",
|
||||
{pos = pos, gain = 1.0, max_hear_distance = 5}, true)
|
||||
|
||||
elseif math.random(100) < 3 then
|
||||
minetest.add_item(pos, "mobs:chicken_feather")
|
||||
core.add_item(pos, "mobs:chicken_feather")
|
||||
end
|
||||
end
|
||||
})
|
||||
@ -98,7 +101,7 @@ if not mobs.custom_spawn_animal then
|
||||
|
||||
local spawn_on = {"default:dirt_with_grass"}
|
||||
|
||||
if minetest.get_modpath("ethereal") then
|
||||
if core.get_modpath("ethereal") then
|
||||
spawn_on = {"ethereal:bamboo_dirt", "ethereal:prairie_dirt"}
|
||||
end
|
||||
|
||||
@ -133,7 +136,7 @@ mobs:register_arrow("mobs_animal:egg_entity", {
|
||||
|
||||
hit_player = function(self, player)
|
||||
|
||||
player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, {
|
||||
player:punch(core.get_player_by_name(self.playername) or self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 1}
|
||||
}, nil)
|
||||
@ -153,10 +156,10 @@ mobs:register_arrow("mobs_animal:egg_entity", {
|
||||
|
||||
pos.y = pos.y + 1
|
||||
|
||||
local nod = minetest.get_node_or_nil(pos)
|
||||
local nod = core.get_node_or_nil(pos)
|
||||
|
||||
if not nod or not minetest.registered_nodes[nod.name]
|
||||
or minetest.registered_nodes[nod.name].walkable == true then
|
||||
if not nod or not core.registered_nodes[nod.name]
|
||||
or core.registered_nodes[nod.name].walkable == true then
|
||||
return
|
||||
end
|
||||
|
||||
@ -179,10 +182,10 @@ local mobs_shoot_egg = function (item, player, pointed_thing)
|
||||
|
||||
local playerpos = player:get_pos()
|
||||
|
||||
minetest.sound_play("default_place_node_hard",
|
||||
core.sound_play("default_place_node_hard",
|
||||
{pos = playerpos, gain = 1.0, max_hear_distance = 5}, true)
|
||||
|
||||
local obj = minetest.add_entity({
|
||||
local obj = core.add_entity({
|
||||
x = playerpos.x,
|
||||
y = playerpos.y +1.5,
|
||||
z = playerpos.z
|
||||
@ -213,7 +216,7 @@ end
|
||||
|
||||
-- egg
|
||||
|
||||
minetest.register_node(":mobs:egg", {
|
||||
core.register_node(":mobs:egg", {
|
||||
description = S("Chicken Egg"),
|
||||
tiles = {"mobs_chicken_egg.png"},
|
||||
inventory_image = "mobs_chicken_egg.png",
|
||||
@ -232,7 +235,7 @@ minetest.register_node(":mobs:egg", {
|
||||
sounds = mobs.node_sound_defaults(),
|
||||
|
||||
after_place_node = function(pos, placer, itemstack)
|
||||
minetest.set_node(pos, {name = "mobs:egg", param2 = 1})
|
||||
core.set_node(pos, {name = "mobs:egg", param2 = 1})
|
||||
end,
|
||||
|
||||
on_use = mobs_shoot_egg
|
||||
@ -240,16 +243,16 @@ minetest.register_node(":mobs:egg", {
|
||||
|
||||
-- fried egg and recipe
|
||||
|
||||
minetest.register_craftitem(":mobs:chicken_egg_fried", {
|
||||
core.register_craftitem(":mobs:chicken_egg_fried", {
|
||||
description = S("Fried Egg"),
|
||||
inventory_image = "mobs_chicken_egg_fried.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
on_use = core.item_eat(2),
|
||||
groups = {food_egg_fried = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:chicken_egg_fried", 2)
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
type = "cooking",
|
||||
recipe = "mobs:egg",
|
||||
output = "mobs:chicken_egg_fried"
|
||||
@ -257,10 +260,10 @@ minetest.register_craft({
|
||||
|
||||
-- raw chicken
|
||||
|
||||
minetest.register_craftitem(":mobs:chicken_raw", {
|
||||
core.register_craftitem(":mobs:chicken_raw", {
|
||||
description = S("Raw Chicken"),
|
||||
inventory_image = "mobs_chicken_raw.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
on_use = core.item_eat(2),
|
||||
groups = {food_meat_raw = 1, food_chicken_raw = 1}
|
||||
})
|
||||
|
||||
@ -268,16 +271,16 @@ mobs.add_eatable("mobs:chicken_raw", 2)
|
||||
|
||||
-- cooked chicken and recipe
|
||||
|
||||
minetest.register_craftitem(":mobs:chicken_cooked", {
|
||||
core.register_craftitem(":mobs:chicken_cooked", {
|
||||
description = S("Cooked Chicken"),
|
||||
inventory_image = "mobs_chicken_cooked.png",
|
||||
on_use = minetest.item_eat(6),
|
||||
on_use = core.item_eat(6),
|
||||
groups = {food_meat = 1, food_chicken = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:chicken_cooked", 6)
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
type = "cooking",
|
||||
recipe = "mobs:chicken_raw",
|
||||
output = "mobs:chicken_cooked"
|
||||
@ -285,10 +288,10 @@ minetest.register_craft({
|
||||
|
||||
-- feather and fuel
|
||||
|
||||
minetest.register_craftitem(":mobs:chicken_feather", {
|
||||
core.register_craftitem(":mobs:chicken_feather", {
|
||||
description = S("Feather"),
|
||||
inventory_image = "mobs_chicken_feather.png",
|
||||
groups = {flammable = 2, feather = 1}
|
||||
})
|
||||
|
||||
minetest.register_craft({type = "fuel", recipe = "mobs:chicken_feather", burntime = 1})
|
||||
core.register_craft({type = "fuel", recipe = "mobs:chicken_feather", burntime = 1})
|
||||
|
92
cow.lua
@ -1,5 +1,14 @@
|
||||
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local S = core.get_translator("mobs_animal")
|
||||
|
||||
-- should cows eat grass blocks and mess up the environment?
|
||||
|
||||
local eat_gb = core.settings:get_bool("mobs_animal.eat_grass_block")
|
||||
local replace_what = { {"group:grass", "air", 0} }
|
||||
|
||||
if eat_gb then
|
||||
table.insert(replace_what, {"default:dirt_with_grass", "default:dirt", -1})
|
||||
end
|
||||
|
||||
-- Cow by sirrobzeroone
|
||||
|
||||
@ -9,10 +18,10 @@ mobs:register_mob("mobs_animal:cow", {
|
||||
attack_type = "dogfight",
|
||||
attack_npcs = false,
|
||||
reach = 2,
|
||||
damage = 4,
|
||||
hp_min = 5,
|
||||
damage = 4, attack_chance = 98,
|
||||
hp_min = 10,
|
||||
hp_max = 20,
|
||||
armor = 200,
|
||||
armor = 100,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.2, 0.4},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_cow.b3d",
|
||||
@ -21,7 +30,10 @@ mobs:register_mob("mobs_animal:cow", {
|
||||
{"mobs_cow2.png"}
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {random = "mobs_cow"},
|
||||
sounds = {
|
||||
random = "mobs_cow",
|
||||
replace = "default_dig_crumbly"
|
||||
},
|
||||
walk_velocity = 1,
|
||||
run_velocity = 2,
|
||||
jump = true,
|
||||
@ -40,7 +52,7 @@ mobs:register_mob("mobs_animal:cow", {
|
||||
walk_start = 85, walk_end = 114, walk_speed = 20,
|
||||
run_start = 120, run_end = 140, run_speed = 30,
|
||||
punch_start = 145, punch_end = 160, punch_speed = 20,
|
||||
die_start = 165, die_end = 185, die_speed = 10, die_loop = false
|
||||
die_start = 165, die_end = 185, die_speed = 25, die_loop = false
|
||||
},
|
||||
follow = {
|
||||
"farming:wheat", "default:grass_1", "farming:barley",
|
||||
@ -48,10 +60,20 @@ mobs:register_mob("mobs_animal:cow", {
|
||||
},
|
||||
view_range = 8,
|
||||
replace_rate = 10,
|
||||
replace_what = {
|
||||
{"group:grass", "air", 0},
|
||||
{"default:dirt_with_grass", "default:dirt", -1}
|
||||
},
|
||||
replace_what = replace_what,
|
||||
--[[
|
||||
pick_up = {"default:grass_1", "default:dry_grass_1"},
|
||||
on_pick_up = function(self, entity)
|
||||
|
||||
local istack = ItemStack(entity.itemstring)
|
||||
|
||||
print("-- took", istack:get_name())
|
||||
|
||||
istack:take_item(1)
|
||||
|
||||
return istack
|
||||
end,
|
||||
]]
|
||||
-- stay_near = {{"farming:straw", "group:grass"}, 10},
|
||||
fear_height = 2,
|
||||
|
||||
@ -82,7 +104,7 @@ mobs:register_mob("mobs_animal:cow", {
|
||||
|
||||
if self.gotten == true then
|
||||
|
||||
minetest.chat_send_player(name, S("Cow already milked!"))
|
||||
core.chat_send_player(name, S("Cow already milked!"))
|
||||
|
||||
return
|
||||
end
|
||||
@ -107,7 +129,7 @@ mobs:register_mob("mobs_animal:cow", {
|
||||
|
||||
pos.y = pos.y + 0.5
|
||||
|
||||
minetest.add_item(pos, {name = ret_item})
|
||||
core.add_item(pos, {name = ret_item})
|
||||
end
|
||||
|
||||
self.gotten = true -- milked
|
||||
@ -154,27 +176,27 @@ mobs:alias_mob("mobs:cow", "mobs_animal:cow")
|
||||
|
||||
-- bucket of milk
|
||||
|
||||
minetest.register_craftitem(":mobs:bucket_milk", {
|
||||
core.register_craftitem(":mobs:bucket_milk", {
|
||||
description = S("Bucket of Milk"),
|
||||
inventory_image = "mobs_bucket_milk.png",
|
||||
stack_max = 1,
|
||||
on_use = minetest.item_eat(8, "bucket:bucket_empty"),
|
||||
on_use = core.item_eat(8, "bucket:bucket_empty"),
|
||||
groups = {food_milk = 1, drink = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:bucket_milk", 8)
|
||||
|
||||
-- glass of milk and recipes
|
||||
minetest.register_craftitem(":mobs:glass_milk", {
|
||||
core.register_craftitem(":mobs:glass_milk", {
|
||||
description = S("Glass of Milk"),
|
||||
inventory_image = "mobs_glass_milk.png",
|
||||
on_use = minetest.item_eat(2, "vessels:drinking_glass"),
|
||||
on_use = core.item_eat(2, "vessels:drinking_glass"),
|
||||
groups = {food_milk_glass = 1, vessel = 1, drink = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:glass_milk", 2)
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
output = "mobs:glass_milk 4",
|
||||
recipe = {
|
||||
{"vessels:drinking_glass", "vessels:drinking_glass"},
|
||||
@ -184,7 +206,7 @@ minetest.register_craft({
|
||||
replacements = {{"mobs:bucket_milk", "bucket:bucket_empty"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
output = "mobs:bucket_milk",
|
||||
recipe = {
|
||||
{"group:food_milk_glass", "group:food_milk_glass"},
|
||||
@ -198,10 +220,10 @@ minetest.register_craft({
|
||||
|
||||
-- butter and recipe
|
||||
|
||||
minetest.register_craftitem(":mobs:butter", {
|
||||
core.register_craftitem(":mobs:butter", {
|
||||
description = S("Butter"),
|
||||
inventory_image = "mobs_butter.png",
|
||||
on_use = minetest.item_eat(1),
|
||||
on_use = core.item_eat(1),
|
||||
groups = {food_butter = 1}
|
||||
})
|
||||
|
||||
@ -209,11 +231,11 @@ mobs.add_eatable("mobs:butter", 1)
|
||||
|
||||
local salt_item = "default:sapling" -- some saplings are high in sodium
|
||||
|
||||
if minetest.get_modpath("farming") and farming and farming.mod then
|
||||
if core.get_modpath("farming") and farming and farming.mod then
|
||||
salt_item = "farming:salt"
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
output = "mobs:butter",
|
||||
recipe = {{"mobs:bucket_milk", salt_item}},
|
||||
replacements = {{"mobs:bucket_milk", "bucket:bucket_empty"}}
|
||||
@ -221,16 +243,16 @@ minetest.register_craft({
|
||||
|
||||
-- cheese wedge and recipe
|
||||
|
||||
minetest.register_craftitem(":mobs:cheese", {
|
||||
core.register_craftitem(":mobs:cheese", {
|
||||
description = S("Cheese"),
|
||||
inventory_image = "mobs_cheese.png",
|
||||
on_use = minetest.item_eat(4),
|
||||
on_use = core.item_eat(4),
|
||||
groups = {food_cheese = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:cheese", 4)
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs:cheese",
|
||||
recipe = "mobs:bucket_milk",
|
||||
@ -240,7 +262,7 @@ minetest.register_craft({
|
||||
|
||||
-- cheese block and recipe
|
||||
|
||||
minetest.register_node(":mobs:cheeseblock", {
|
||||
core.register_node(":mobs:cheeseblock", {
|
||||
description = S("Cheese Block"),
|
||||
tiles = {"mobs_cheeseblock.png"},
|
||||
is_ground_content = false,
|
||||
@ -248,7 +270,7 @@ minetest.register_node(":mobs:cheeseblock", {
|
||||
sounds = mobs.node_sound_dirt_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
output = "mobs:cheeseblock",
|
||||
recipe = {
|
||||
{"group:food_cheese", "group:food_cheese", "group:food_cheese"},
|
||||
@ -257,30 +279,30 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
output = "mobs:cheese 9",
|
||||
recipe = {{"mobs:cheeseblock"}}
|
||||
})
|
||||
|
||||
-- check for either of the wood bucket mods and add compatibility
|
||||
|
||||
local wb = minetest.get_modpath("wooden_bucket")
|
||||
local bw = minetest.get_modpath("bucket_wooden")
|
||||
local wb = core.get_modpath("wooden_bucket")
|
||||
local bw = core.get_modpath("bucket_wooden")
|
||||
|
||||
if wb or bw then
|
||||
|
||||
local return_item = wb and "wooden_bucket:bucket_wood_empty"
|
||||
or "bucket_wooden:bucket_empty"
|
||||
|
||||
minetest.register_craftitem(":mobs:wooden_bucket_milk", {
|
||||
core.register_craftitem(":mobs:wooden_bucket_milk", {
|
||||
description = S("Wooden Bucket of Milk"),
|
||||
inventory_image = "mobs_wooden_bucket_milk.png",
|
||||
stack_max = 1,
|
||||
on_use = minetest.item_eat(8, return_item),
|
||||
on_use = core.item_eat(8, return_item),
|
||||
groups = {food_milk = 1, flammable = 3, drink = 1}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
output = "mobs:glass_milk 4",
|
||||
recipe = {
|
||||
{"vessels:drinking_glass", "vessels:drinking_glass"},
|
||||
@ -290,7 +312,7 @@ if wb or bw then
|
||||
replacements = {{"mobs:wooden_bucket_milk", return_item}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
output = "mobs:wooden_bucket_milk",
|
||||
recipe = {
|
||||
{"group:food_milk_glass", "group:food_milk_glass"},
|
||||
@ -302,7 +324,7 @@ if wb or bw then
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
output = "mobs:butter",
|
||||
recipe = {{"mobs:wooden_bucket_milk", salt_item}},
|
||||
replacements = {{"mobs:wooden_bucket_milk", return_item}}
|
||||
|
8
init.lua
@ -1,8 +1,8 @@
|
||||
|
||||
-- translation and mod path
|
||||
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local path = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
||||
local S = core.get_translator("mobs_animal")
|
||||
local path = core.get_modpath(core.get_current_modname()) .. "/"
|
||||
|
||||
-- Check for custom mob spawn file
|
||||
|
||||
@ -18,7 +18,7 @@ end
|
||||
|
||||
local function ddoo(mob)
|
||||
|
||||
if minetest.settings:get_bool("mobs_animal." .. mob) == false then
|
||||
if core.settings:get_bool("mobs_animal." .. mob) == false then
|
||||
print("[Mobs_Animal] " .. mob .. " disabled!")
|
||||
return
|
||||
end
|
||||
@ -47,7 +47,7 @@ end
|
||||
|
||||
-- Lucky Blocks
|
||||
|
||||
if minetest.get_modpath("lucky_block") then
|
||||
if core.get_modpath("lucky_block") then
|
||||
dofile(path .. "lucky_block.lua")
|
||||
end
|
||||
|
||||
|
43
kitten.lua
@ -1,8 +1,8 @@
|
||||
|
||||
-- translation and hairball setting
|
||||
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local hairball = minetest.settings:get_bool("mobs_animal.hairball") ~= false
|
||||
local S = core.get_translator("mobs_animal")
|
||||
local hairball = core.settings:get_bool("mobs_animal.hairball") ~= false
|
||||
|
||||
-- custom kitty types
|
||||
|
||||
@ -28,7 +28,7 @@ mobs:register_mob("mobs_animal:kitten", {
|
||||
passive = false,
|
||||
hp_min = 5,
|
||||
hp_max = 10,
|
||||
armor = 200,
|
||||
armor = 100,
|
||||
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.1, 0.3},
|
||||
visual = "mesh",
|
||||
visual_size = {x = 0.5, y = 0.5},
|
||||
@ -59,7 +59,7 @@ mobs:register_mob("mobs_animal:kitten", {
|
||||
stoodup_start = 0, stoodup_end = 0,
|
||||
},
|
||||
follow = {
|
||||
"mobs_animal:rat", "group:food_fish_raw",
|
||||
"mobs_animal:rat", "group:food_fish_raw", "mobs:glass_milk",
|
||||
"mobs_fish:tropical", "mobs_fish:clownfish", "xocean:fish_edible"
|
||||
},
|
||||
view_range = 8,
|
||||
@ -74,7 +74,7 @@ mobs:register_mob("mobs_animal:kitten", {
|
||||
|
||||
tmp = kitten_types[n]
|
||||
|
||||
if minetest.find_node_near(pos, 1, tmp.nodes) then
|
||||
if core.find_node_near(pos, 1, tmp.nodes) then
|
||||
|
||||
self.base_texture = tmp.skins
|
||||
self.object:set_properties({textures = tmp.skins})
|
||||
@ -88,7 +88,24 @@ mobs:register_mob("mobs_animal:kitten", {
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
if mobs:feed_tame(self, clicker, 4, true, true) then return end
|
||||
-- what are we holding?
|
||||
local tool = clicker:get_wielded_item()
|
||||
local item = tool and tool:get_name()
|
||||
|
||||
if mobs:feed_tame(self, clicker, 4, true, true) then
|
||||
|
||||
-- return empty glass if kitten drinks a glass of milk
|
||||
if item == "mobs:glass_milk" and core.get_modpath("vessels")
|
||||
and not mobs.is_creative(clicker:get_player_name()) then
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
core.add_item(pos, "vessels:drinking_glass")
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 50, 50, 90, false, nil) then return end
|
||||
|
||||
@ -119,9 +136,9 @@ mobs:register_mob("mobs_animal:kitten", {
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
minetest.add_item(pos, "mobs:hairball")
|
||||
core.add_item(pos, "mobs:hairball")
|
||||
|
||||
minetest.sound_play("default_dig_snappy", {
|
||||
core.sound_play("default_dig_snappy", {
|
||||
pos = pos, gain = 1.0, max_hear_distance = 5}, true)
|
||||
end
|
||||
})
|
||||
@ -132,7 +149,7 @@ if not mobs.custom_spawn_animal then
|
||||
|
||||
local spawn_on = "default:dirt_with_grass"
|
||||
|
||||
if minetest.get_modpath("ethereal") then
|
||||
if core.get_modpath("ethereal") then
|
||||
spawn_on = "ethereal:grove_dirt"
|
||||
end
|
||||
|
||||
@ -170,7 +187,7 @@ local hairball_items = {
|
||||
"ethereal:fish_tetra"
|
||||
}
|
||||
|
||||
minetest.register_craftitem(":mobs:hairball", {
|
||||
core.register_craftitem(":mobs:hairball", {
|
||||
description = S("Hairball"),
|
||||
inventory_image = "mobs_hairball.png",
|
||||
|
||||
@ -181,11 +198,11 @@ minetest.register_craftitem(":mobs:hairball", {
|
||||
local newpos = {x = pos.x + dir.x, y = pos.y + dir.y + 1.5, z = pos.z + dir.z}
|
||||
local item = hairball_items[math.random(1, #hairball_items)]
|
||||
|
||||
if item ~= "" and minetest.registered_items[item] then
|
||||
minetest.add_item(newpos, {name = item})
|
||||
if item ~= "" and core.registered_items[item] then
|
||||
core.add_item(newpos, {name = item})
|
||||
end
|
||||
|
||||
minetest.sound_play("default_place_node_hard", {
|
||||
core.sound_play("default_place_node_hard", {
|
||||
pos = newpos, gain = 1.0, max_hear_distance = 5}, true)
|
||||
|
||||
itemstack:take_item()
|
||||
|
@ -1,50 +1,49 @@
|
||||
# textdomain:mobs_animal
|
||||
@1 Sheep=@1 овца
|
||||
@1 Sheep=@1 Овца
|
||||
Bee=Пчела
|
||||
Beehive=Улей
|
||||
Beehive=Пчелиный Улей
|
||||
Black=Черная
|
||||
Blue=Синяя
|
||||
Brown=Коричневая
|
||||
Bucket of Milk=Ведро молока
|
||||
Bucket of Milk=Ведро Молока
|
||||
Bunny=Кролик
|
||||
Butter=Масло
|
||||
Cheese=Сыр
|
||||
Cheese Block=Блок сыра
|
||||
Cheese Block=Блок Сыра
|
||||
Chicken=Курица
|
||||
Chicken Egg=Куриное яйцо
|
||||
Cooked Chicken=Приготовленная курятина
|
||||
Cooked Mutton=Приготовленная баранина
|
||||
Cooked Porkchop=Приготовленные свиные отбивные
|
||||
Cooked Rabbit=Приготовленная крольчатина
|
||||
Cooked Rat=Приготовленная крыса
|
||||
Chicken Egg=Куриное Яйцо
|
||||
Cooked Chicken=Приготовленная Курятина
|
||||
Cooked Mutton=Приготовленная Баранина
|
||||
Cooked Porkchop=Приготовленные Отбивные
|
||||
Cooked Rabbit=Приготовленная Крольчатина
|
||||
Cooked Rat=Приготовленная Крыса
|
||||
Cow=Корова
|
||||
Cow already milked!=Корову уже подоили!
|
||||
Cow already milked!=Корова уже подоена!
|
||||
Cyan=Голубая
|
||||
Dark Green=Темно-зеленая
|
||||
Dark Grey=Темно-серая
|
||||
Feather=Перо
|
||||
Fried Egg=Яичница
|
||||
Glass of Milk=Стакан молока
|
||||
Glass of Milk=Стакан Молока
|
||||
Green=Зеленая
|
||||
Grey=Серая
|
||||
Hairball=Комочек шерсти
|
||||
Honey=Мёд
|
||||
Honey Block=Блок мёда
|
||||
Honey Block=Блок Мёда
|
||||
Kitten=Котенок
|
||||
Magenta=Пурпурная
|
||||
Orange=Оранжевая
|
||||
Panda=Панда
|
||||
Penguin=Пингвин
|
||||
Pink=Розовая
|
||||
Rabbit Hide=Кроличья шкурка
|
||||
Rabbit Hide=Кроличья Шкурка
|
||||
Rat=Крыса
|
||||
Raw Chicken=Сырая курятина
|
||||
Raw Mutton=Сырая баранина
|
||||
Raw Porkchop=Свиные отбивные
|
||||
Raw Rabbit=Сырая крольчатина
|
||||
Raw Chicken=Сырая Курятина
|
||||
Raw Mutton=Сырая Баранина
|
||||
Raw Porkchop=Свиные Отбивные
|
||||
Raw Rabbit=Сырая Крольчатина
|
||||
Red=Красная
|
||||
Violet=Фиолетовая
|
||||
Warthog=Бородавочник
|
||||
White=Белая
|
||||
Yellow=Желтая
|
||||
#[MOD] Mobs Redo Animals loaded=
|
||||
Yellow=Желтая
|
52
locale/mobs_animal.uk.tr
Normal file
@ -0,0 +1,52 @@
|
||||
# textdomain:mobs_animal
|
||||
Mobs Animal=Моби Тварини
|
||||
Add farm animals and a few extra into your world.=Додає свійських тварин і трохи додаткового контенту у світ.
|
||||
Adds farm animals.=Додає свійських тварин.
|
||||
@1 Sheep=@1 вівця
|
||||
Bee=Бджола
|
||||
Beehive=Бджолиний вулик
|
||||
Black=Чорна
|
||||
Blue=Синя
|
||||
Brown=Коричнева
|
||||
Bucket of Milk=Відро молока
|
||||
Bunny=Кролик
|
||||
Butter=Масло
|
||||
Cheese=Твердий сир
|
||||
Cheese Block=Блок твердого сиру
|
||||
Chicken=Курка
|
||||
Chicken Egg=Яйце курки
|
||||
Cooked Chicken=Приготовлена курятина
|
||||
Cooked Mutton=Приготовлена баранина
|
||||
Cooked Porkchop=Приготовлені відбивні
|
||||
Cooked Rabbit=Приготовлена крольчатина
|
||||
Cooked Rat=Приготовлений пацюк
|
||||
Cow=Корова
|
||||
Cow already milked!=Корова вже подоєна!
|
||||
Cyan=Блакитна
|
||||
Dark Green=Темно-зелена
|
||||
Dark Grey=Темно-сіра
|
||||
Feather=Перо
|
||||
Fried Egg=Яєшня
|
||||
Glass of Milk=Склянка молока
|
||||
Green=Зелена
|
||||
Grey=Сіра
|
||||
Hairball=Купка шерсті
|
||||
Honey=Мед
|
||||
Honey Block=Блок меду
|
||||
Kitten=Кошеня
|
||||
Magenta=Пурпурна
|
||||
Orange=Помаранчева
|
||||
Panda=Панда
|
||||
Penguin=Пінгвін
|
||||
Pink=Рожева
|
||||
Rabbit Hide=Кроляча шкірка
|
||||
Rat=Пацюк
|
||||
Raw Chicken=Сира курятина
|
||||
Raw Mutton=Сира баранина
|
||||
Raw Porkchop=Свинячі відбивні
|
||||
Raw Rabbit=Сира крольчатина
|
||||
Red=Червона
|
||||
Violet=Фіолетова
|
||||
Warthog=Бородавочник
|
||||
White=Біла
|
||||
Yellow=Жовта
|
@ -25,7 +25,7 @@ lucky_block:add_blocks({
|
||||
|
||||
-- if nyancat found add special block
|
||||
|
||||
if minetest.registered_nodes["default:nyancat"] then
|
||||
if core.registered_nodes["default:nyancat"] then
|
||||
|
||||
lucky_block:add_blocks({
|
||||
{"tro", "default:nyancat", "mobs_kitten", true}
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local S = core.get_translator("mobs_animal")
|
||||
|
||||
-- Panda by AspireMint (CC BY-SA 3.0)
|
||||
|
||||
@ -15,7 +15,7 @@ mobs:register_mob("mobs_animal:panda", {
|
||||
damage = 3,
|
||||
hp_min = 10,
|
||||
hp_max = 24,
|
||||
armor = 200,
|
||||
armor = 100,
|
||||
collisionbox = {-0.4, -0.45, -0.4, 0.4, 0.45, 0.4},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_panda.b3d",
|
||||
@ -60,7 +60,7 @@ mobs:register_mob("mobs_animal:panda", {
|
||||
|
||||
-- where to spawn (ethereal bamboo biome only)
|
||||
|
||||
if minetest.get_modpath("ethereal") and not mobs.custom_spawn_animal then
|
||||
if core.get_modpath("ethereal") and not mobs.custom_spawn_animal then
|
||||
|
||||
mobs:spawn({
|
||||
name = "mobs_animal:panda",
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local S = core.get_translator("mobs_animal")
|
||||
|
||||
-- Penguin by D00Med
|
||||
|
||||
@ -10,7 +10,7 @@ stepheight = 0.6,
|
||||
reach = 1,
|
||||
hp_min = 5,
|
||||
hp_max = 10,
|
||||
armor = 200,
|
||||
armor = 100,
|
||||
collisionbox = {-0.2, -0.0, -0.2, 0.2, 0.5, 0.2},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_penguin.b3d",
|
||||
|
13
rat.lua
@ -1,5 +1,5 @@
|
||||
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local S = core.get_translator("mobs_animal")
|
||||
|
||||
-- Rat by KPavel and PilzAdam (B3D model by sirrobzeroone)
|
||||
|
||||
@ -9,13 +9,14 @@ mobs:register_mob("mobs_animal:rat", {
|
||||
passive = true,
|
||||
hp_min = 1,
|
||||
hp_max = 4,
|
||||
armor = 200,
|
||||
armor = 100,
|
||||
collisionbox = {-0.2, -1, -0.2, 0.2, -0.8, 0.2},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_rat.b3d",
|
||||
textures = {
|
||||
{"mobs_rat.png"},
|
||||
{"mobs_rat2.png"}
|
||||
{"mobs_rat2.png"},
|
||||
{"mobs_rat3.png"}
|
||||
},
|
||||
makes_footstep_sound = false,
|
||||
sounds = {random = "mobs_rat"},
|
||||
@ -92,16 +93,16 @@ mobs:alias_mob("mobs:rat", "mobs_animal:rat")
|
||||
|
||||
-- cooked rat, yummy!
|
||||
|
||||
minetest.register_craftitem(":mobs:rat_cooked", {
|
||||
core.register_craftitem(":mobs:rat_cooked", {
|
||||
description = S("Cooked Rat"),
|
||||
inventory_image = "mobs_cooked_rat.png",
|
||||
on_use = minetest.item_eat(3),
|
||||
on_use = core.item_eat(3),
|
||||
groups = {food_rat = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:rat_cooked", 3)
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs:rat_cooked",
|
||||
recipe = "mobs_animal:rat",
|
||||
|
@ -9,3 +9,5 @@ mobs_animal.rat (Enable Rat) bool true
|
||||
mobs_animal.sheep (Enable Sheep) bool true
|
||||
mobs_animal.warthog (Enable Warthog) bool true
|
||||
mobs_animal.hairball (Enable Kitten Hairball drops) bool true
|
||||
|
||||
mobs_animal.eat_grass_block (Enable Cow/Sheep eating grass blocks) bool false
|
||||
|
62
sheep.lua
@ -1,9 +1,18 @@
|
||||
|
||||
-- translation and localize function
|
||||
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local S = core.get_translator("mobs_animal")
|
||||
local random = math.random
|
||||
|
||||
-- should sheep eat grass blocks and mess up the environment?
|
||||
|
||||
local eat_gb = core.settings:get_bool("mobs_animal.eat_grass_block")
|
||||
local replace_what = { {"group:grass", "air", -1} }
|
||||
|
||||
if eat_gb then
|
||||
table.insert(replace_what, {"default:dirt_with_grass", "default:dirt", -2})
|
||||
end
|
||||
|
||||
-- sheep colour table
|
||||
|
||||
local all_colours = {
|
||||
@ -44,10 +53,7 @@ for _, col in ipairs(all_colours) do
|
||||
|
||||
for _2, col2 in ipairs(all_colours) do
|
||||
|
||||
if col2[1] == colr then
|
||||
colr = col2[3]
|
||||
break
|
||||
end
|
||||
if col2[1] == colr then colr = col2[3] ; break end
|
||||
end
|
||||
end
|
||||
|
||||
@ -59,8 +65,7 @@ for _, col in ipairs(all_colours) do
|
||||
local col_text = "^[multiply:" .. col_override
|
||||
|
||||
if gotten then
|
||||
wool_shave_text = shav_text
|
||||
col_text = ""
|
||||
wool_shave_text = shav_text ; col_text = ""
|
||||
end
|
||||
|
||||
-- results in unneccesary brackets for shaved but these are ignored by engine
|
||||
@ -80,8 +85,8 @@ for _, col in ipairs(all_colours) do
|
||||
type = "animal",
|
||||
passive = true,
|
||||
hp_min = 8,
|
||||
hp_max = 10,
|
||||
armor = 200,
|
||||
hp_max = 12,
|
||||
armor = 100,
|
||||
collisionbox = {-0.5, -1, -0.5, 0.5, 0.3, 0.5},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_sheep.b3d",
|
||||
@ -90,7 +95,10 @@ for _, col in ipairs(all_colours) do
|
||||
},
|
||||
gotten_texture = {"mobs_sheep_base.png^mobs_sheep_shaved.png"},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {random = "mobs_sheep"},
|
||||
sounds = {
|
||||
random = "mobs_sheep",
|
||||
replace = "default_dig_crumbly"
|
||||
},
|
||||
walk_velocity = 1,
|
||||
run_velocity = 2,
|
||||
runaway = true,
|
||||
@ -116,10 +124,7 @@ for _, col in ipairs(all_colours) do
|
||||
},
|
||||
view_range = 8,
|
||||
replace_rate = 10,
|
||||
replace_what = {
|
||||
{"group:grass", "air", -1},
|
||||
{"default:dirt_with_grass", "default:dirt", -2}
|
||||
},
|
||||
replace_what = replace_what,
|
||||
fear_height = 3,
|
||||
|
||||
on_replace = function(self, pos, oldnode, newnode)
|
||||
@ -164,7 +169,7 @@ for _, col in ipairs(all_colours) do
|
||||
----------------------------------------------------
|
||||
pos.y = pos.y + 0.5 -- spawn child a little higher
|
||||
|
||||
local mob = minetest.add_entity(pos, parent1.name)
|
||||
local mob = core.add_entity(pos, parent1.name)
|
||||
local ent2 = mob:get_luaentity()
|
||||
|
||||
-- remove horns from parents' texture string, lambs dont have horns
|
||||
@ -270,22 +275,21 @@ for _, col in ipairs(all_colours) do
|
||||
if itemname == "mobs:shears" then
|
||||
|
||||
if self.gotten ~= false or self.child ~= false
|
||||
or name ~= self.owner or not minetest.get_modpath("wool") then
|
||||
or name ~= self.owner or not core.get_modpath("wool") then
|
||||
return
|
||||
end
|
||||
|
||||
self.gotten = true -- shaved
|
||||
self.drops = drops_gotten
|
||||
self.food = 0 -- reset food
|
||||
|
||||
local obj = minetest.add_item(
|
||||
local obj = core.add_item(
|
||||
self.object:get_pos(),
|
||||
ItemStack("wool:" .. col[1] .. " " .. random(3))
|
||||
)
|
||||
|
||||
if obj then
|
||||
|
||||
obj:set_velocity({
|
||||
x = random(-1, 1), y = 5, z = random(-1, 1)})
|
||||
obj:set_velocity({x = random(-1, 1), y = 5, z = random(-1, 1)})
|
||||
end
|
||||
|
||||
item:add_wear(650) -- 100 uses
|
||||
@ -316,7 +320,7 @@ for _, col in ipairs(all_colours) do
|
||||
local pos = self.object:get_pos()
|
||||
|
||||
-- add new coloured sheep
|
||||
local mob = minetest.add_entity(pos, "mobs_animal:sheep_" .. colr)
|
||||
local mob = core.add_entity(pos, "mobs_animal:sheep_" .. colr)
|
||||
local ent = mob:get_luaentity()
|
||||
|
||||
if ent then
|
||||
@ -381,7 +385,7 @@ if not mobs.custom_spawn_animal then
|
||||
|
||||
local max_ht = 400
|
||||
local spawn_on = {"default:dirt_with_grass", "ethereal:green_dirt"}
|
||||
local mod_ethereal = minetest.get_modpath("ethereal")
|
||||
local mod_ethereal = core.get_modpath("ethereal")
|
||||
local spawn_chance = mod_ethereal and 12000 or 8000
|
||||
|
||||
mobs:spawn({
|
||||
@ -467,7 +471,7 @@ if not mobs.custom_spawn_animal then
|
||||
random_sheep(pos, true)
|
||||
|
||||
-- Rest of herd
|
||||
local nods = minetest.find_nodes_in_area_under_air(
|
||||
local nods = core.find_nodes_in_area_under_air(
|
||||
{x = pos.x - 4, y = pos.y - 3, z = pos.z - 4},
|
||||
{x = pos.x + 4, y = pos.y + 3, z = pos.z + 4}, spawn_on)
|
||||
|
||||
@ -482,7 +486,7 @@ if not mobs.custom_spawn_animal then
|
||||
|
||||
pos2.y = pos2.y + 2
|
||||
|
||||
if minetest.get_node(pos2).name == "air" then
|
||||
if core.get_node(pos2).name == "air" then
|
||||
|
||||
-- Add a sheep or lamb
|
||||
random_sheep(pos2, false)
|
||||
@ -499,10 +503,10 @@ mobs:alias_mob("mobs:sheep", "mobs_animal:sheep_white")
|
||||
|
||||
-- raw mutton
|
||||
|
||||
minetest.register_craftitem(":mobs:mutton_raw", {
|
||||
core.register_craftitem(":mobs:mutton_raw", {
|
||||
description = S("Raw Mutton"),
|
||||
inventory_image = "mobs_mutton_raw.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
on_use = core.item_eat(2),
|
||||
groups = {food_meat_raw = 1, food_mutton_raw = 1}
|
||||
})
|
||||
|
||||
@ -510,16 +514,16 @@ mobs.add_eatable("mobs:mutton_raw", 2)
|
||||
|
||||
-- cooked mutton and recipe
|
||||
|
||||
minetest.register_craftitem(":mobs:mutton_cooked", {
|
||||
core.register_craftitem(":mobs:mutton_cooked", {
|
||||
description = S("Cooked Mutton"),
|
||||
inventory_image = "mobs_mutton_cooked.png",
|
||||
on_use = minetest.item_eat(6),
|
||||
on_use = core.item_eat(6),
|
||||
groups = {food_meat = 1, food_mutton = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:mutton_cooked", 6)
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs:mutton_cooked",
|
||||
recipe = "mobs:mutton_raw",
|
||||
|
Before Width: | Height: | Size: 609 B After Width: | Height: | Size: 272 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 675 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 788 B |
BIN
textures/mobs_rat3.png
Normal file
After Width: | Height: | Size: 827 B |
20
warthog.lua
@ -1,5 +1,5 @@
|
||||
|
||||
local S = minetest.get_translator("mobs_animal")
|
||||
local S = core.get_translator("mobs_animal")
|
||||
|
||||
-- Warthog originally by KrupnoPavel, B3D model by sirrobzeroone
|
||||
|
||||
@ -12,10 +12,10 @@ mobs:register_mob("mobs_animal:pumba", {
|
||||
owner_loyal = true,
|
||||
attack_npcs = false,
|
||||
reach = 2,
|
||||
damage = 2,
|
||||
hp_min = 5,
|
||||
damage = 2, attack_chance = 95,
|
||||
hp_min = 10,
|
||||
hp_max = 15,
|
||||
armor = 200,
|
||||
armor = 100,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.95, 0.4},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_pumba.b3d",
|
||||
@ -64,7 +64,7 @@ if not mobs.custom_spawn_animal then
|
||||
local spawn_on = {"default:dirt_with_grass", "default:dry_dirt_with_dry_grass"}
|
||||
local spawn_by = {"group:grass"}
|
||||
|
||||
if minetest.get_modpath("ethereal") then
|
||||
if core.get_modpath("ethereal") then
|
||||
spawn_on = {"ethereal:mushroom_dirt"}
|
||||
spawn_by = {"flowers:mushroom_brown", "flowers:mushroom_red"}
|
||||
end
|
||||
@ -92,10 +92,10 @@ mobs:alias_mob("mobs:pumba", "mobs_animal:pumba")
|
||||
|
||||
-- raw porkchop
|
||||
|
||||
minetest.register_craftitem(":mobs:pork_raw", {
|
||||
core.register_craftitem(":mobs:pork_raw", {
|
||||
description = S("Raw Porkchop"),
|
||||
inventory_image = "mobs_pork_raw.png",
|
||||
on_use = minetest.item_eat(4),
|
||||
on_use = core.item_eat(4),
|
||||
groups = {food_meat_raw = 1, food_pork_raw = 1}
|
||||
})
|
||||
|
||||
@ -103,16 +103,16 @@ mobs.add_eatable("mobs:pork_raw", 4)
|
||||
|
||||
-- cooked porkchop and recipe
|
||||
|
||||
minetest.register_craftitem(":mobs:pork_cooked", {
|
||||
core.register_craftitem(":mobs:pork_cooked", {
|
||||
description = S("Cooked Porkchop"),
|
||||
inventory_image = "mobs_pork_cooked.png",
|
||||
on_use = minetest.item_eat(8),
|
||||
on_use = core.item_eat(8),
|
||||
groups = {food_meat = 1, food_pork = 1}
|
||||
})
|
||||
|
||||
mobs.add_eatable("mobs:pork_cooked", 8)
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs:pork_cooked",
|
||||
recipe = "mobs:pork_raw",
|
||||
|