From 240ae29e3b48f914bcd1df9bf0e49c69a56862aa Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 23 Feb 2017 19:03:26 +0100 Subject: [PATCH] New sheep color spawns, smaller sheep size --- mods/ENTITIES/mobs_mc/sheep.lua | 37 +++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index 5ccbf87b3..34d002c09 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -4,20 +4,45 @@ --License for code WTFPL and otherwise stated in readmes ---dofile(minetest.get_modpath("mobs").."/api.lua") +-- This is a trick to force spawn probabilities +-- FIXME: Remove this hack, improve the API instead +local texture_hack = {} +for i=1,81836 do + -- 81.836% + table.insert(texture_hack, {"mobs_sheep.png"}) +end +for i=1,5000 do + -- 5% + table.insert(texture_hack, {"mobs_sheep_grey.png"}) +end +for i=1,5000 do + -- 5% + table.insert(texture_hack, {"mobs_sheep_dark_grey.png"}) +end +for i=1,5000 do + -- 5% + table.insert(texture_hack, {"mobs_sheep_black.png"}) +end +for i=1,3000 do + -- 3% + table.insert(texture_hack, {"mobs_sheep_brown.png"}) +end +for i=1,164 do + -- 0.164% + table.insert(texture_hack, {"mobs_sheep_pink.png"}) +end ---mcsheep +-- Sheep mobs:register_mob("mobs_mc:sheep", { type = "animal", hp_min = 8, hp_max = 8, - collisionbox = {-0.5, -0.01, -0.5, 0.5, 1.5, 0.5}, + collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.29, 0.45}, visual = "mesh", + visual_size = {x=0.6, y=0.6}, mesh = "mobs_sheep.x", - textures = { - {"mobs_sheep.png"} - }, + textures = texture_hack, makes_footstep_sound = true, walk_velocity = 1, armor = 100,