Add "chicken" & "sheep" mods from "Creatures MOB-Engine" (cme).
|
@ -26,6 +26,9 @@ The following mods are also included:
|
|||
* [creatures (Creatures MOB-Engine)][cme] ([zlib/CC-BY-SA](doc/modpacks/cme/README.txt))
|
||||
* farming/
|
||||
* [farming_plus][] ([WTFPL](mods/farming/farming_plus/README.txt))
|
||||
* friendlies/
|
||||
* chicken ([Creatures MOB-Engine][cme])
|
||||
* sheep ([Creatures MOB-Engine][cme])
|
||||
* lib/
|
||||
* [biome_lib][] ([WTFPL](mods/lib/biome_lib/README.md))
|
||||
* [signs_lib][] ([BSD/WTFPL](mods/lib/signs_lib/copyright.txt))
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
Chicken for Creatures MOB-Engine
|
||||
================================
|
||||
Copyright (c) 2015-2016 BlockMen <blockmen2015@gmail.com>
|
||||
|
||||
Version: 2.2
|
||||
|
||||
|
||||
Adds chicken to Minetest (requires Creatures MOB-Engine).
|
||||
Chicken spawn on dirt and grass blocks, have 5 HP and are friendly. When killed or dying
|
||||
they drop meat, which can be eaten or cooked and probably some feathers. Also they drop
|
||||
randomly eggs, which can be thrown to spawn new chicken or fried and eaten.
|
||||
|
||||
|
||||
License:
|
||||
~~~~~~~~
|
||||
Code:
|
||||
(c) Copyright 2015-2016 BlockMen; modified zlib-License
|
||||
see "LICENSE.txt" for details.
|
||||
|
||||
Media(textures and meshes/models):
|
||||
Gamit(WTFPL):
|
||||
creatures_egg.png
|
||||
everything else:
|
||||
(c) Copyright (2014-2016) BlockMen; CC-BY-SA 3.0
|
||||
|
||||
Sounds:
|
||||
- creatures_chicken*.ogg, dobroide(https://freesound.org/people/dobroide) CC BY 3.0
|
||||
|
||||
Github:
|
||||
~~~~~~~
|
||||
https://github.com/BlockMen/cme/chicken
|
|
@ -0,0 +1,2 @@
|
|||
default
|
||||
creatures
|
|
@ -0,0 +1,84 @@
|
|||
--= Chicken for Creatures MOB-Engine (cme) =--
|
||||
-- Copyright (c) 2015-2016 BlockMen <blockmen2015@gmail.com>
|
||||
--
|
||||
-- egg.lua
|
||||
--
|
||||
-- This software is provided 'as-is', without any express or implied warranty. In no
|
||||
-- event will the authors be held liable for any damages arising from the use of
|
||||
-- this software.
|
||||
--
|
||||
-- Permission is granted to anyone to use this software for any purpose, including
|
||||
-- commercial applications, and to alter it and redistribute it freely, subject to the
|
||||
-- following restrictions:
|
||||
--
|
||||
-- 1. The origin of this software must not be misrepresented; you must not
|
||||
-- claim that you wrote the original software. If you use this software in a
|
||||
-- product, an acknowledgment in the product documentation is required.
|
||||
-- 2. Altered source versions must be plainly marked as such, and must not
|
||||
-- be misrepresented as being the original software.
|
||||
-- 3. This notice may not be removed or altered from any source distribution.
|
||||
--
|
||||
|
||||
|
||||
|
||||
local function timer(step, entity)
|
||||
if not entity then
|
||||
return
|
||||
end
|
||||
|
||||
if entity.physical_state == false then
|
||||
if entity.ref then
|
||||
if math.random(1, 20) == 5 then
|
||||
core.add_entity(entity.ref:getpos(), "creatures:chicken")
|
||||
end
|
||||
entity.ref:remove()
|
||||
end
|
||||
else
|
||||
core.after(step, timer, step, entity)
|
||||
end
|
||||
end
|
||||
|
||||
function throw_egg(player, strength)
|
||||
local pos = player:getpos()
|
||||
pos.y = pos.y + 1.5
|
||||
local dir = player:get_look_dir()
|
||||
pos.x = pos.x + dir.x
|
||||
pos.z = pos.z + dir.z
|
||||
local obj = minetest.add_item(pos, "creatures:egg")
|
||||
if obj then
|
||||
local entity = obj:get_luaentity()
|
||||
entity.ref = obj
|
||||
entity.mergeable = false
|
||||
obj:setvelocity({x = dir.x * strength, y = -3, z = dir.z * strength})
|
||||
obj:setacceleration({x = dir.x * -5 + dir.y, y = -13, z = dir.z * -5 + dir.y})
|
||||
timer(0.1, entity)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
core.register_craftitem(":creatures:egg", {
|
||||
description = "Egg",
|
||||
inventory_image = "creatures_egg.png",
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
--if pointed_thing.type ~= "none" then
|
||||
-- return
|
||||
--end
|
||||
if throw_egg(user, 12) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_craftitem(":creatures:fried_egg", {
|
||||
description = "Fried Egg",
|
||||
inventory_image = "creatures_fried_egg.png",
|
||||
on_use = core.item_eat(2)
|
||||
})
|
||||
|
||||
core.register_craft({
|
||||
type = "cooking",
|
||||
output = "creatures:fried_egg",
|
||||
recipe = "creatures:egg",
|
||||
})
|
|
@ -0,0 +1,137 @@
|
|||
--= Chicken for Creatures MOB-Engine (cme) =--
|
||||
-- Copyright (c) 2015-2016 BlockMen <blockmen2015@gmail.com>
|
||||
--
|
||||
-- init.lua
|
||||
--
|
||||
-- This software is provided 'as-is', without any express or implied warranty. In no
|
||||
-- event will the authors be held liable for any damages arising from the use of
|
||||
-- this software.
|
||||
--
|
||||
-- Permission is granted to anyone to use this software for any purpose, including
|
||||
-- commercial applications, and to alter it and redistribute it freely, subject to the
|
||||
-- following restrictions:
|
||||
--
|
||||
-- 1. The origin of this software must not be misrepresented; you must not
|
||||
-- claim that you wrote the original software. If you use this software in a
|
||||
-- product, an acknowledgment in the product documentation is required.
|
||||
-- 2. Altered source versions must be plainly marked as such, and must not
|
||||
-- be misrepresented as being the original software.
|
||||
-- 3. This notice may not be removed or altered from any source distribution.
|
||||
--
|
||||
|
||||
|
||||
|
||||
-- Egg
|
||||
dofile(core.get_modpath("chicken") .. "/egg.lua")
|
||||
local function dropEgg(obj)
|
||||
local pos = obj:getpos()
|
||||
if pos then
|
||||
creatures.dropItems(pos, {{"creatures:egg"}})
|
||||
end
|
||||
end
|
||||
|
||||
-- Flesh
|
||||
core.register_craftitem(":creatures:chicken_flesh", {
|
||||
description = "Raw Chicken Flesh",
|
||||
inventory_image = "creatures_chicken_flesh.png",
|
||||
on_use = core.item_eat(1)
|
||||
})
|
||||
|
||||
core.register_craftitem(":creatures:chicken_meat", {
|
||||
description = "Chicken Meat",
|
||||
inventory_image = "creatures_chicken_meat.png",
|
||||
on_use = core.item_eat(3)
|
||||
})
|
||||
|
||||
core.register_craft({
|
||||
type = "cooking",
|
||||
output = "creatures:chicken_meat",
|
||||
recipe = "creatures:chicken_flesh",
|
||||
})
|
||||
|
||||
-- Feather
|
||||
core.register_craftitem(":creatures:feather", {
|
||||
description = "Feather",
|
||||
inventory_image = "creatures_feather.png",
|
||||
})
|
||||
|
||||
local def = {
|
||||
-- general
|
||||
name = "creatures:chicken",
|
||||
stats = {
|
||||
hp = 5,
|
||||
lifetime = 300, -- 5 Minutes
|
||||
can_jump = 1,
|
||||
can_swim = true,
|
||||
can_burn = true,
|
||||
can_panic = true,
|
||||
has_kockback = true,
|
||||
sneaky = true,
|
||||
},
|
||||
|
||||
modes = {
|
||||
idle = {chance = 0.25, duration = 5, update_yaw = 3},
|
||||
idle2 = {chance = 0.69, duration = 0.8},
|
||||
pick = {chance = 0.2, duration = 2},
|
||||
walk = {chance = 0.2, duration = 5.5, moving_speed = 0.7, update_yaw = 2},
|
||||
panic = {moving_speed = 2.1},
|
||||
lay_egg = {chance = 0.01, duration = 1},
|
||||
},
|
||||
|
||||
model = {
|
||||
mesh = "creatures_chicken.b3d",
|
||||
textures = {"creatures_chicken.png"},
|
||||
collisionbox = {-0.25, -0.01, -0.3, 0.25, 0.45, 0.3},
|
||||
rotation = 90.0,
|
||||
collide_with_objects = false,
|
||||
animations = {
|
||||
idle = {start = 0, stop = 1, speed = 10},
|
||||
idle2 = {start = 40, stop = 50, speed = 50},
|
||||
pick = {start = 88, stop = 134, speed = 50},
|
||||
walk = {start = 4, stop = 36, speed = 50},
|
||||
-- special modes
|
||||
swim = {start = 51, stop = 87, speed = 40},
|
||||
panic = {start = 51, stop = 87, speed = 55},
|
||||
death = {start = 135, stop = 160, speed = 28, loop = false, duration = 2.12},
|
||||
},
|
||||
},
|
||||
|
||||
sounds = {
|
||||
on_damage = {name = "creatures_chicken_hit", gain = 0.5, distance = 10},
|
||||
on_death = {name = "creatures_chicken_hit", gain = 0.5, distance = 10},
|
||||
swim = {name = "creatures_splash", gain = 1.0, distance = 10},
|
||||
random = {
|
||||
idle = {name = "creatures_chicken", gain = 0.9, distance = 12, time_min = 8, time_max = 50},
|
||||
},
|
||||
},
|
||||
|
||||
spawning = {
|
||||
abm_nodes = {
|
||||
spawn_on = {"default:dirt_with_grass", "default:dirt"},
|
||||
},
|
||||
abm_interval = 55,
|
||||
abm_chance = 7800,
|
||||
max_number = 1,
|
||||
number = 1,
|
||||
light = {min = 8, max = 15},
|
||||
height_limit = {min = 0, max = 150},
|
||||
|
||||
spawn_egg = {
|
||||
description = "Chicken Spawn-Egg",
|
||||
},
|
||||
},
|
||||
|
||||
drops = {
|
||||
{"creatures:chicken_flesh"},
|
||||
{"creatures:feather", {min = 1, max = 2}, chance = 0.45},
|
||||
},
|
||||
|
||||
on_step = function(self, dtime)
|
||||
if self.mode == "lay_egg" then
|
||||
dropEgg(self.object)
|
||||
self.modetimer = 2
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
creatures.register_mob(def)
|
After Width: | Height: | Size: 710 B |
After Width: | Height: | Size: 969 B |
After Width: | Height: | Size: 966 B |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 452 B |
After Width: | Height: | Size: 2.9 KiB |
|
@ -0,0 +1,39 @@
|
|||
Sheep for Creatures MOB-Engine
|
||||
==============================
|
||||
Copyright (c) 2015-2016 BlockMen <blockmen2015@gmail.com>
|
||||
|
||||
Version: 2.1
|
||||
|
||||
|
||||
Adds sheep to Minetest (requires Creatures MOB-Engine).
|
||||
Sheep spawn only at day-time and are friendly and remain around 5 minutes in the world.
|
||||
There are four different wool colors: white, grey, brown and black.
|
||||
You can tame them by feading them with wheat. If there is grass they eat the grass
|
||||
and regrow wool that way. They will follow you if you have Wheat in your hand.
|
||||
Sheep have 8 HP and drop 1-2 wool when punched or 1-3 wool when using shears.
|
||||
|
||||
Sheers are crafted by using 2 steel ingots and one stick in following shape:
|
||||
|
||||
- ingot
|
||||
ingot stick
|
||||
|
||||
|
||||
License:
|
||||
~~~~~~~~
|
||||
Code:
|
||||
(c) Copyright 2015-2016 BlockMen; modified zlib-License
|
||||
see "LICENSE.txt" for details.
|
||||
|
||||
Media(textures and meshes/models):
|
||||
(c) Copyright (2014-2016) BlockMen; CC-BY-SA 3.0
|
||||
|
||||
Sounds:
|
||||
- creatures_sheep.1.ogg, confusion_music(https://freesound.org/people/confusion_music) CC-BY 3.0
|
||||
- creatures_sheep.2.ogg, confusion_music(https://freesound.org/people/confusion_music) CC-BY 3.0
|
||||
- creatures_sheep.3.ogg, Yuval(https://freesound.org/people/Yuval) CC-BY 3.0
|
||||
- creatures_shears.ogg, SmartWentCody(https://freesound.org/people/SmartWentCody) CC-BY 3.0
|
||||
|
||||
|
||||
Github:
|
||||
~~~~~~~
|
||||
https://github.com/BlockMen/cme/sheep
|
|
@ -0,0 +1,4 @@
|
|||
default
|
||||
creatures
|
||||
farming?
|
||||
wool?
|
|
@ -0,0 +1,215 @@
|
|||
--= Sheep for Creatures MOB-Engine (cme) =--
|
||||
-- Copyright (c) 2015-2016 BlockMen <blockmen2015@gmail.com>
|
||||
--
|
||||
-- init.lua
|
||||
--
|
||||
-- This software is provided 'as-is', without any express or implied warranty. In no
|
||||
-- event will the authors be held liable for any damages arising from the use of
|
||||
-- this software.
|
||||
--
|
||||
-- Permission is granted to anyone to use this software for any purpose, including
|
||||
-- commercial applications, and to alter it and redistribute it freely, subject to the
|
||||
-- following restrictions:
|
||||
--
|
||||
-- 1. The origin of this software must not be misrepresented; you must not
|
||||
-- claim that you wrote the original software. If you use this software in a
|
||||
-- product, an acknowledgment in the product documentation is required.
|
||||
-- 2. Altered source versions must be plainly marked as such, and must not
|
||||
-- be misrepresented as being the original software.
|
||||
-- 3. This notice may not be removed or altered from any source distribution.
|
||||
--
|
||||
|
||||
|
||||
-- shears
|
||||
core.register_tool(":creatures:shears", {
|
||||
description = "Shears",
|
||||
inventory_image = "creatures_shears.png",
|
||||
})
|
||||
|
||||
core.register_craft({
|
||||
output = 'creatures:shears',
|
||||
recipe = {
|
||||
{'', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', 'default:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
local function setColor(self)
|
||||
if self and self.object then
|
||||
local ext = ".png"
|
||||
if self.has_wool ~= true then
|
||||
ext = ".png^(creatures_sheep_shaved.png^[colorize:" .. self.wool_color:gsub("grey", "gray") .. ":50)"
|
||||
end
|
||||
self.object:set_properties({textures = {"creatures_sheep.png^creatures_sheep_" .. self.wool_color .. ext}})
|
||||
end
|
||||
end
|
||||
|
||||
local function shear(self, drop_count, sound)
|
||||
if self.has_wool == true then
|
||||
self.has_wool = false
|
||||
local pos = self.object:getpos()
|
||||
if sound then
|
||||
core.sound_play("creatures_shears", {pos = pos, gain = 1, max_hear_distance = 10})
|
||||
end
|
||||
|
||||
setColor(self)
|
||||
creatures.dropItems(pos, {{"wool:" .. self.wool_color, drop_count}})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- white, grey, brown, black (see wool colors as reference)
|
||||
local colors = {"white", "grey", "brown", "black"}
|
||||
|
||||
local def = {
|
||||
name = "creatures:sheep",
|
||||
stats = {
|
||||
hp = 8,
|
||||
lifetime = 450, -- 7,5 Minutes
|
||||
can_jump = 1,
|
||||
can_swim = true,
|
||||
can_burn = true,
|
||||
can_panic = true,
|
||||
has_falldamage = true,
|
||||
has_kockback = true,
|
||||
},
|
||||
|
||||
model = {
|
||||
mesh = "creatures_sheep.b3d",
|
||||
textures = {"creatures_sheep.png^creatures_sheep_white.png"},
|
||||
collisionbox = {-0.5, -0.01, -0.55, 0.5, 1.1, 0.55},
|
||||
rotation = -90.0,
|
||||
animations = {
|
||||
idle = {start = 1, stop = 60, speed = 15},
|
||||
walk = {start = 81, stop = 101, speed = 18},
|
||||
walk_long = {start = 81, stop = 101, speed = 18},
|
||||
eat = {start = 107, stop = 170, speed = 12, loop = false},
|
||||
follow = {start = 81, stop = 101, speed = 15},
|
||||
death = {start = 171, stop = 191, speed = 32, loop = false, duration = 2.52},
|
||||
},
|
||||
},
|
||||
|
||||
sounds = {
|
||||
on_damage = {name = "creatures_sheep", gain = 1.0, distance = 10},
|
||||
on_death = {name = "creatures_sheep", gain = 1.0, distance = 10},
|
||||
swim = {name = "creatures_splash", gain = 1.0, distance = 10,},
|
||||
random = {
|
||||
idle = {name = "creatures_sheep", gain = 0.6, distance = 10, time_min = 23},
|
||||
},
|
||||
},
|
||||
|
||||
modes = {
|
||||
idle = {chance = 0.5, duration = 10, update_yaw = 8},
|
||||
walk = {chance = 0.14, duration = 4.5, moving_speed = 1.3},
|
||||
walk_long = {chance = 0.11, duration = 8, moving_speed = 1.3, update_yaw = 5},
|
||||
-- special modes
|
||||
follow = {chance = 0, duration = 20, radius = 4, timer = 5, moving_speed = 1, items = {"farming:wheat"}},
|
||||
eat = { chance = 0.25,
|
||||
duration = 4,
|
||||
nodes = {
|
||||
"default:grass_1", "default:grass_2", "default:grass_3",
|
||||
"default:grass_4", "default:grass_5", "default:dirt_with_grass"
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
drops = function(self)
|
||||
local items = {{"creatures:flesh"}}
|
||||
if self.has_wool then
|
||||
table.insert(items, {"wool:" .. self.wool_color, {min = 1, max = 2}})
|
||||
end
|
||||
creatures.dropItems(self.object:getpos(), items)
|
||||
end,
|
||||
|
||||
spawning = {
|
||||
abm_nodes = {
|
||||
spawn_on = {"default:dirt_with_grass"},
|
||||
},
|
||||
abm_interval = 55,
|
||||
abm_chance = 7800,
|
||||
max_number = 1,
|
||||
number = {min = 1, max = 3},
|
||||
time_range = {min = 5100, max = 18300},
|
||||
light = {min = 10, max = 15},
|
||||
height_limit = {min = 0, max = 25},
|
||||
|
||||
spawn_egg = {
|
||||
description = "Sheep Spawn-Egg",
|
||||
texture = "creatures_egg_sheep.png",
|
||||
},
|
||||
|
||||
spawner = {
|
||||
description = "Sheep Spawner",
|
||||
range = 8,
|
||||
player_range = 20,
|
||||
number = 6,
|
||||
}
|
||||
},
|
||||
|
||||
on_punch = function(self, puncher)
|
||||
shear(self)
|
||||
end,
|
||||
|
||||
get_staticdata = function(self)
|
||||
return {
|
||||
has_wool = self.has_wool,
|
||||
wool_color = self.wool_color,
|
||||
}
|
||||
end,
|
||||
|
||||
on_activate = function(self, staticdata)
|
||||
if self.has_wool == nil then
|
||||
self.has_wool = true
|
||||
end
|
||||
|
||||
if not self.wool_color then
|
||||
self.wool_color = colors[math.random(1, #colors)]
|
||||
end
|
||||
-- update fur
|
||||
setColor(self)
|
||||
end,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
local item = clicker:get_wielded_item()
|
||||
if item then
|
||||
local name = item:get_name()
|
||||
if name == "farming:wheat" then
|
||||
self.target = clicker
|
||||
self.mode = "follow"
|
||||
self.modetimer = 0
|
||||
|
||||
if not self.tamed then
|
||||
self.fed_cnt = (self.fed_cnt or 0) + 1
|
||||
end
|
||||
|
||||
-- play eat sound?
|
||||
item:take_item()
|
||||
elseif name == "creatures:shears" and self.has_wool then
|
||||
shear(self, math.random(2, 3), true)
|
||||
item:add_wear(65535/100)
|
||||
end
|
||||
if not core.setting_getbool("creative_mode") then
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
end
|
||||
return true
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
if self.mode == "eat" and self.eat_node then
|
||||
self.regrow_wool = true
|
||||
end
|
||||
if self.last_mode == "eat" and (self.modetimer and self.modetimer == 0) and self.regrow_wool then
|
||||
self.has_wool = true
|
||||
self.regrow_wool = nil
|
||||
setColor(self)
|
||||
end
|
||||
if self.fed_cnt and self.fed_cnt > 4 then
|
||||
self.tamed = true
|
||||
self.fed_cnt = nil
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
creatures.register_mob(def)
|
After Width: | Height: | Size: 675 B |
After Width: | Height: | Size: 282 B |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 4.5 KiB |