Merge branch 'master' of https://github.com/maikerumine/mobs_mc
@ -33,7 +33,10 @@ mobs_mc.items = {
|
|||||||
egg = "mobs_mc:egg",
|
egg = "mobs_mc:egg",
|
||||||
ender_eye = "mobs_mc:ender_eye",
|
ender_eye = "mobs_mc:ender_eye",
|
||||||
ghast_tear = "mobs_mc:ghast_tear",
|
ghast_tear = "mobs_mc:ghast_tear",
|
||||||
saddle = "mobs_mc:saddle",
|
saddle = "mobs:saddle",
|
||||||
|
iron_horse_armor = "mobs_mc:iron_horse_armor",
|
||||||
|
gold_horse_armor = "mobs_mc:gold_horse_armor",
|
||||||
|
diamond_horse_armor = "mobs_mc:diamond_horse_armor",
|
||||||
porkchop_raw = "mobs_mc:porkchop_raw",
|
porkchop_raw = "mobs_mc:porkchop_raw",
|
||||||
porkchop_cooked = "mobs_mc:porkchop_cooked",
|
porkchop_cooked = "mobs_mc:porkchop_cooked",
|
||||||
carrot_on_a_stick = "mobs_mc:carrot_on_a_stick",
|
carrot_on_a_stick = "mobs_mc:carrot_on_a_stick",
|
||||||
|
@ -236,7 +236,8 @@ end
|
|||||||
|
|
||||||
-- Saddle
|
-- Saddle
|
||||||
if c("saddle") then
|
if c("saddle") then
|
||||||
minetest.register_craftitem("mobs_mc:saddle", {
|
-- Overwrite the saddle from Mobs Redo
|
||||||
|
minetest.register_craftitem(":mobs:saddle", {
|
||||||
description = "Saddle",
|
description = "Saddle",
|
||||||
inventory_image = "mcl_mobitems_saddle.png",
|
inventory_image = "mcl_mobitems_saddle.png",
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
@ -254,6 +255,36 @@ if c("saddle") and c("lether") and c("string") and c("iron_ingot") then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Horse Armor
|
||||||
|
-- TODO: Balance the horse armor strength, compare with MC armor strength
|
||||||
|
if c("iron_horse_armor") then
|
||||||
|
minetest.register_craftitem("mobs_mc:iron_horse_armor", {
|
||||||
|
description = "Iron Horse Armor",
|
||||||
|
inventory_image = "mobs_mc_iron_horse_armor.png",
|
||||||
|
_horse_overlay_image = "mobs_mc_horse_armor_iron.png",
|
||||||
|
stack_max = 1,
|
||||||
|
groups = { horse_armor = 85 },
|
||||||
|
})
|
||||||
|
end
|
||||||
|
if c("gold_horse_armor") then
|
||||||
|
minetest.register_craftitem("mobs_mc:gold_horse_armor", {
|
||||||
|
description = "Golden Horse Armor",
|
||||||
|
inventory_image = "mobs_mc_gold_horse_armor.png",
|
||||||
|
_horse_overlay_image = "mobs_mc_horse_armor_gold.png",
|
||||||
|
stack_max = 1,
|
||||||
|
groups = { horse_armor = 60 },
|
||||||
|
})
|
||||||
|
end
|
||||||
|
if c("diamond_horse_armor") then
|
||||||
|
minetest.register_craftitem("mobs_mc:diamond_horse_armor", {
|
||||||
|
description = "Diamond Horse Armor",
|
||||||
|
inventory_image = "mobs_mc_diamond_horse_armor.png",
|
||||||
|
_horse_overlay_image = "mobs_mc_horse_armor_diamond.png",
|
||||||
|
stack_max = 1,
|
||||||
|
groups = { horse_armor = 45 },
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
-- Pig
|
-- Pig
|
||||||
if c("porkchop_raw") then
|
if c("porkchop_raw") then
|
||||||
minetest.register_craftitem("mobs_mc:porkchop_raw", {
|
minetest.register_craftitem("mobs_mc:porkchop_raw", {
|
||||||
|
@ -3,21 +3,52 @@
|
|||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code GPL and otherwise stated in readmes such as this one.
|
--License for code GPL and otherwise stated in readmes such as this one.
|
||||||
|
|
||||||
#### Links
|
## Links
|
||||||
[blender models](https://github.com/22i/minecraft-voxel-blender-models),
|
|
||||||
[mobs_mc](https://github.com/maikerumine/mobs_mc),
|
|
||||||
[how to recreate mobs from textures with Blender and Gimp](http://imgur.com/a/Iqg88)
|
|
||||||
|
|
||||||
Minecraft mobs were remade in blender
|
* [Blender models](https://github.com/22i/minecraft-voxel-blender-models),
|
||||||
Credits:[22i](https://github.com/22i) All 3-D Models - Most of the models, otherwise stated elsewhere.[toby109tt](https://github.com/tobyplowy) mapping fixes - better 2d planes.[maikerumine](https://github.com/maikerumine) Coding behaviour, spawning, drops, and misc.[wuzzy2](https://github.com/Wuzzy2) Zombies, Husks, Item textures, and lots of code.
|
* [mobs_mc](https://github.com/maikerumine/mobs_mc),
|
||||||
|
* [How to recreate mobs from textures with Blender and Gimp](http://imgur.com/a/Iqg88)
|
||||||
|
|
||||||
Sounds: W.I.P.
|
### Credits
|
||||||
Pig sounds: mobs_pig, mobs_pig_angryPig sounds taken from mobs_animal mod, licensed under MIT LicensePig textures: From Faithful Vanilla <https://minecraft.curseforge.com/projects/faithful-vanilla>
|
|
||||||
|
|
||||||
Chicken sounds:- `mobs_mc_chicken_lay_egg.ogg` - WTFPL, by PilzAdam and Wuzzy- `mobs_chicken.ogg` - MIT License, from `mobs_animal` and `mobs_monster` by TenPlus1
|
Minecraft mobs were remade in Blender by hand
|
||||||
|
|
||||||
Slimes sounds:- Author: Tomas J. Luis
|
* [22i](https://github.com/22i): All 3-D models, most of the models, otherwise stated elsewhere.
|
||||||
- Original sound for slime damage by RandomationPictures under licence CC0 1.0.http://www.freesound.org/people/RandomationPictures/sounds/138481/
|
* [toby109tt](https://github.com/tobyplowy): mapping fixes - better 2d planes.
|
||||||
- Original sounds for slime jump, land and death by Dr. Minky under licence CC BY 3.0.http://www.freesound.org/people/DrMinky/sounds/
|
* [maikerumine](https://github.com/maikerumine): Coding behaviour, spawning, drops, and misc.
|
||||||
|
* [Wuzzy2](https://github.com/Wuzzy2): Zombies, Husks, Item textures, and lots of code.
|
||||||
|
|
||||||
|
#### Textures (W.I.P.)
|
||||||
|
* Pig textures: From Faithful Vanilla <https://minecraft.curseforge.com/projects/faithful-vanilla>
|
||||||
|
|
||||||
|
#### Sounds (W.I.P.)
|
||||||
|
Note: “*” is a placeholder.
|
||||||
|
|
||||||
|
* Pig
|
||||||
|
* mobs_pig.ogg, mobs_pig_angry.ogg: From `mobs_animal` mod, licensed under MIT License
|
||||||
|
* Chicken
|
||||||
|
* `mobs_mc_chicken_lay_egg.ogg` - WTFPL, by PilzAdam and Wuzzy
|
||||||
|
* `mobs_chicken.ogg` - MIT License, from `mobs_animal` by TenPlus1
|
||||||
|
* Slime
|
||||||
|
* Author: Tomas J. Luis
|
||||||
|
* Original sound for slime damage by Randomation (CC0);
|
||||||
|
* Source: http://www.freesound.org/people/RandomationPictures/sounds/138481/
|
||||||
|
* Original sounds for slime jump, land and death by Dr. Minky under licence CC BY 3.0; http://www.freesound.org/people/DrMinky/sounds/
|
||||||
|
* Ender dragon
|
||||||
|
* `mobs_mc_ender_dragon_*`: NPXcoot (https://github.com/NPXcoot1) CC BY-SA 4.0
|
||||||
|
* Cow/Mooshroom
|
||||||
|
* `mobs_mc_cow.ogg`, CC0, by Freesound.org user Zozzy
|
||||||
|
* Source: <https://www.freesound.org/people/Zozzy/sounds/59245/>
|
||||||
|
* Sheep
|
||||||
|
* `mobs_sheep.ogg`, CC BY 3.0, created by the Blender Foundation
|
||||||
|
* Llama:
|
||||||
|
* `mobs_mc_llama.ogg`, MIT License, from `mobs_animal` by TenPlus1
|
||||||
|
|
||||||
|
### License links
|
||||||
|
|
||||||
|
* [CC0](https://creativecommons.org/choose/zero/)
|
||||||
|
* [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)
|
||||||
|
* [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)
|
||||||
|
* [GPLv3](https://www.gnu.org/licenses/gpl-3.0.html])
|
||||||
|
* [MIT](https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
Mese Dragon sounds:NPXcoot https://github.com/NPXcoot1 The license for all the models, textures and sound is 2 CC BY-SA 4.0
|
|
||||||
|
@ -24,9 +24,9 @@ mobs:register_mob("mobs_mc:blaze", {
|
|||||||
},
|
},
|
||||||
visual_size = {x=3, y=3},
|
visual_size = {x=3, y=3},
|
||||||
sounds = {
|
sounds = {
|
||||||
random = "blaze_breath",
|
random = "mobs_mc_blaze_breath",
|
||||||
death = "blaze_died",
|
death = "mobs_mc_blaze_died",
|
||||||
damage = "blaze_hurt1",
|
damage = "mobs_mc_blaze_hurt",
|
||||||
distance = 16,
|
distance = 16,
|
||||||
},
|
},
|
||||||
walk_velocity = .8,
|
walk_velocity = .8,
|
||||||
|
@ -28,9 +28,9 @@ local cow_def = {
|
|||||||
light_damage = 0,
|
light_damage = 0,
|
||||||
runaway = true,
|
runaway = true,
|
||||||
sounds = {
|
sounds = {
|
||||||
random = "Cow1",
|
random = "mobs_mc_cow",
|
||||||
death = "Cowhurt1",
|
death = "Cowhurt1", -- TODO: Replace
|
||||||
damage = "Cowhurt1",
|
damage = "Cowhurt1", -- TODO: Replace
|
||||||
distance = 16,
|
distance = 16,
|
||||||
},
|
},
|
||||||
animation = {
|
animation = {
|
||||||
|
@ -42,17 +42,17 @@ mobs:register_mob("mobs_mc:enderdragon", {
|
|||||||
collisionbox = {-2, 3, -2, 2, 5, 2},
|
collisionbox = {-2, 3, -2, 2, 5, 2},
|
||||||
physical = false,
|
physical = false,
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_ender_dragon.b3d",
|
mesh = "mobs_mc_dragon.b3d",
|
||||||
textures = {
|
textures = {
|
||||||
{"mobs_mc_enderdragon.png"},
|
{"mobs_mc_dragon.png"},
|
||||||
},
|
},
|
||||||
visual_size = {x=3, y=3},
|
visual_size = {x=3, y=3},
|
||||||
view_range = 35,
|
view_range = 35,
|
||||||
walk_velocity = 6,
|
walk_velocity = 6,
|
||||||
run_velocity = 6,
|
run_velocity = 6,
|
||||||
sounds = {
|
sounds = {
|
||||||
shoot_attack = "mesed",
|
shoot_attack = "mobs_mc_ender_dragon_shoot",
|
||||||
attack = "mese_dragon",
|
attack = "mobs_mc_ender_dragon_attack",
|
||||||
distance = 60,
|
distance = 60,
|
||||||
},
|
},
|
||||||
physical = true,
|
physical = true,
|
||||||
|
162
horse.lua
@ -10,7 +10,17 @@
|
|||||||
--################### HORSE
|
--################### HORSE
|
||||||
--###################
|
--###################
|
||||||
|
|
||||||
local horse_extra_texture = function(base, saddle, chest)
|
-- Return overlay texture for horse/donkey/mule, e.g. chest, saddle or horse armor
|
||||||
|
local horse_extra_texture = function(horse)
|
||||||
|
local base = horse._naked_texture
|
||||||
|
local saddle = horse._saddle
|
||||||
|
local chest = horse._chest
|
||||||
|
local armor = horse._horse_armor
|
||||||
|
if armor then
|
||||||
|
if minetest.get_item_group(armor, "horse_armor") > 0 then
|
||||||
|
base = base .. "^" .. minetest.registered_items[armor]._horse_overlay_image
|
||||||
|
end
|
||||||
|
end
|
||||||
if saddle then
|
if saddle then
|
||||||
base = base .. "^mobs_mc_horse_saddle.png"
|
base = base .. "^mobs_mc_horse_saddle.png"
|
||||||
end
|
end
|
||||||
@ -20,6 +30,41 @@ local horse_extra_texture = function(base, saddle, chest)
|
|||||||
return base
|
return base
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Helper functions to determine equipment rules
|
||||||
|
local can_equip_horse_armor = function(entity_id)
|
||||||
|
return entity_id == "mobs_mc:horse" or entity_id == "mobs_mc:skeleton_horse" or entity_id == "mobs_mc:zombie_horse"
|
||||||
|
end
|
||||||
|
local can_equip_chest = function(entity_id)
|
||||||
|
return entity_id == "mobs_mc:mule" or entity_id == "mobs_mc:donkey"
|
||||||
|
end
|
||||||
|
|
||||||
|
--[[ Generate all possible horse textures.
|
||||||
|
Horse textures are a combination of a base texture and an optional marking overlay. ]]
|
||||||
|
-- The base horse textures
|
||||||
|
local horse_base = {
|
||||||
|
"mobs_mc_horse_brown.png",
|
||||||
|
"mobs_mc_horse_darkbrown.png",
|
||||||
|
"mobs_mc_horse_white.png",
|
||||||
|
"mobs_mc_horse_gray.png",
|
||||||
|
"mobs_mc_horse_black.png",
|
||||||
|
"mobs_mc_horse_chestnut.png",
|
||||||
|
}
|
||||||
|
-- Horse marking texture overlay, to be appended to the base texture string
|
||||||
|
local horse_markings = {
|
||||||
|
"", -- no markings
|
||||||
|
"^mobs_mc_horse_markings_whitedots.png", -- snowflake appaloosa
|
||||||
|
"^mobs_mc_horse_markings_blackdots.png", -- sooty
|
||||||
|
"^mobs_mc_horse_markings_whitefield.png", -- paint
|
||||||
|
"^mobs_mc_horse_markings_white.png", -- stockings and blaze
|
||||||
|
}
|
||||||
|
|
||||||
|
local horse_textures = {}
|
||||||
|
for b=1, #horse_base do
|
||||||
|
for m=1, #horse_markings do
|
||||||
|
table.insert(horse_textures, { horse_base[b] .. horse_markings[m] })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Horse
|
-- Horse
|
||||||
local horse = {
|
local horse = {
|
||||||
type = "animal",
|
type = "animal",
|
||||||
@ -28,19 +73,12 @@ local horse = {
|
|||||||
visual_size = {x=3.0, y=3.0},
|
visual_size = {x=3.0, y=3.0},
|
||||||
collisionbox = {-0.69825, -0.01, -0.69825, 0.69825, 1.59, 0.69825},
|
collisionbox = {-0.69825, -0.01, -0.69825, 0.69825, 1.59, 0.69825},
|
||||||
animation = {
|
animation = {
|
||||||
speed_normal = 25, speed_run = 50,
|
stand_speed = 25, walk_speed = 25, run_speed = 50,
|
||||||
stand_start = 0, stand_end = 0,
|
stand_start = 0, stand_end = 0,
|
||||||
walk_start = 0, walk_end = 40,
|
walk_start = 0, walk_end = 40,
|
||||||
run_start = 0, run_end = 40,
|
run_start = 0, run_end = 40,
|
||||||
},
|
|
||||||
textures = {
|
|
||||||
{"mobs_mc_horse_brown.png"},
|
|
||||||
{"mobs_mc_horse_darkbrown.png"},
|
|
||||||
{"mobs_mc_horse_white.png"},
|
|
||||||
{"mobs_mc_horse_gray.png"},
|
|
||||||
{"mobs_mc_horse_black.png"},
|
|
||||||
{"mobs_mc_horse_chestnut.png"},
|
|
||||||
},
|
},
|
||||||
|
textures = horse_textures,
|
||||||
fear_height = 4,
|
fear_height = 4,
|
||||||
fly = false,
|
fly = false,
|
||||||
walk_chance = 60,
|
walk_chance = 60,
|
||||||
@ -63,6 +101,9 @@ local horse = {
|
|||||||
do_custom = function(self, dtime)
|
do_custom = function(self, dtime)
|
||||||
|
|
||||||
-- set needed values if not already present
|
-- set needed values if not already present
|
||||||
|
if not self._regentimer then
|
||||||
|
self._regentimer = 0
|
||||||
|
end
|
||||||
if not self.v2 then
|
if not self.v2 then
|
||||||
self.v2 = 0
|
self.v2 = 0
|
||||||
self.max_speed_forward = 7
|
self.max_speed_forward = 7
|
||||||
@ -74,6 +115,15 @@ local horse = {
|
|||||||
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
|
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Slowly regenerate health
|
||||||
|
self._regentimer = self._regentimer + dtime
|
||||||
|
if self._regentimer >= 4 then
|
||||||
|
if self.health < self.hp_max then
|
||||||
|
self.health = self.health + 1
|
||||||
|
end
|
||||||
|
self._regentimer = 0
|
||||||
|
end
|
||||||
|
|
||||||
-- if driver present allow control of horse
|
-- if driver present allow control of horse
|
||||||
if self.driver then
|
if self.driver then
|
||||||
|
|
||||||
@ -88,9 +138,11 @@ local horse = {
|
|||||||
on_die = function(self, pos)
|
on_die = function(self, pos)
|
||||||
|
|
||||||
-- drop saddle when horse is killed while riding
|
-- drop saddle when horse is killed while riding
|
||||||
|
if self._saddle then
|
||||||
|
minetest.add_item(pos, mobs_mc.items.saddle)
|
||||||
|
end
|
||||||
-- also detach from horse properly
|
-- also detach from horse properly
|
||||||
if self.driver then
|
if self.driver then
|
||||||
minetest.add_item(pos, mobs_mc.items.saddle)
|
|
||||||
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -108,8 +160,8 @@ local horse = {
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- make sure tamed horse is being clicked by owner only
|
-- Make sure tamed horse is mature and being clicked by owner only
|
||||||
if self.tamed and self.owner == clicker:get_player_name() then
|
if self.tamed and not self.child and self.owner == clicker:get_player_name() then
|
||||||
|
|
||||||
local inv = clicker:get_inventory()
|
local inv = clicker:get_inventory()
|
||||||
|
|
||||||
@ -118,42 +170,72 @@ local horse = {
|
|||||||
|
|
||||||
mobs.detach(clicker, {x = 1, y = 0, z = 1})
|
mobs.detach(clicker, {x = 1, y = 0, z = 1})
|
||||||
|
|
||||||
-- add saddle back to inventory
|
-- Put on saddle if tamed
|
||||||
if inv:room_for_item("main", mobs_mc.items.saddle) then
|
elseif not self.driver and not self._saddle
|
||||||
inv:add_item("main", mobs_mc.items.saddle)
|
|
||||||
else
|
|
||||||
minetest.add_item(clicker.getpos(), mobs_mc.items.saddle)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Update texture
|
|
||||||
local tex = horse_extra_texture(self._naked_texture, false)
|
|
||||||
self.base_texture = { tex }
|
|
||||||
self.object:set_properties({textures = self.base_texture})
|
|
||||||
|
|
||||||
-- attach player to horse
|
|
||||||
elseif not self.driver
|
|
||||||
and clicker:get_wielded_item():get_name() == mobs_mc.items.saddle then
|
and clicker:get_wielded_item():get_name() == mobs_mc.items.saddle then
|
||||||
|
|
||||||
self.object:set_properties({stepheight = 1.1})
|
-- Put on saddle and take saddle from player's inventory
|
||||||
mobs.attach(self, clicker)
|
local w = clicker:get_wielded_item()
|
||||||
|
self._saddle = true
|
||||||
-- take saddle from inventory
|
if not minetest.settings:get_bool("creative_mode") then
|
||||||
inv:remove_item("main", mobs_mc.items.saddle)
|
w:take_item()
|
||||||
|
clicker:set_wielded_item(w)
|
||||||
|
end
|
||||||
|
|
||||||
-- Update texture
|
-- Update texture
|
||||||
if not self._naked_texture then
|
if not self._naked_texture then
|
||||||
-- Base horse texture without chest or saddle
|
-- Base horse texture without chest or saddle
|
||||||
self._naked_texture = self.base_texture[1]
|
self._naked_texture = self.base_texture[1]
|
||||||
end
|
end
|
||||||
local tex = horse_extra_texture(self._naked_texture, true)
|
local tex = horse_extra_texture(self)
|
||||||
self.base_texture = { tex }
|
self.base_texture = { tex }
|
||||||
self.object:set_properties({textures = self.base_texture})
|
self.object:set_properties({textures = self.base_texture})
|
||||||
|
|
||||||
|
-- Put on horse armor if tamed
|
||||||
|
elseif can_equip_horse_armor(self.name) and not self.driver and not self._horse_armor
|
||||||
|
and minetest.get_item_group(clicker:get_wielded_item():get_name(), "horse_armor") > 0 then
|
||||||
|
|
||||||
|
|
||||||
|
-- Put on armor and take armor from player's inventory
|
||||||
|
local w = clicker:get_wielded_item()
|
||||||
|
local armor = minetest.get_item_group(w:get_name(), "horse_armor")
|
||||||
|
self._horse_armor = w:get_name()
|
||||||
|
if not minetest.settings:get_bool("creative_mode") then
|
||||||
|
w:take_item()
|
||||||
|
clicker:set_wielded_item(w)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Set horse armor strength
|
||||||
|
--[[ WARNING: This goes deep into the entity data structure and depends on
|
||||||
|
how Mobs Redo works internally. This code assumes that Mobs Redo uses
|
||||||
|
the fleshy group for armor. ]]
|
||||||
|
-- TODO: Change this code as soon Mobs Redo officially allows to change armor afterwards
|
||||||
|
self.armor = armor
|
||||||
|
local agroups = self.object:get_armor_groups()
|
||||||
|
agroups.fleshy = self.armor
|
||||||
|
self.object:set_armor_groups(agroups)
|
||||||
|
|
||||||
|
-- Update texture
|
||||||
|
if not self._naked_texture then
|
||||||
|
-- Base horse texture without chest or saddle
|
||||||
|
self._naked_texture = self.base_texture[1]
|
||||||
|
end
|
||||||
|
local tex = horse_extra_texture(self)
|
||||||
|
self.base_texture = { tex }
|
||||||
|
self.object:set_properties({textures = self.base_texture})
|
||||||
|
|
||||||
|
|
||||||
|
-- Mount horse
|
||||||
|
elseif not self.driver and self._saddle then
|
||||||
|
|
||||||
|
self.object:set_properties({stepheight = 1.1})
|
||||||
|
mobs.attach(self, clicker)
|
||||||
|
|
||||||
|
-- Used to capture horse with magic lasso
|
||||||
|
elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then
|
||||||
|
mobs:capture_mob(self, clicker, 0, 0, 80, false, nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- used to capture horse with magic lasso
|
|
||||||
mobs:capture_mob(self, clicker, 0, 0, 80, false, nil)
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,6 +256,7 @@ skeleton_horse.sounds = {
|
|||||||
damage = "skeletonhurt1",
|
damage = "skeletonhurt1",
|
||||||
distance = 16,
|
distance = 16,
|
||||||
}
|
}
|
||||||
|
skeleton_horse.blood_amount = 0
|
||||||
mobs:register_mob("mobs_mc:skeleton_horse", skeleton_horse)
|
mobs:register_mob("mobs_mc:skeleton_horse", skeleton_horse)
|
||||||
|
|
||||||
-- Zombie horse
|
-- Zombie horse
|
||||||
@ -196,7 +279,6 @@ mobs:register_mob("mobs_mc:zombie_horse", zombie_horse)
|
|||||||
-- Donkey
|
-- Donkey
|
||||||
local d = 0.86 -- donkey scale
|
local d = 0.86 -- donkey scale
|
||||||
local donkey = table.copy(horse)
|
local donkey = table.copy(horse)
|
||||||
donkey.mesh = "mobs_mc_horse.b3d"
|
|
||||||
donkey.textures = {{"mobs_mc_horse_creamy.png"}}
|
donkey.textures = {{"mobs_mc_horse_creamy.png"}}
|
||||||
donkey.animation = {
|
donkey.animation = {
|
||||||
speed_normal = 25,
|
speed_normal = 25,
|
||||||
|
24
llama.lua
@ -38,9 +38,8 @@ mobs:register_mob("mobs_mc:llama", {
|
|||||||
light_damage = 0,
|
light_damage = 0,
|
||||||
fear_height = 4,
|
fear_height = 4,
|
||||||
sounds = {
|
sounds = {
|
||||||
random = "mobs_sheep",
|
random = "mobs_mc_llama",
|
||||||
death = "mobs_sheep",
|
-- TODO: Death and damage sounds
|
||||||
damage = "mobs_sheep",
|
|
||||||
distance = 16,
|
distance = 16,
|
||||||
},
|
},
|
||||||
animation = {
|
animation = {
|
||||||
@ -74,7 +73,7 @@ mobs:register_mob("mobs_mc:llama", {
|
|||||||
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
|
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- if driver present allow control of horse
|
-- if driver present allow control of llama
|
||||||
if self.driver then
|
if self.driver then
|
||||||
|
|
||||||
mobs.drive(self, "walk", "stand", false, dtime)
|
mobs.drive(self, "walk", "stand", false, dtime)
|
||||||
@ -96,22 +95,22 @@ mobs:register_mob("mobs_mc:llama", {
|
|||||||
|
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
|
|
||||||
-- make sure player is clicking
|
-- Make sure player is clicking
|
||||||
if not clicker or not clicker:is_player() then
|
if not clicker or not clicker:is_player() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- feed, tame or heal horse
|
-- Feed, tame or heal llama
|
||||||
if mobs:feed_tame(self, clicker, 1, true, true) then
|
if mobs:feed_tame(self, clicker, 1, true, true) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- make sure tamed horse is being clicked by owner only
|
-- Make sure tamed llama is mature and being clicked by owner only
|
||||||
if self.tamed and self.owner == clicker:get_player_name() then
|
if self.tamed and not self.child and self.owner == clicker:get_player_name() then
|
||||||
|
|
||||||
local inv = clicker:get_inventory()
|
local inv = clicker:get_inventory()
|
||||||
|
|
||||||
-- detatch player already riding horse
|
-- detatch player already riding llama
|
||||||
if self.driver and clicker == self.driver then
|
if self.driver and clicker == self.driver then
|
||||||
|
|
||||||
mobs.detach(clicker, {x = 1, y = 0, z = 1})
|
mobs.detach(clicker, {x = 1, y = 0, z = 1})
|
||||||
@ -122,10 +121,11 @@ mobs:register_mob("mobs_mc:llama", {
|
|||||||
self.object:set_properties({stepheight = 1.1})
|
self.object:set_properties({stepheight = 1.1})
|
||||||
mobs.attach(self, clicker)
|
mobs.attach(self, clicker)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
-- used to capture horse with magic lasso
|
-- Used to capture llama with lasso
|
||||||
mobs:capture_mob(self, clicker, 0, 0, 80, false, nil)
|
elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then
|
||||||
|
mobs:capture_mob(self, clicker, 0, 0, 80, false, nil)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
})
|
})
|
||||||
|
11
pig.lua
@ -96,6 +96,10 @@ mobs:register_mob("mobs_mc:pig", {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.child then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
-- Put saddle on pig
|
-- Put saddle on pig
|
||||||
local item = clicker:get_wielded_item()
|
local item = clicker:get_wielded_item()
|
||||||
if item:get_name() == mobs_mc.items.saddle and self.saddle ~= "yes" then
|
if item:get_name() == mobs_mc.items.saddle and self.saddle ~= "yes" then
|
||||||
@ -153,10 +157,11 @@ mobs:register_mob("mobs_mc:pig", {
|
|||||||
inv:set_stack("main",self.driver:get_wield_index(), wielditem)
|
inv:set_stack("main",self.driver:get_wield_index(), wielditem)
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
|
||||||
|
|
||||||
-- used to capture pig with magic lasso
|
-- Capture pig with lasso
|
||||||
mobs:capture_mob(self, clicker, 0, 0, 80, false, nil)
|
elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then
|
||||||
|
mobs:capture_mob(self, clicker, 0, 0, 80, false, nil)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ mobs:register_mob("mobs_mc:polar_bear", {
|
|||||||
hp_max = 30,
|
hp_max = 30,
|
||||||
collisionbox = {-0.7, -0.01, -0.7, 0.7, 1.39, 0.7},
|
collisionbox = {-0.7, -0.01, -0.7, 0.7, 1.39, 0.7},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_polar_bear.b3d",
|
mesh = "mobs_mc_polarbear.b3d",
|
||||||
textures = {
|
textures = {
|
||||||
{"mobs_mc_polarbear.png"},
|
{"mobs_mc_polarbear.png"},
|
||||||
},
|
},
|
||||||
|
@ -21,7 +21,7 @@ mobs:register_mob("mobs_mc:witherskeleton", {
|
|||||||
group_attack = true,
|
group_attack = true,
|
||||||
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2.39, 0.35},
|
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2.39, 0.35},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_wither_skeleton.b3d",
|
mesh = "mobs_mc_witherskeleton.b3d",
|
||||||
textures = {
|
textures = {
|
||||||
{"mobs_mc_witherskeleton.png"},
|
{"mobs_mc_witherskeleton.png"},
|
||||||
},
|
},
|
||||||
|
@ -129,7 +129,7 @@ local magma_cube_big = {
|
|||||||
visual_size = {x=12.5, y=12.5},
|
visual_size = {x=12.5, y=12.5},
|
||||||
textures = {{ "mobs_mc_magmacube.png" }},
|
textures = {{ "mobs_mc_magmacube.png" }},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_magma_cube.b3d",
|
mesh = "mobs_mc_magmacube.b3d",
|
||||||
blood_texture = "lava_slime_blood.png",
|
blood_texture = "lava_slime_blood.png",
|
||||||
makes_footstep_sound = true,
|
makes_footstep_sound = true,
|
||||||
sounds = {
|
sounds = {
|
||||||
|
BIN
sounds/mobs_mc_cow.ogg
Normal file
BIN
sounds/mobs_mc_llama.ogg
Normal file
BIN
textures/mobs_mc_diamond_horse_armor.png
Normal file
After Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
BIN
textures/mobs_mc_gold_horse_armor.png
Normal file
After Width: | Height: | Size: 187 B |
BIN
textures/mobs_mc_horse_armor_diamond.png
Normal file
After Width: | Height: | Size: 1023 B |
BIN
textures/mobs_mc_horse_armor_gold.png
Normal file
After Width: | Height: | Size: 837 B |
BIN
textures/mobs_mc_horse_armor_iron.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
textures/mobs_mc_horse_markings_blackdots.png
Normal file
After Width: | Height: | Size: 286 B |
BIN
textures/mobs_mc_horse_markings_white.png
Normal file
After Width: | Height: | Size: 262 B |
BIN
textures/mobs_mc_horse_markings_whitedots.png
Normal file
After Width: | Height: | Size: 375 B |
BIN
textures/mobs_mc_horse_markings_whitefield.png
Normal file
After Width: | Height: | Size: 763 B |
BIN
textures/mobs_mc_iron_horse_armor.png
Normal file
After Width: | Height: | Size: 216 B |
@ -18,7 +18,7 @@ mobs:register_mob("mobs_mc:villager_zombie", {
|
|||||||
armor = 90,
|
armor = 90,
|
||||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "mobs_mc_villager_zombie.b3d",
|
mesh = "mobs_mc_zvillager.b3d",
|
||||||
textures = {
|
textures = {
|
||||||
{"mobs_mc_zombie_butcher.png"},
|
{"mobs_mc_zombie_butcher.png"},
|
||||||
{"mobs_mc_zombie_farmer.png"},
|
{"mobs_mc_zombie_farmer.png"},
|
||||||
|
@ -32,8 +32,8 @@ mobs:register_mob("mobs_mc:wither", {
|
|||||||
run_velocity = 4,
|
run_velocity = 4,
|
||||||
stepheight = 1.2,
|
stepheight = 1.2,
|
||||||
sounds = {
|
sounds = {
|
||||||
shoot_attack = "mesed",
|
shoot_attack = "mobs_mc_ender_dragon_shoot",
|
||||||
attack = "mese_dragon",
|
attack = "mobs_mc_ender_dragon_attack",
|
||||||
distance = 60,
|
distance = 60,
|
||||||
},
|
},
|
||||||
jump = true,
|
jump = true,
|
||||||
|