Compare commits

..

1 Commits

Author SHA1 Message Date
cora 20c1922207 Detached inventory on_deactivate test
a 2nd "Testy" inv will be created with every inv-entity on this
testing branch which you can access with /invtest. This was to
verify that on_deactivate is in fact called by /clearobjects:

place a chest boat,
run /invtest - verify the inventory works
run /clearobjects - verify the inv no longer works
2022-09-23 18:45:36 +02:00
398 changed files with 804 additions and 2331 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 B

View File

@ -610,95 +610,3 @@ function mcl_util.get_pointed_thing(player, liquid)
end
end
end
-- This following part is 2 wrapper functions + helpers for
-- object:set_bones
-- and player:set_properties preventing them from being resent on
-- every globalstep when they have not changed.
local function roundN(n, d)
if type(n) ~= "number" then return n end
local m = 10^d
return math.floor(n * m + 0.5) / m
end
local function close_enough(a,b)
local rt=true
if type(a) == "table" and type(b) == "table" then
for k,v in pairs(a) do
if roundN(v,2) ~= roundN(b[k],2) then
rt=false
break
end
end
else
rt = roundN(a,2) == roundN(b,2)
end
return rt
end
local function props_changed(props,oldprops)
local changed=false
local p={}
for k,v in pairs(props) do
if not close_enough(v,oldprops[k]) then
p[k]=v
changed=true
end
end
return changed,p
end
--tests for roundN
local test_round1=15
local test_round2=15.00199999999
local test_round3=15.00111111
local test_round4=15.00999999
assert(roundN(test_round1,2)==roundN(test_round1,2))
assert(roundN(test_round1,2)==roundN(test_round2,2))
assert(roundN(test_round1,2)==roundN(test_round3,2))
assert(roundN(test_round1,2)~=roundN(test_round4,2))
-- tests for close_enough
local test_cb = {-0.35,0,-0.35,0.35,0.8,0.35} --collisionboxes
local test_cb_close = {-0.351213,0,-0.35,0.35,0.8,0.351212}
local test_cb_diff = {-0.35,0,-1.35,0.35,0.8,0.35}
local test_eh = 1.65 --eye height
local test_eh_close = 1.65123123
local test_eh_diff = 1.35
local test_nt = { r = 225, b = 225, a = 225, g = 225 } --nametag
local test_nt_diff = { r = 225, b = 225, a = 0, g = 225 }
assert(close_enough(test_cb,test_cb_close))
assert(not close_enough(test_cb,test_cb_diff))
assert(close_enough(test_eh,test_eh_close))
assert(not close_enough(test_eh,test_eh_diff))
assert(not close_enough(test_nt,test_nt_diff)) --no floats involved here
--tests for properties_changed
local test_properties_set1={collisionbox = {-0.35,0,-0.35,0.35,0.8,0.35}, eye_height = 0.65, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}
local test_properties_set2={collisionbox = {-0.35,0,-0.35,0.35,0.8,0.35}, eye_height = 1.35, nametag_color = { r = 225, b = 225, a = 225, g = 225 }}
local test_p1,_=props_changed(test_properties_set1,test_properties_set1)
local test_p2,_=props_changed(test_properties_set1,test_properties_set2)
assert(not test_p1)
assert(test_p2)
function mcl_util.set_properties(obj,props)
local changed,p=props_changed(props,obj:get_properties())
if changed then
obj:set_properties(p)
end
end
function mcl_util.set_bone_position(obj,b,p,r) --bone,position,rotation
local oldp,oldr=obj:get_bone_position(b)
if vector.equals(vector.round(oldp),vector.round(p)) and vector.equals(vector.round(oldr),vector.round(r)) then
return
end
obj:set_bone_position(b,p,r)
end

View File

@ -421,13 +421,13 @@ cboat._itemstring = "mcl_boats:chest_boat"
minetest.register_entity("mcl_boats:chest_boat", cboat)
mcl_entity_invs.register_inv("mcl_boats:chest_boat","Boat",27)
local boat_ids = { "boat", "boat_spruce", "boat_birch", "boat_jungle", "boat_acacia", "boat_dark_oak", "boat_obsidian", "boat_mangrove", "chest_boat", "chest_boat_spruce", "chest_boat_birch", "chest_boat_jungle", "chest_boat_acacia", "chest_boat_dark_oak", "chest_boat_mangrove" }
local names = { S("Oak Boat"), S("Spruce Boat"), S("Birch Boat"), S("Jungle Boat"), S("Acacia Boat"), S("Dark Oak Boat"), S("Obsidian Boat"), S("Mangrove Boat"), S("Oak Chest Boat"), S("Spruce Chest Boat"), S("Birch Chest Boat"), S("Jungle Chest Boat"), S("Acacia Chest Boat"), S("Dark Oak Chest Boat"), S("Mangrove Chest Boat") }
local boat_ids = { "boat", "boat_spruce", "boat_birch", "boat_jungle", "boat_acacia", "boat_dark_oak", "boat_obsidian", "chest_boat", "chest_boat_spruce", "chest_boat_birch", "chest_boat_jungle", "chest_boat_acacia", "chest_boat_dark_oak" }
local names = { S("Oak Boat"), S("Spruce Boat"), S("Birch Boat"), S("Jungle Boat"), S("Acacia Boat"), S("Dark Oak Boat"), S("Obsidian Boat"), S("Oak Chest Boat"), S("Spruce Chest Boat"), S("Birch Chest Boat"), S("Jungle Chest Boat"), S("Acacia Chest Boat"), S("Dark Oak Chest Boat") }
local craftstuffs = {}
if minetest.get_modpath("mcl_core") then
craftstuffs = { "mcl_core:wood", "mcl_core:sprucewood", "mcl_core:birchwood", "mcl_core:junglewood", "mcl_core:acaciawood", "mcl_core:darkwood", "mcl_core:obsidian", "mcl_mangrove:mangrove_wood" }
craftstuffs = { "mcl_core:wood", "mcl_core:sprucewood", "mcl_core:birchwood", "mcl_core:junglewood", "mcl_core:acaciawood", "mcl_core:darkwood", "mcl_core:obsidian", "mcl_core:wood", "mcl_core:sprucewood", "mcl_core:birchwood", "mcl_core:junglewood", "mcl_core:acaciawood", "mcl_core:darkwood", }
end
local images = { "oak", "spruce", "birch", "jungle", "acacia", "dark_oak", "obsidian", "mangrove", "oak_chest", "spruce_chest", "birch_chest", "jungle_chest", "acacia_chest", "dark_oak_chest", "mangrove_chest" }
local images = { "oak", "spruce", "birch", "jungle", "acacia", "dark_oak", "obsidian", "oak_chest", "spruce_chest", "birch_chest", "jungle_chest", "acacia_chest", "dark_oak_chest" }
for b=1, #boat_ids do
local itemstring = "mcl_boats:"..boat_ids[b]
@ -504,22 +504,13 @@ for b=1, #boat_ids do
})
local c = craftstuffs[b]
if not itemstring:find("chest") then
minetest.register_craft({
output = itemstring:gsub(":boat",":chest_boat"),
recipe = {
{"mcl_chests:chest"},
{itemstring},
},
})
minetest.register_craft({
output = itemstring,
recipe = {
{c, "", c},
{c, c, c},
},
})
end
minetest.register_craft({
output = itemstring,
recipe = {
{c, "", c},
{c, c, c},
},
})
end
minetest.register_craft({

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,5 +1,3 @@
local enable_damage = minetest.settings:get_bool("enable_damage")
function mcl_burning.get_storage(obj)
return obj:is_player() and mcl_burning.storage[obj] or obj:get_luaentity()
end
@ -79,7 +77,7 @@ end
-- The effective burn duration is modified by obj's armor protection.
-- If obj was already burning, its burn duration is updated if the current
-- duration is less than burn_time.
-- If obj is dead, fireproof or enable_damage is disabled, this function does nothing.
-- If obj is dead, fireproof or a creative player, this function does nothing.
--
function mcl_burning.set_on_fire(obj, burn_time)
if obj:get_hp() < 0 then
@ -91,9 +89,8 @@ function mcl_burning.set_on_fire(obj, burn_time)
return
end
if obj:is_player() and not enable_damage then
if obj:is_player() and minetest.is_creative_enabled(obj:get_player_name()) then
burn_time = 0
return
else
local max_fire_prot_lvl = 0
local inv = mcl_util.get_inventory(obj)

View File

@ -3,11 +3,6 @@ mcl_entity_invs
Inventories for your entities. It's simple. Depend on mcl_entity_invs and register your entity like so:
* mcl_entity_invs.register_inv("entity:name","Title shown in formspec",inventory_size,disable_on_righclick)
*If disable_on_righclick is true other mods can handle when to show the inventory themselves
* The inventory size can be set dynamically by initializing it with an explicit nil
* mcl_entity_invs.show_inv_form(entity,clicker,[formspec text])
* formspec_text is an additional text that is put after the title
* mcl_entity_invs.register_inv("entity:name","Title shown in formspec",inventory_size)
It works by setting up a detached inventory per entity which is accessed by an id/hash generated from the entities position at creation, the progressed gametime at creation and a random salt.

View File

@ -1,7 +1,5 @@
mcl_entity_invs = {}
local open_invs = {}
local function check_distance(inv,player,count)
for _,o in pairs(minetest.get_objects_inside_radius(player:get_pos(),5)) do
local l = o:get_luaentity()
@ -27,7 +25,9 @@ local function load_inv(ent,size)
local inv = minetest.get_inventory({type="detached", name=ent._inv_id})
if not inv then
inv = minetest.create_detached_inventory(ent._inv_id, inv_callbacks)
invt = minetest.create_detached_inventory("testy", {})
inv:set_size("main", size)
invt:set_size("main", size)
if ent._items then
inv:set_list("main",ent._items)
end
@ -35,34 +35,14 @@ local function load_inv(ent,size)
return inv
end
local function save_inv(ent)
if ent._inv then
ent._items = {}
for i,it in ipairs(ent._inv:get_list("main")) do
ent._items[i] = it:to_string()
end
minetest.remove_detached_inventory(ent._inv_id)
ent._inv = nil
end
end
function mcl_entity_invs.show_inv_form(ent,player,text)
local function show_form(ent,player,show_name)
if not ent._inv_id then return end
if not open_invs[ent] then
open_invs[ent] = 0
end
text = text or ""
ent._inv = load_inv(ent,ent._inv_size)
open_invs[ent] = open_invs[ent] + 1
local playername = player:get_player_name()
local rows = 3
local cols = (math.ceil(ent._inv_size/rows))
local spacing = (9 - cols) / 2
local formspec = "size[9,8.75]"
.. "label[0,0;" .. minetest.formspec_escape(
minetest.colorize("#313131", ent._inv_title .. " ".. text)) .. "]"
.. "list[detached:"..ent._inv_id..";main;"..spacing..",0.5;"..cols..","..rows..";]"
.. mcl_formspec.get_itemslot_bg(spacing,0.5,cols,rows)
minetest.colorize("#313131", show_name)) .. "]"
.. "list[detached:"..ent._inv_id..";main;0,0.5;9,3;]"
.. mcl_formspec.get_itemslot_bg(0,0.5,9,3)
.. "label[0,4.0;" .. minetest.formspec_escape(
minetest.colorize("#313131", "Inventory")) .. "]"
.. "list[current_player;main;0,4.5;9,3;9]"
@ -75,96 +55,76 @@ function mcl_entity_invs.show_inv_form(ent,player,text)
end
local function drop_inv(ent)
if not ent._items then return end
local pos = ent.object:get_pos()
for i,it in pairs(ent._items) do
for i,it in pairs(ent._inv:get_list("main")) do
local p = vector.add(pos,vector.new(math.random() - 0.5, math.random()-0.5, math.random()-0.5))
minetest.add_item(p,it)
minetest.add_item(p,it:to_string())
end
ent._items = nil
end
local function on_remove(self,killer,oldf)
save_inv(self)
drop_inv(self)
if oldf then return oldf(self,killer) end
end
minetest.register_on_player_receive_fields(function(player, formname, fields)
for k,v in pairs(open_invs) do
if formname == k._inv_id then
open_invs[k] = open_invs[k] - 1
if open_invs[k] < 1 then
save_inv(k)
open_invs[k] = nil
end
end
end
end)
function mcl_entity_invs.register_inv(entity_name,show_name,size,no_on_righclick)
assert(minetest.registered_entities[entity_name],"mcl_entity_invs.register_inv called with invalid entity: "..tostring(entity_name))
minetest.registered_entities[entity_name]._inv_size = size
minetest.registered_entities[entity_name]._inv_title = show_name
function mcl_entity_invs.register_inv(entity_name,show_name,size)
local old_oa = minetest.registered_entities[entity_name].on_activate
minetest.registered_entities[entity_name].on_activate = function(self,staticdata,dtime_s)
local r
if old_oa then r=old_oa(self,staticdata,dtime_s) end
local d = minetest.deserialize(staticdata)
if type(d) == "table" and d._inv_id then
self._inv_id = d._inv_id
self._items = d._items
self._inv_size = d._inv_size
else
self._inv_id="entity_inv_"..minetest.sha1(minetest.get_gametime()..minetest.pos_to_string(self.object:get_pos())..tostring(math.random()))
--gametime and position for collision safety and math.random salt to protect against position brute-force
end
return r
end
if not no_on_righclick then
local old_rc = minetest.registered_entities[entity_name].on_rightclick
minetest.registered_entities[entity_name].on_rightclick = function(self,clicker)
mcl_entity_invs.show_inv_form(self,clicker,show_name)
if old_rc then return old_rc(self,clicker) end
if self._inv_id then
self._inv = load_inv(self,size)
end
if old_oa then return old_oa(self,clicker) end
end
local old_rc = minetest.registered_entities[entity_name].on_rightclick
minetest.registered_entities[entity_name].on_rightclick = function(self,clicker)
show_form(self,clicker,show_name)
if old_rc then return old_rc(self,clicker) end
end
local old_gsd = minetest.registered_entities[entity_name].get_staticdata
minetest.registered_entities[entity_name].get_staticdata = function(self)
local old_sd = old_gsd(self)
local d = minetest.deserialize(old_sd)
assert(type(d) == "table","mcl_entity_invs currently only works with entities that return a (serialized) table in get_staticdata. "..tostring(self.name).." returned: "..tostring(old_sd))
assert(type(d) == "table","Entyinvs currently only works with entities that return a (serialized) table in get_staticdata. "..tostring(self.name).." returned: "..tostring(old_sd))
d._inv_id = self._inv_id
d._inv_size = self._inv_size
d._items = {}
if self._items then
for i,it in ipairs(self._items) do
d._items[i] = it
end
for i,it in pairs(self._inv:get_list("main")) do
d._items[i] = it:to_string()
end
return minetest.serialize(d)
end
local old_ode = minetest.registered_entities[entity_name].on_deactivate
minetest.registered_entities[entity_name].on_deactivate = function(self,removal)
save_inv(self)
if removal then
on_remove(self)
end
minetest.remove_detached_inventory(self._inv_id)
minetest.remove_detached_inventory("testy")
if old_ode then return old_ode(self,removal) end
end
local old_od = minetest.registered_entities[entity_name].on_death
minetest.registered_entities[entity_name].on_death = function(self,killer)
if not self.is_mob then
on_remove(self,killer,old_od)
end
end
local old_odi = minetest.registered_entities[entity_name].on_die
minetest.registered_entities[entity_name].on_die = function(self,killer)
if self.is_mob then
on_remove(self,killer,old_od)
end
minetest.registered_entities[entity_name].on_death = function(self,clicker)
drop_inv(self)
minetest.remove_detached_inventory(self._inv_id)
if old_od then return old_od(self,clicker) end
end
end
minetest.register_chatcommand("invtest",{func=function(n,p)
local formspec = "size[9,8.75]"
.. "label[0,0;" .. minetest.formspec_escape(
minetest.colorize("#313131", "Testy")) .. "]"
.. "list[detached:testy;main;0,0.5;9,3;]"
.. mcl_formspec.get_itemslot_bg(0,0.5,9,3)
.. "label[0,4.0;" .. minetest.formspec_escape(
minetest.colorize("#313131", "Inventory")) .. "]"
.. "list[current_player;main;0,4.5;9,3;9]"
.. mcl_formspec.get_itemslot_bg(0,4.5,9,3)
.. "list[current_player;main;0,7.74;9,1;]"
.. mcl_formspec.get_itemslot_bg(0,7.74,9,1)
.. "listring[detached:testy;main]"
.. "listring[current_player;main]"
minetest.show_formspec(n,"testy",formspec)
end})

View File

@ -16,29 +16,6 @@ local CRAMMING_DAMAGE = 3
-- Localize
local S = minetest.get_translator("mcl_mobs")
local function shortest_term_of_yaw_rotatoin(self, rot_origin, rot_target, nums)
if not rot_origin or not rot_target then
return
end
rot_origin = math.deg(rot_origin)
rot_target = math.deg(rot_target)
if math.abs(rot_target - rot_origin) < 180 then
return rot_target - rot_origin
else
if (rot_target - rot_origin) > 0 then
return 360-(rot_target - rot_origin)
else
return (rot_target - rot_origin)+360
end
end
end
-- Invisibility mod check
mcl_mobs.invis = {}
@ -84,13 +61,6 @@ if minetest.settings:get_bool("only_peaceful_mobs", false) then
end)
end
local function dir_to_pitch(dir)
--local dir2 = vector.normalize(dir)
local xz = math.abs(dir.x) + math.abs(dir.z)
return -math.atan2(-dir.y, xz)
end
-- pathfinding settings
local enable_pathfinding = true
local stuck_timeout = 3 -- how long before mob gets stuck in place and starts searching
@ -332,57 +302,25 @@ local function update_roll(self)
end
-- set and return valid yaw
local set_yaw = function(self, yaw, delay, dtime)
if self.noyaw then return end
if self._kb_turn then
self._turn_to = yaw
end
--clamp our yaw to a 360 range
if math.deg(self.object:get_yaw()) > 360 then
self.object:set_yaw(math.rad(10))
elseif math.deg(self.object:get_yaw()) < 0 then
self.object:set_yaw(math.rad(350))
if true then
self.object:set_yaw(yaw)
return yaw
end
--calculate the shortest way to turn to find our target
local target_shortest_path = shortest_term_of_yaw_rotatoin(self, self.object:get_yaw(), yaw, true)
--turn in the shortest path possible toward our target. if we are attacking, don't dance.
if math.abs(target_shortest_path) > 100 and (self.attack and self.attack:get_pos() or self.following and self.following:get_pos()) then
if self.following then
target_shortest_path = shortest_term_of_yaw_rotatoin(self, self.object:get_yaw(), minetest.dir_to_yaw(vector.direction(self.object:get_pos(), self.following:get_pos())), true)
else
target_shortest_path = shortest_term_of_yaw_rotatoin(self, self.object:get_yaw(), minetest.dir_to_yaw(vector.direction(self.object:get_pos(), self.attack:get_pos())), true)
end
end
local ddtime = 0.05 --set_tick_rate
if dtime then
ddtime = dtime
end
if math.abs(target_shortest_path) > 280*ddtime then
if target_shortest_path > 0 then
self.object:set_yaw(self.object:get_yaw()+3.6*ddtime)
else
self.object:set_yaw(self.object:get_yaw()-3.6*ddtime)
end
if not yaw or yaw ~= yaw then
yaw = 0
end
delay = delay or 0
yaw = self.object:get_yaw()
if delay == 0 then
if self.shaking and dtime then
yaw = yaw + (random() * 2 - 1) * 5 * dtime
end
self.object:set_yaw(yaw)
update_roll(self)
return yaw
end
@ -467,10 +405,6 @@ local set_animation = function(self, anim, fixed_frame)
return
end
if self.jockey then
anim = "jockey"
end
if flight_check(self) and self.fly and anim == "walk" then anim = "fly" end
self._current_animation = self._current_animation or ""
@ -1525,11 +1459,6 @@ local breed = function(self)
z = 0
})
end
self.animation = nil
local anim = self._current_animation
self._current_animation = nil -- Mobs Redo does nothing otherwise
mcl_mobs.set_animation(self, anim)
end
return
@ -1969,6 +1898,7 @@ end
-- find someone to attack
local monster_attack = function(self)
if not damage_enabled
or minetest.is_creative_enabled("")
or self.passive ~= false
or self.state == "attack"
or day_docile(self) then
@ -3370,13 +3300,6 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
elseif luaentity and luaentity._knockback then
kb = kb + luaentity._knockback
end
--self._kb_turn = false
self._turn_to=self.object:get_yaw()+0.85
minetest.after(0.2, function()
if self and self.object then
self._kb_turn = true
end
end)
self.object:set_velocity({
x = dir.x * kb,
@ -3463,11 +3386,6 @@ end
local mob_detach_child = function(self, child)
if self.detach_child then
if self.detach_child(self, child) then
return
end
end
if self.driver == child then
self.driver = nil
end
@ -3485,8 +3403,10 @@ local mob_staticdata = function(self)
and ((not self.nametag) or (self.nametag == ""))
and self.lifetimer <= 20 then
if spawn_logging then
minetest.log("action", "[mcl_mobs] Mob "..tostring(self.name).." despawns in mob_staticdata at "..minetest.pos_to_string(vector.round(self.object:get_pos())))
minetest.log("action", "[mcl_mobs] Mob "..tostring(self.name).." despawns in mob_staticdata at "..minetest.pos_to_string(self.object:get_pos()))
end
mcl_burning.extinguish(self.object)
self.object:remove()
return "remove"-- nil
end
@ -3516,19 +3436,21 @@ end
-- activate mob and reload settings
local mob_activate = function(self, staticdata, def, dtime)
if not self.object:get_pos() or staticdata == "remove" then
mcl_burning.extinguish(self.object)
self.object:remove()
return
end
-- remove monsters in peaceful mode
if self.type == "monster"
and minetest.settings:get_bool("only_peaceful_mobs", false) then
mcl_burning.extinguish(self.object)
self.object:remove()
return
end
if staticdata == "remove" then
mcl_burning.extinguish(self.object)
self.object:remove()
return
end
-- load entity variables
local tmp = minetest.deserialize(staticdata)
@ -3661,23 +3583,18 @@ local mob_activate = function(self, staticdata, def, dtime)
if not self.nametag then
self.nametag = def.nametag
end
if not self.custom_visual_size then
if not self.custom_visual_size and not self.child then
-- Remove saved visual_size on old existing entites.
-- Old entities were 3 now it's 1.
self.visual_size = nil
self.object:set_properties({visual_size = self.visual_size})
self.base_size = self.visual_size
if self.child then
self.visual_size = {
x = self.visual_size.x * 0.5,
y = self.visual_size.y * 0.5,
}
end
end
-- set anything changed above
self.object:set_properties(self)
set_yaw(self, (random(0, 360) - 180) / 180 * pi, 6)
update_tag(self)
self._current_animation = nil
set_animation(self, "stand")
-- run on_spawn function if found
@ -3740,9 +3657,6 @@ local mob_step = function(self, dtime)
end
-- smooth rotation by ThomasMonroe314
if self._turn_to then
set_yaw(self, self._turn_to, .1)
end
if self.delay and self.delay > 0 then
@ -3786,66 +3700,6 @@ local mob_step = function(self, dtime)
-- end rotation
if self.head_swivel and type(self.head_swivel) == "string" then
local oldp,oldr = self.object:get_bone_position(self.head_swivel)
for _, obj in pairs(minetest.get_objects_inside_radius(pos, 10)) do
if obj:is_player() and not self.attack or obj:get_luaentity() and obj:get_luaentity().name == self.name and self ~= obj:get_luaentity() then
if not self._locked_object then
if math.random(5000/self.curiosity) == 1 then
self._locked_object = obj
end
else
if math.random(10000/self.curiosity) == 1 then
self._locked_object = nil
end
end
end
end
if self.attack then
self._locked_object = self.attack
end
if self._locked_object and (self._locked_object:is_player() or self._locked_object:get_luaentity()) and self._locked_object:get_hp() > 0 then
local _locked_object_eye_height = 1.5
if self._locked_object:get_luaentity() then
_locked_object_eye_height = self._locked_object:get_luaentity().head_eye_height
end
if self._locked_object:is_player() then
_locked_object_eye_height = self._locked_object:get_properties().eye_height
end
local self_rot = self.object:get_rotation()
if self.object:get_attach() then
self_rot = self.object:get_attach():get_rotation()
end
local player_pos = self._locked_object:get_pos()
local direction_player = vector.direction(vector.add(self.object:get_pos(), vector.new(0, self.head_eye_height*.7, 0)), vector.add(player_pos, vector.new(0, _locked_object_eye_height, 0)))
local mob_yaw = math.deg(-(-(self_rot.y)-(-minetest.dir_to_yaw(direction_player))))+self.head_yaw_offset
local mob_pitch = math.deg(-dir_to_pitch(direction_player))*self.head_pitch_multiplier
if (mob_yaw < -60 or mob_yaw > 60) and not (self.attack and self.type == "monster") then
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.multiply(oldr, 0.9))
elseif self.attack and self.type == "monster" then
if self.head_yaw == "y" then
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(mob_pitch, mob_yaw, 0))
elseif self.head_yaw == "z" then
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(mob_pitch, 0, -mob_yaw))
end
else
if self.head_yaw == "y" then
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(((mob_pitch-oldr.x)*.3)+oldr.x, ((mob_yaw-oldr.y)*.3)+oldr.y, 0))
elseif self.head_yaw == "z" then
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(((mob_pitch-oldr.x)*.3)+oldr.x, 0, -(((mob_yaw-oldr.y)*.3)+oldr.y)*3))
end
end
elseif not self._locked_object and math.abs(oldr.y) > 3 and math.abs(oldr.x) < 3 then
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.multiply(oldr, 0.9))
else
mcl_util.set_bone_position(self.object,self.head_swivel, vector.new(0,self.bone_eye_height,self.horrizonatal_head_height), vector.new(0,0,0))
end
end
-- run custom function (defined in mob lua file)
if self.do_custom then
@ -4086,14 +3940,6 @@ end
minetest.register_entity(name, {
use_texture_alpha = def.use_texture_alpha,
head_swivel = def.head_swivel or nil, -- bool to activate this function
head_yaw_offset = def.head_yaw_offset or 0, -- for wonkey model bones
head_pitch_multiplier = def.head_pitch_multiplier or 1, --for inverted pitch
bone_eye_height = def.bone_eye_height or 1.4, -- head bone offset
head_eye_height = def.head_eye_height or def.bone_eye_height or 0, -- how hight aproximatly the mobs head is fromm the ground to tell the mob how high to look up at the player
curiosity = def.curiosity or 1, -- how often mob will look at player on idle
head_yaw = def.head_yaw or "y", -- axis to rotate head on
horrizonatal_head_height = def.horrizonatal_head_height or 0,
stepheight = def.stepheight or 0.6,
name = name,
description = def.description,
@ -4106,7 +3952,6 @@ minetest.register_entity(name, {
on_die = def.on_die,
spawn_small_alternative = def.spawn_small_alternative,
do_custom = def.do_custom,
detach_child = def.detach_child,
jump_height = def.jump_height or 4, -- was 6
rotate = math.rad(def.rotate or 0), -- 0=front, 90=side, 180=back, 270=side2
lifetimer = def.lifetimer or 57.73,
@ -4214,7 +4059,6 @@ minetest.register_entity(name, {
texture_mods = {},
shoot_arrow = def.shoot_arrow,
sounds_child = def.sounds_child,
_child_animations = def.child_animations,
pick_up = def.pick_up,
explosion_strength = def.explosion_strength,
suffocation_timer = 0,
@ -4432,7 +4276,7 @@ end
-- Note: This also introduces the “spawn_egg” group:
-- * spawn_egg=1: Spawn egg (generic mob, no metadata)
-- * spawn_egg=2: Spawn egg (captured/tamed mob, metadata)
function mcl_mobs:register_egg(mob, desc, background_color, overlay_color, addegg, no_creative)
function mcl_mobs:register_egg(mob, desc, background, addegg, no_creative)
local grp = {spawn_egg = 1}
@ -4441,7 +4285,7 @@ function mcl_mobs:register_egg(mob, desc, background_color, overlay_color, addeg
grp.not_in_creative_inventory = 1
end
local invimg = "(spawn_egg.png^[multiply:" .. background_color ..")^(spawn_egg_overlay.png^[multiply:" .. overlay_color .. ")"
local invimg = background
if addegg == 1 then
invimg = "mobs_chicken_egg.png^(" .. invimg ..
@ -4665,10 +4509,6 @@ function mcl_mobs:spawn_child(pos, mob_type)
},
})
ent.animation = ent._child_animations
ent._current_animation = nil
set_animation(ent, "stand")
return child
end

View File

@ -486,13 +486,13 @@ This function registers a arrow for mobs with the attack type shoot.
Spawn Eggs
----------
mobs:register_egg(name, description, background_color, overlay_color, addegg, no_creative)
mobs:register_egg(name, description, background, addegg, no_creative)
This function registers a spawn egg which can be used by admin to properly spawn in a mob.
'name' this is the name of your new mob to spawn e.g. "mob:sheep"
'description' the name of the new egg you are creating e.g. "Spawn Sheep"
'background_color' and 'overlay_color' define the colors for the texture displayed for the egg in inventory
'background'the texture displayed for the egg in inventory
'addegg' would you like an egg image in front of your texture (1 = yes,
0 = no)
'no_creative' when set to true this stops spawn egg appearing in creative

View File

@ -144,4 +144,4 @@ mobs_mc.water_level-1)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:bat", S("Bat"), "#4c3e30", "#0f0f0f", 0)
mcl_mobs:register_egg("mobs_mc:bat", S("Bat"), "mobs_mc_spawn_icon_bat.png", 0)

View File

@ -26,12 +26,6 @@ mcl_mobs:register_mob("mobs_mc:blaze", {
rotate = -180,
visual = "mesh",
mesh = "mobs_mc_blaze.b3d",
head_swivel = "head.control",
bone_eye_height = 4,
head_eye_height = 3.5,
curiosity = 10,
head_yaw_offset = 180,
head_pitch_multiplier=-1,
textures = {
{"mobs_mc_blaze.png"},
},
@ -208,4 +202,4 @@ mcl_mobs:register_arrow("mobs_mc:blaze_fireball", {
})
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:blaze", S("Blaze"), "#f6b201", "#fff87e", 0)
mcl_mobs:register_egg("mobs_mc:blaze", S("Blaze"), "mobs_mc_spawn_icon_blaze.png", 0)

View File

@ -20,18 +20,12 @@ mcl_mobs:register_mob("mobs_mc:chicken", {
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.69, 0.2},
runaway = true,
floats = 1,
head_swivel = "head.control",
bone_eye_height = 4,
head_eye_height = 1.5,
horrizonatal_head_height = -.3,
curiosity = 10,
head_yaw="z",
visual_size = {x=1,y=1},
visual = "mesh",
mesh = "mobs_mc_chicken.b3d",
textures = {
{"mobs_mc_chicken.png"},
},
visual_size = {x=2.2, y=2.2},
makes_footstep_sound = true,
walk_velocity = 1,
@ -64,15 +58,12 @@ mcl_mobs:register_mob("mobs_mc:chicken", {
distance = 16,
},
animation = {
stand_start = 0, stand_end = 0,
walk_start = 0, walk_end = 20, walk_speed = 25,
run_start = 0, run_end = 20, run_speed = 50,
},
child_animations = {
stand_start = 31, stand_end = 31,
walk_start = 31, walk_end = 51, walk_speed = 37,
run_start = 31, run_end = 51, run_speed = 75,
stand_speed = 25, walk_speed = 25, run_speed = 50,
stand_start = 0, stand_end = 0,
walk_start = 0, walk_end = 40,
run_start = 0, run_end = 40,
},
follow = {
"mcl_farming:wheat_seeds",
"mcl_farming:melon_seeds",
@ -163,4 +154,4 @@ mobs_mc.water_level,
mcl_vars.mg_overworld_max)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:chicken", S("Chicken"), "#a1a1a1", "#ff0000", 0)
mcl_mobs:register_egg("mobs_mc:chicken", S("Chicken"), "mobs_mc_spawn_icon_chicken.png", 0)

View File

@ -271,4 +271,4 @@ water-16,
water+1)
--spawn egg
mcl_mobs:register_egg("mobs_mc:cod", S("Cod"), "#c1a76a", "#e5c48b", 0)
mcl_mobs:register_egg("mobs_mc:cod", S("Cod"), "extra_mobs_spawn_icon_cod.png", 0)

View File

@ -17,12 +17,7 @@ local cow_def = {
"mobs_mc_cow.png",
"blank.png",
}, },
head_swivel = "head.control",
bone_eye_height = 10,
head_eye_height = 1.1,
horrizonatal_head_height=-1.8,
curiosity = 2,
head_yaw="z",
visual_size = {x=2.8, y=2.8},
makes_footstep_sound = true,
walk_velocity = 1,
drops = {
@ -46,14 +41,11 @@ local cow_def = {
distance = 16,
},
animation = {
stand_start = 0, stand_end = 0,
walk_start = 0, walk_end = 40, walk_speed = 30,
run_start = 0, run_end = 40, run_speed = 40,
},
child_animations = {
stand_start = 41, stand_end = 41,
walk_start = 41, walk_end = 81, walk_speed = 45,
run_start = 41, run_end = 81, run_speed = 60,
stand_speed = 25, walk_speed = 40,
run_speed = 60, stand_start = 0,
stand_end = 0, walk_start = 0,
walk_end = 40, run_start = 0,
run_end = 40,
},
on_rightclick = function(self, clicker)
if mcl_mobs:feed_tame(self, clicker, 1, true, false) then return end
@ -90,6 +82,7 @@ mcl_mobs:register_mob("mobs_mc:cow", cow_def)
-- Mooshroom
local mooshroom_def = table.copy(cow_def)
mooshroom_def.description = S("Mooshroom")
mooshroom_def.mesh = "mobs_mc_cow.b3d"
mooshroom_def.spawn_in_group_min = 4
mooshroom_def.spawn_in_group = 8
mooshroom_def.textures = { {"mobs_mc_mooshroom.png", "mobs_mc_mushroom_red.png"}, {"mobs_mc_mooshroom_brown.png", "mobs_mc_mushroom_brown.png" } }
@ -218,5 +211,5 @@ mcl_vars.mg_overworld_min,
mcl_vars.mg_overworld_max)
-- spawn egg
mcl_mobs:register_egg("mobs_mc:cow", S("Cow"), "#443626", "#a1a1a1", 0)
mcl_mobs:register_egg("mobs_mc:mooshroom", S("Mooshroom"), "#a00f10", "#b7b7b7", 0)
mcl_mobs:register_egg("mobs_mc:cow", S("Cow"), "mobs_mc_spawn_icon_cow.png", 0)
mcl_mobs:register_egg("mobs_mc:mooshroom", S("Mooshroom"), "mobs_mc_spawn_icon_mooshroom.png", 0)

View File

@ -21,9 +21,6 @@ mcl_mobs:register_mob("mobs_mc:creeper", {
pathfinding = 1,
visual = "mesh",
mesh = "mobs_mc_creeper.b3d",
head_swivel = "Head_Control",
bone_eye_height = 2.35,
curiosity = 2,
textures = {
{"mobs_mc_creeper.png",
"mobs_mc_empty.png"},
@ -407,4 +404,4 @@ mcl_vars.mg_overworld_min,
mcl_vars.mg_overworld_max)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:creeper", S("Creeper"), "#0da70a", "#000000", 0)
mcl_mobs:register_egg("mobs_mc:creeper", S("Creeper"), "mobs_mc_spawn_icon_creeper.png", 0)

View File

@ -0,0 +1 @@
mcl_mobs

View File

@ -250,4 +250,4 @@ water-16,
water+1)
--spawn egg
mcl_mobs:register_egg("mobs_mc:dolphin", S("Dolphin"), "#223b4d", "#f9f9f9", 0)
mcl_mobs:register_egg("mobs_mc:dolphin", S("Dolphin"), "extra_mobs_spawn_icon_dolphin.png", 0)

View File

@ -170,7 +170,6 @@ mcl_mobs:register_arrow("mobs_mc:dragon_fireball", {
end
})
mcl_mobs:register_egg("mobs_mc:enderdragon", S("Ender Dragon"), "#252525", "#b313c9", 0, true)
mcl_mobs:register_egg("mobs_mc:enderdragon", S("Ender Dragon"), "mobs_mc_spawn_icon_dragon.png", 0, true)
mcl_wip.register_wip_item("mobs_mc:enderdragon")

View File

@ -24,25 +24,7 @@
-- added rain damage.
-- fixed the grass_with_dirt issue.
minetest.register_entity("mobs_mc:ender_eyes", {
visual = "mesh",
mesh = "mobs_mc_spider.b3d",
visual_size = {x=1.01, y=1.01},
textures = {
"mobs_mc_enderman_eyes.png",
},
on_step = function(self)
if self and self.object then
if not self.object:get_attach() then
self.object:remove()
end
end
end,
glow = 50,
})
local S = minetest.get_translator("mobs_mc")
local enable_damage = minetest.settings:get_bool("enable_damage")
local telesound = function(pos, is_source)
local snd
@ -255,19 +237,6 @@ mcl_mobs:register_mob("mobs_mc:enderman", {
textures = create_enderman_textures(),
visual_size = {x=3, y=3},
makes_footstep_sound = true,
on_spawn = function(self)
local spider_eyes=false
for n = 1, #self.object:get_children() do
local obj = self.object:get_children()[n]
if obj:get_luaentity() and self.object:get_luaentity().name == "mobs_mc:ender_eyes" then
spider_eyes = true
end
end
if not spider_eyes then
minetest.add_entity(self.object:get_pos(), "mobs_mc:ender_eyes"):set_attach(self.object, "head.top", vector.new(0,2.54,-1.99), vector.new(90,0,180))
minetest.add_entity(self.object:get_pos(), "mobs_mc:ender_eyes"):set_attach(self.object, "head.top", vector.new(1,2.54,-1.99), vector.new(90,0,180))
end
end,
sounds = {
-- TODO: Custom war cry sound
war_cry = "mobs_sandmonster",
@ -413,7 +382,7 @@ mcl_mobs:register_mob("mobs_mc:enderman", {
-- self:teleport(nil)
-- self.state = ""
--else
if self.attack ~= nil and enable_damage then
if self.attack ~= nil and not minetest.settings:get_bool("creative_mode") then
self.state = 'attack'
end
--end
@ -860,4 +829,4 @@ mcl_vars.mg_nether_min,
mcl_vars.mg_nether_max)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:enderman", S("Enderman"), "#252525", "#151515", 0)
mcl_mobs:register_egg("mobs_mc:enderman", S("Enderman"), "mobs_mc_spawn_icon_enderman.png", 0)

View File

@ -38,4 +38,4 @@ mcl_mobs:register_mob("mobs_mc:endermite", {
reach = 1,
})
mcl_mobs:register_egg("mobs_mc:endermite", S("Endermite"), "#161616", "#6d6d6d", 0)
mcl_mobs:register_egg("mobs_mc:endermite", S("Endermite"), "mobs_mc_spawn_icon_endermite.png", 0)

View File

@ -141,4 +141,4 @@ mcl_mobs:register_arrow("mobs_mc:fireball", {
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:ghast", S("Ghast"), "#f9f9f9", "#bcbcbc", 0)
mcl_mobs:register_egg("mobs_mc:ghast", S("Ghast"), "mobs_mc_spawn_icon_ghast.png", 0)

View File

@ -104,4 +104,4 @@ mcl_mobs:register_mob("mobs_mc:guardian", {
--mcl_mobs:spawn_specific("mobs_mc:guardian", { "mcl_core:water_source", "mclx_core:river_water_source" }, { "mcl_core:water_source", "mclx_core:river_water_source" }, 0, minetest.LIGHT_MAX+1, 30, 25000, 2, mcl_vars.mg_overworld_min, mobs_mc.water_level - 10)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:guardian", S("Guardian"), "#5a8272", "#f17d31", 0)
mcl_mobs:register_egg("mobs_mc:guardian", S("Guardian"), "mobs_mc_spawn_icon_guardian.png", 0)

View File

@ -112,6 +112,5 @@ mcl_mobs:register_mob("mobs_mc:guardian_elder", {
-- mcl_mobs:spawn_specific("mobs_mc:guardian_elder", { "mcl_core:water_source", "mclx_core:river_water_source" }, { "mcl_core:water_source", "mclx_core:river_water_source" }, 0, minetest.LIGHT_MAX+1, 30, 40000, 2, mcl_vars.mg_overworld_min, mobs_mc.water_level-18)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:guardian_elder", S("Elder Guardian"), "#ceccba", "#747693", 0)
mcl_mobs:register_egg("mobs_mc:guardian_elder", S("Elder Guardian"), "mobs_mc_spawn_icon_guardian_elder.png", 0)

View File

@ -34,30 +34,6 @@ local horse_extra_texture = function(horse)
return textures
end
local function get_drops(self)
self.drops = {}
table.insert(self.drops,
{name = "mcl_mobitems:leather",
chance = 1,
min = 0,
max = 2,
looting = "common",
})
if self._saddle then
table.insert(self.drops,{name = "mcl_mobitems:saddle",
chance = 1,
min = 1,
max = 1,})
end
if self._chest then
table.insert(self.drops,{name = "mcl_chests:chest",
chance = 1,
min = 1,
max = 1,})
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"
@ -261,27 +237,6 @@ local horse = {
local iname = item:get_name()
local heal = 0
if self._inv_id then
if not self._chest and item:get_name() == "mcl_chests:chest" then
item:take_item()
clicker:set_wielded_item(item)
self._chest = true
-- Update texture
if not self._naked_texture then
-- Base horse texture without chest or saddle
self._naked_texture = self.base_texture[2]
end
local tex = horse_extra_texture(self)
self.base_texture = tex
self.object:set_properties({textures = self.base_texture})
get_drops(self)
return
elseif self._chest and clicker:get_player_control().sneak then
mcl_entity_invs.show_inv_form(self,clicker)
return
end
end
-- Taming
self.temper = self.temper or (math.random(1,100))
@ -385,7 +340,6 @@ local horse = {
self.base_texture = tex
self.object:set_properties({textures = self.base_texture})
minetest.sound_play({name = "mcl_armor_equip_leather"}, {gain=0.5, max_hear_distance=12, pos=self.object:get_pos()}, true)
get_drops(self)
-- Put on horse armor if tamed
elseif can_equip_horse_armor(self.name) and not self.driver and not self._horse_armor
@ -564,9 +518,8 @@ donkey.collisionbox = {
donkey.jump = true
donkey.jump_height = 3.75 -- can clear 1 block height
mcl_mobs:register_mob("mobs_mc:donkey", donkey)
mcl_entity_invs.register_inv("mobs_mc:donkey","Donkey",15,true)
-- Mule
local m = 0.94
local mule = table.copy(donkey)
@ -584,7 +537,6 @@ mule.collisionbox = {
horse.collisionbox[6] * m,
}
mcl_mobs:register_mob("mobs_mc:mule", mule)
mcl_entity_invs.register_inv("mobs_mc:mule","Mule",15,true)
--===========================
--Spawn Function
@ -635,8 +587,8 @@ mobs_mc.water_level+3,
mcl_vars.mg_overworld_max)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:horse", S("Horse"), "#c09e7d", "#eee500", 0)
mcl_mobs:register_egg("mobs_mc:skeleton_horse", S("Skeleton Horse"), "#68684f", "#e5e5d8", 0)
--mobs:register_egg("mobs_mc:zombie_horse", S("Zombie Horse"), "#2a5a37", "#84d080", 0)
mcl_mobs:register_egg("mobs_mc:donkey", S("Donkey"), "#534539", "#867566", 0)
mcl_mobs:register_egg("mobs_mc:mule", S("Mule"), "#1b0200", "#51331d", 0)
mcl_mobs:register_egg("mobs_mc:horse", S("Horse"), "mobs_mc_spawn_icon_horse.png", 0)
mcl_mobs:register_egg("mobs_mc:skeleton_horse", S("Skeleton Horse"), "mobs_mc_spawn_icon_horse_skeleton.png", 0)
--mobs:register_egg("mobs_mc:zombie_horse", S("Zombie Horse"), "mobs_mc_spawn_icon_horse_zombie.png", 0)
mcl_mobs:register_egg("mobs_mc:donkey", S("Donkey"), "mobs_mc_spawn_icon_donkey.png", 0)
mcl_mobs:register_egg("mobs_mc:mule", S("Mule"), "mobs_mc_spawn_icon_mule.png", 0)

View File

@ -22,9 +22,6 @@ mcl_mobs:register_mob("mobs_mc:iron_golem", {
collisionbox = {-0.7, -0.01, -0.7, 0.7, 2.69, 0.7},
visual = "mesh",
mesh = "mobs_mc_iron_golem.b3d",
head_swivel = "head.control",
bone_eye_height = 3.38,
curiosity = 10,
textures = {
{"mobs_mc_iron_golem.png"},
},
@ -96,7 +93,8 @@ mcl_mobs:register_mob("mobs_mc:iron_golem", {
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:iron_golem", S("Iron Golem"), "#3b3b3b", "#f57223", 0)
mcl_mobs:register_egg("mobs_mc:iron_golem", S("Iron Golem"), "mobs_mc_spawn_icon_iron_golem.png", 0)
--[[ This is to be called when a pumpkin or jack'o lantern has been placed. Recommended: In the on_construct function of the node.
This summons an iron golen if placing the pumpkin created an iron golem summon pattern:

View File

@ -24,29 +24,6 @@ local carpets = {
unicolor_light_blue = { "mcl_wool:light_blue_carpet", "light_blue" },
}
local function get_drops(self)
self.drops = {}
table.insert(self.drops,
{name = "mcl_mobitems:leather",
chance = 1,
min = 0,
max = 2,
looting = "common",
})
if self.carpet then
table.insert(self.drops,{name = self.carpet,
chance = 1,
min = 1,
max = 1,})
end
if self._has_chest then
table.insert(self.drops,{name = "mcl_chests:chest",
chance = 1,
min = 1,
max = 1,})
end
end
mcl_mobs:register_mob("mobs_mc:llama", {
description = S("Llama"),
type = "animal",
@ -58,14 +35,6 @@ mcl_mobs:register_mob("mobs_mc:llama", {
shoot_offset = 1, --3.5 *would* be a good value visually but it somehow messes with the projectiles trajectory
spawn_in_group_min = 4,
spawn_in_group = 6,
head_swivel = "head.control",
bone_eye_height = 11,
head_eye_height = 3,
horrizonatal_head_height=0,
curiosity = 60,
head_yaw = "z",
hp_min = 15,
hp_max = 30,
xp_min = 1,
@ -80,6 +49,7 @@ mcl_mobs:register_mob("mobs_mc:llama", {
{"blank.png", "blank.png", "mobs_mc_llama_white.png"},
{"blank.png", "blank.png", "mobs_mc_llama.png"},
},
visual_size = {x=3, y=3},
makes_footstep_sound = true,
runaway = false,
walk_velocity = 1,
@ -101,28 +71,36 @@ mcl_mobs:register_mob("mobs_mc:llama", {
distance = 16,
},
animation = {
stand_start = 0, stand_end = 0,
walk_start = 0, walk_end = 40, walk_speed = 35,
run_start = 0, run_end = 40, run_speed = 50,
},
child_animations = {
stand_start = 41, stand_end = 41,
walk_start = 41, walk_end = 81, walk_speed = 50,
run_start = 41, run_end = 81, run_speed = 75,
speed_normal = 24,
run_speed = 60,
run_start = 0,
run_end = 40,
stand_start = 0,
stand_end = 0,
walk_start = 0,
walk_end = 40,
hurt_start = 118,
hurt_end = 154,
death_start = 154,
death_end = 179,
eat_start = 49,
eat_end = 78,
look_start = 78,
look_end = 108,
},
follow = { "mcl_farming:wheat_item", "mcl_farming:hay_block" },
view_range = 16,
do_custom = function(self, dtime)
-- set needed values if not already present
if not self.v3 then
self.v3 = 0
if not self.v2 then
self.v2 = 0
self.max_speed_forward = 4
self.max_speed_reverse = 2
self.accel = 4
self.terrain_type = 3
self.driver_attach_at = {x = 0, y = 12.7, z = -5}
self.driver_eye_offset = {x = 0, y = 6, z = 0}
self.driver_attach_at = {x = 0, y = 4.17, z = -1.5}
self.driver_eye_offset = {x = 0, y = 3, z = 0}
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
end
@ -157,20 +135,6 @@ mcl_mobs:register_mob("mobs_mc:llama", {
if item:get_name() == "mcl_farming:hay_block" then
-- Breed with hay bale
if mcl_mobs:feed_tame(self, clicker, 1, true, false) then return end
elseif not self._has_chest and item:get_name() == "mcl_chests:chest" then
item:take_item()
clicker:set_wielded_item(item)
self._has_chest = true
self.base_texture = table.copy(self.base_texture)
self.base_texture[1] = self.base_texture[3]
self.object:set_properties({
textures = self.base_texture,
})
get_drops(self)
return
elseif self._has_chest and clicker:get_player_control().sneak then
mcl_entity_invs.show_inv_form(self,clicker," - Strength "..math.floor(self._inv_size / 3))
return
else
-- Feed with anything else
if mcl_mobs:feed_tame(self, clicker, 1, false, true) then return end
@ -179,36 +143,53 @@ mcl_mobs:register_mob("mobs_mc:llama", {
-- Make sure tamed llama is mature and being clicked by owner only
if self.tamed and not self.child and self.owner == clicker:get_player_name() then
-- Place carpet
if minetest.get_item_group(item:get_name(), "carpet") == 1 and not self.carpet then
for group, carpetdata in pairs(carpets) do
if minetest.get_item_group(item:get_name(), group) == 1 then
if not minetest.is_creative_enabled(clicker:get_player_name()) then
item:take_item()
clicker:set_wielded_item(item)
end
local substr = carpetdata[2]
local tex_carpet = "mobs_mc_llama_decor_"..substr..".png"
self.base_texture = table.copy(self.base_texture)
self.base_texture[2] = tex_carpet
self.object:set_properties({
textures = self.base_texture,
})
self.carpet = item:get_name()
get_drops(self)
return
-- Place carpet
if minetest.get_item_group(item:get_name(), "carpet") == 1 and not self.carpet then
for group, carpetdata in pairs(carpets) do
if minetest.get_item_group(item:get_name(), group) == 1 then
if not minetest.is_creative_enabled(clicker:get_player_name()) then
item:take_item()
clicker:set_wielded_item(item)
end
local substr = carpetdata[2]
local tex_carpet = "mobs_mc_llama_decor_"..substr..".png"
self.base_texture = table.copy(self.base_texture)
self.base_texture[2] = tex_carpet
self.object:set_properties({
textures = self.base_texture,
})
self.carpet = item:get_name()
self.drops = {
{name = "mcl_mobitems:leather",
chance = 1,
min = 0,
max = 2,},
{name = item:get_name(),
chance = 1,
min = 1,
max = 1,},
}
return
end
end
end
-- detatch player already riding llama
if self.driver and clicker == self.driver then
mcl_mobs.detach(clicker, {x = 1, y = 0, z = 1})
-- attach player to llama
elseif not self.driver then
self.object:set_properties({stepheight = 1.1})
mcl_mobs.attach(self, clicker)
end
-- detatch player already riding llama
if self.driver and clicker == self.driver then
mcl_mobs.detach(clicker, {x = 1, y = 0, z = 1})
-- attach player to llama
elseif not self.driver then
self.object:set_properties({stepheight = 1.1})
mcl_mobs.attach(self, clicker)
end
-- Used to capture llama
elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then
mcl_mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end
end,
@ -233,25 +214,8 @@ mcl_mobs:register_mob("mobs_mc:llama", {
return false
end
end,
on_spawn = function(self)
if not self._inv_size then
local r = math.random(1000)
if r < 80 then
self._inv_size = 15
elseif r < 160 then
self._inv_size = 12
elseif r < 488 then
self._inv_size = 9
elseif r < 816 then
self._inv_size = 6
else
self._inv_size = 3
end
end
end,
})
mcl_entity_invs.register_inv("mobs_mc:llama","Llama",nil,true)
})
-- spit arrow (weapon)
mcl_mobs:register_arrow("mobs_mc:llamaspit", {
@ -284,10 +248,12 @@ mcl_mobs:spawn_specific(
"SavannaM_beach",
"Savanna_beach",
"Savanna_ocean",
"JungleEdge",
"JungleEdgeM",
"ExtremeHills",
"ExtremeHills_beach",
"ExtremeHillsM",
}, --FIXME: Needs Windswept Forest when that is added.
},
0,
minetest.LIGHT_MAX+1,
30,
@ -297,4 +263,4 @@ mobs_mc.water_level+15,
mcl_vars.mg_overworld_max)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:llama", S("Llama"), "#c09e7d", "#995f40", 0)
mcl_mobs:register_egg("mobs_mc:llama", S("Llama"), "mobs_mc_spawn_icon_llama.png", 0)

Binary file not shown.

Binary file not shown.

View File

@ -36,16 +36,11 @@ local ocelot = {
hp_max = 10,
xp_min = 1,
xp_max = 3,
head_swivel = "head.control",
bone_eye_height = 6.2,
head_eye_height = 0.4,
horrizonatal_head_height=-0,
head_yaw="z",
curiosity = 4,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.69, 0.3},
visual = "mesh",
mesh = "mobs_mc_cat.b3d",
textures = {"mobs_mc_cat_ocelot.png"},
visual_size = {x=2.0, y=2.0},
makes_footstep_sound = true,
walk_chance = default_walk_chance,
walk_velocity = 1,
@ -62,16 +57,14 @@ local ocelot = {
distance = 16,
},
animation = {
stand_start = 0, stand_end = 0,
walk_start = 0, walk_end = 40, walk_speed = 40,
run_start = 0, run_end = 40, run_speed = 50,
sit_start = 50, sit_end = 50,
},
child_animations = {
stand_start = 51, stand_end = 51,
walk_start = 51, walk_end = 91, walk_speed = 60,
run_start = 51, run_end = 91, run_speed = 75,
sit_start = 101, sit_end = 101,
speed_normal = 25,
run_speed = 50,
stand_start = 0,
stand_end = 0,
walk_start = 0,
walk_end = 40,
run_start = 0,
run_end = 40,
},
follow = follow,
view_range = 12,
@ -239,4 +232,5 @@ mobs:spawn({
]]--
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:ocelot", S("Ocelot"), "#efde7d", "#564434", 0)
-- FIXME: The spawn icon shows a cat texture, not an ocelot texture
mcl_mobs:register_egg("mobs_mc:ocelot", S("Ocelot"), "mobs_mc_spawn_icon_cat.png", 0)

View File

@ -135,10 +135,6 @@ mcl_mobs:register_mob("mobs_mc:parrot", {
hp_max = 6,
xp_min = 1,
xp_max = 3,
head_swivel = "head.control",
bone_eye_height = 1.1,
horrizonatal_head_height=0,
curiosity = 10,
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
visual = "mesh",
mesh = "mobs_mc_parrot.b3d",
@ -241,4 +237,4 @@ mobs_mc.water_level+7,
mcl_vars.mg_overworld_max)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:parrot", S("Parrot"), "#0da70a", "#ff0000", 0)
mcl_mobs:register_egg("mobs_mc:parrot", S("Parrot"), "mobs_mc_spawn_icon_parrot.png", 0)

View File

@ -15,15 +15,11 @@ mcl_mobs:register_mob("mobs_mc:pig", {
visual = "mesh",
mesh = "mobs_mc_pig.b3d",
textures = {{
"blank.png", -- baby
"mobs_mc_pig.png", -- base
"blank.png", -- saddle
}},
head_swivel = "head.control",
bone_eye_height = 7.5,
head_eye_height = 0.8,
horrizonatal_head_height=-1,
curiosity = 3,
head_yaw="z",
visual_size = {x=2.5, y=2.5},
makes_footstep_sound = true,
walk_velocity = 1,
run_velocity = 3,
@ -44,14 +40,15 @@ mcl_mobs:register_mob("mobs_mc:pig", {
distance = 16,
},
animation = {
stand_start = 0, stand_end = 0,
walk_start = 0, walk_end = 40, walk_speed = 60,
run_start = 0, run_end = 40, run_speed = 90,
},
child_animations = {
stand_start = 41, stand_end = 41,
walk_start = 41, walk_end = 81, walk_speed = 90,
run_start = 41, run_end = 81, run_speed = 135,
stand_speed = 40,
walk_speed = 40,
run_speed = 90,
stand_start = 0,
stand_end = 0,
walk_start = 0,
walk_end = 40,
run_start = 0,
run_end = 40,
},
follow = {
"mcl_farming:potato_item",
@ -63,17 +60,15 @@ mcl_mobs:register_mob("mobs_mc:pig", {
do_custom = function(self, dtime)
-- set needed values if not already present
if not self.v3 then
self.v3 = 0
if not self.v2 then
self.v2 = 0
self.max_speed_forward = 4
self.max_speed_reverse = 2
self.accel = 4
self.terrain_type = 3
self.driver_attach_at = {x = 0.0, y = 6.5, z = -3.75}
self.driver_attach_at = {x = 0.0, y = 2.75, z = -1.5}
self.driver_eye_offset = {x = 0, y = 3, z = 0}
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
self.base_texture = self.texture_list[1]
self.object:set_properties({textures = self.base_texture})
end
-- if driver present allow control of horse
@ -116,6 +111,7 @@ mcl_mobs:register_mob("mobs_mc:pig", {
local item = clicker:get_wielded_item()
if item:get_name() == "mcl_mobitems:saddle" and self.saddle ~= "yes" then
self.base_texture = {
"blank.png", -- baby
"mobs_mc_pig.png", -- base
"mobs_mc_pig_saddle.png", -- saddle
}
@ -238,4 +234,4 @@ mcl_vars.mg_overworld_min,
mcl_vars.mg_overworld_max)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:pig", S("Pig"), "#f0a5a2", "#db635f", 0)
mcl_mobs:register_egg("mobs_mc:pig", S("Pig"), "mobs_mc_spawn_icon_pig.png", 0)

View File

@ -120,4 +120,4 @@ pillager = {
}
mcl_mobs:register_mob("mobs_mc:pillager", pillager)
mcl_mobs:register_egg("mobs_mc:pillager", S("Pillager"), "#532f36", "#959b9b", 0)
mcl_mobs:register_egg("mobs_mc:pillager", S("Pillager"), "mobs_mc_spawn_icon_pillager.png", 0)

View File

@ -24,12 +24,6 @@ mcl_mobs:register_mob("mobs_mc:polar_bear", {
textures = {
{"mobs_mc_polarbear.png"},
},
head_swivel = "head.control",
bone_eye_height = 2.6,
head_eye_height = 1,
horrizonatal_head_height = 0,
curiosity = 20,
head_yaw="z",
visual_size = {x=3.0, y=3.0},
makes_footstep_sound = true,
damage = 6,
@ -92,4 +86,4 @@ mcl_vars.mg_overworld_min,
mcl_vars.mg_overworld_max)
-- spawn egg
mcl_mobs:register_egg("mobs_mc:polar_bear", S("Polar Bear"), "#f2f2f2", "#959590", 0)
mcl_mobs:register_egg("mobs_mc:polar_bear", S("Polar Bear"), "mobs_mc_spawn_icon_polarbear.png", 0)

View File

@ -15,12 +15,7 @@ local rabbit = {
xp_min = 1,
xp_max = 3,
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.49, 0.2},
head_swivel = "head.control",
bone_eye_height = 2,
head_eye_height = 0.5,
horrizonatal_head_height = -.3,
curiosity = 20,
head_yaw="z",
visual = "mesh",
mesh = "mobs_mc_rabbit.b3d",
textures = {
@ -31,6 +26,7 @@ local rabbit = {
{"mobs_mc_rabbit_salt.png"},
{"mobs_mc_rabbit_black.png"},
},
visual_size = {x=1.5, y=1.5},
sounds = {
random = "mobs_mc_rabbit_random",
damage = "mobs_mc_rabbit_hurt",
@ -53,14 +49,10 @@ local rabbit = {
},
fear_height = 4,
animation = {
stand_start = 0, stand_end = 0,
walk_start = 0, walk_end = 20, walk_speed = 20,
run_start = 0, run_end = 20, run_speed = 30,
},
child_animations = {
stand_start = 21, stand_end = 21,
walk_start = 21, walk_end = 41, walk_speed = 30,
run_start = 21, run_end = 41, run_speed = 45,
speed_normal = 25, speed_run = 50,
stand_start = 0, stand_end = 0,
walk_start = 0, walk_end = 20,
run_start = 0, run_end = 20,
},
-- Follow (yellow) dangelions, carrots and golden carrots
follow = {
@ -213,7 +205,7 @@ mcl_mobs:spawn(spawn_grass)
]]--
-- Spawn egg
mcl_mobs:register_egg("mobs_mc:rabbit", S("Rabbit"), "#995f40", "#734831", 0)
mcl_mobs:register_egg("mobs_mc:rabbit", S("Rabbit"), "mobs_mc_spawn_icon_rabbit.png", 0)
-- Note: This spawn egg does not exist in Minecraft
mcl_mobs:register_egg("mobs_mc:killer_bunny", S("Killer Bunny"), "#f2f2f2", "#ff0000", 0)
mcl_mobs:register_egg("mobs_mc:killer_bunny", S("Killer Bunny"), "mobs_mc_spawn_icon_rabbit.png^[colorize:#FF0000:192", 0) -- TODO: Update inventory image

View File

@ -225,4 +225,4 @@ water-16,
water+1)
--spawn egg
mcl_mobs:register_egg("mobs_mc:salmon", S("Salmon"), "#a00f10", "#0e8474", 0)
mcl_mobs:register_egg("mobs_mc:salmon", S("Salmon"), "extra_mobs_spawn_icon_salmon.png", 0)

View File

@ -61,13 +61,9 @@ mcl_mobs:register_mob("mobs_mc:sheep", {
xp_min = 1,
xp_max = 3,
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.29, 0.45},
head_swivel = "head.control",
bone_eye_height = 3.3,
head_eye_height = 1.1,
horrizonatal_head_height=-.7,
curiosity = 6,
head_yaw="z",
visual = "mesh",
visual_size = {x=3, y=3},
mesh = "mobs_mc_sheepfur.b3d",
textures = { sheep_texture("unicolor_white") },
gotten_texture = gotten_texture,
@ -97,14 +93,10 @@ mcl_mobs:register_mob("mobs_mc:sheep", {
distance = 16,
},
animation = {
stand_start = 0, stand_end = 0,
walk_start = 0, walk_end = 40, walk_speed = 30,
run_start = 0, run_end = 40, run_speed = 40,
},
child_animations = {
stand_start = 81, stand_end = 81,
walk_start = 81, walk_end = 121, walk_speed = 45,
run_start = 81, run_end = 121, run_speed = 60,
speed_normal = 25, run_speed = 65,
stand_start = 40, stand_end = 80,
walk_start = 0, walk_end = 40,
run_start = 0, run_end = 40,
},
follow = { "mcl_farming:wheat_item" },
view_range = 12,
@ -365,4 +357,4 @@ mcl_vars.mg_overworld_min,
mcl_vars.mg_overworld_max)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:sheep", S("Sheep"), "#e7e7e7", "#ffb5b5", 0)
mcl_mobs:register_egg("mobs_mc:sheep", S("Sheep"), "mobs_mc_spawn_icon_sheep.png", 0)

View File

@ -177,8 +177,7 @@ mcl_mobs:register_arrow("mobs_mc:shulkerbullet", {
})
mcl_mobs:register_egg("mobs_mc:shulker", S("Shulker"), "#946694", "#4d3852", 0)
mcl_mobs:register_egg("mobs_mc:shulker", S("Shulker"), "mobs_mc_spawn_icon_shulker.png", 0)
--[[
mcl_mobs:spawn_specific(
"mobs_mc:shulker",

View File

@ -56,7 +56,7 @@ mcl_mobs:register_mob("mobs_mc:silverfish", {
reach = 1,
})
mcl_mobs:register_egg("mobs_mc:silverfish", S("Silverfish"), "#6d6d6d", "#313131", 0)
mcl_mobs:register_egg("mobs_mc:silverfish", S("Silverfish"), "mobs_mc_spawn_icon_silverfish.png", 0)
-- Monster egg blocks (Minetest Game)
if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then

View File

@ -25,15 +25,13 @@ local skeleton = {
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.98, 0.3},
pathfinding = 1,
group_attack = true,
head_swivel = "Head_Control",
bone_eye_height = 2.38,
curiosity = 6,
visual = "mesh",
mesh = "mobs_mc_skeleton.b3d",
textures = { {
"mcl_bows_bow_0.png", -- bow
"mobs_mc_skeleton.png", -- skeleton
} },
visual_size = {x=1, y=1},
makes_footstep_sound = true,
textures = {
{
@ -80,27 +78,11 @@ local skeleton = {
run_speed = 30,
shoot_start = 70,
shoot_end = 90,
jockey_start = 172,
jockey_end = 172,
die_start = 160,
die_end = 170,
die_speed = 15,
die_loop = false,
},
jock = "mobs_mc:spider",
on_spawn = function(self)
self.jockey = false
if math.random(100) == 1 then -- 1% like from MCwiki
self.jockey = true
local jock = minetest.add_entity(self.object:get_pos(), "mobs_mc:spider")
jock:get_luaentity().docile_by_day = false
self.object:set_attach(jock, "", vector.new(0,0,0), vector.new(0,0,0))
end
return true
end,
on_detach=function(self, parent)
self.jockey = false
end,
ignited_by_sunlight = true,
view_range = 16,
fear_height = 4,
@ -108,9 +90,6 @@ local skeleton = {
arrow = "mcl_bows:arrow_entity",
shoot_arrow = function(self, pos, dir)
if mod_bows then
if self.attack then
self.object:set_yaw(minetest.dir_to_yaw(vector.direction(self.object:get_pos(), self.attack:get_pos())))
end
-- 2-4 damage per arrow
local dmg = math.max(4, math.random(2, 8))
mcl_bows.shoot_arrow("mcl_bows:arrow", pos, dir, self.object:get_yaw(), self.object, nil, dmg)
@ -350,6 +329,5 @@ mcl_vars.mg_overworld_max)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:skeleton", S("Skeleton"), "#c1c1c1", "#494949", 0)
mcl_mobs:register_egg("mobs_mc:stray", S("Stray"), "#5f7476", "#dae8e7", 0)
mcl_mobs:register_egg("mobs_mc:skeleton", S("Skeleton"), "mobs_mc_spawn_icon_skeleton.png", 0)
mcl_mobs:register_egg("mobs_mc:stray", S("Stray"), "mobs_mc_spawn_icon_stray.png", 0)

View File

@ -24,14 +24,11 @@ mcl_mobs:register_mob("mobs_mc:witherskeleton", {
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2.39, 0.35},
visual = "mesh",
mesh = "mobs_mc_witherskeleton.b3d",
head_swivel = "head.control",
bone_eye_height = 2.38,
curiosity = 60,
textures = {
{
"mobs_mc_empty.png", -- armor
"default_tool_stonesword.png", -- sword
"mobs_mc_wither_skeleton.png", -- wither skeleton
"default_tool_stonesword.png", -- sword
}
},
visual_size = {x=1.2, y=1.2},
@ -116,4 +113,4 @@ mcl_vars.mg_nether_min,
mcl_vars.mg_nether_max)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:witherskeleton", S("Wither Skeleton"), "#141414", "#474d4d", 0)
mcl_mobs:register_egg("mobs_mc:witherskeleton", S("Wither Skeleton"), "mobs_mc_spawn_icon_witherskeleton.png", 0)

View File

@ -447,6 +447,5 @@ mmin,
mmax)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:magma_cube_big", S("Magma Cube"), "#350000", "#fcfc00")
mcl_mobs:register_egg("mobs_mc:slime_big", S("Slime"), "#52a03e", "#7ebf6d")
mcl_mobs:register_egg("mobs_mc:magma_cube_big", S("Magma Cube"), "mobs_mc_spawn_icon_magmacube.png")
mcl_mobs:register_egg("mobs_mc:slime_big", S("Slime"), "mobs_mc_spawn_icon_slime.png")

View File

@ -196,4 +196,4 @@ function mobs_mc.check_snow_golem_summon(pos)
end
-- Spawn egg
mcl_mobs:register_egg("mobs_mc:snowman", S("Snow Golem"), "#f2f2f2", "#fd8f47", 0)
mcl_mobs:register_egg("mobs_mc:snowman", S("Snow Golem"), "mobs_mc_spawn_icon_snowman.png", 0)

View File

@ -11,22 +11,6 @@ local S = minetest.get_translator("mobs_mc")
-- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 license for texture)
minetest.register_entity("mobs_mc:spider_eyes", {
visual = "mesh",
mesh = "mobs_mc_spider.b3d",
visual_size = {x=1.01/3, y=1.01/3},
textures = {
"mobs_mc_spider_eyes.png",
},
on_step = function(self)
if self and self.object then
if not self.object:get_attach() then
self.object:remove()
end
end
end,
glow = 50,
})
local spider = {
description = S("Spider"),
@ -43,38 +27,13 @@ local spider = {
xp_min = 5,
xp_max = 5,
armor = {fleshy = 100, arthropod = 100},
on_spawn = function(self)
self.object:set_properties({visual_size={x=1,y=1}})
local spider_eyes=false
for n = 1, #self.object:get_children() do
local obj = self.object:get_children()[n]
if obj:get_luaentity() and self.object:get_luaentity().name == "mobs_mc:spider_eyes" then
spider_eyes = true
end
end
if not spider_eyes then
minetest.add_entity(self.object:get_pos(), "mobs_mc:spider_eyes"):set_attach(self.object, "body.head", vector.new(0,-0.98,2), vector.new(90,180,180))
end
end,
on_die=function(self)
if self.object:get_children() and self.object:get_children()[1] then
self.object:get_children()[1]:set_detach()
end
end,
detach_child=function(self, child)
child:get_luaentity().jockey = false
end,
head_swivel = "Head_Control",
bone_eye_height = 1,
curiosity = 10,
head_yaw="z",
collisionbox = {-0.7, -0.01, -0.7, 0.7, 0.89, 0.7},
visual = "mesh",
mesh = "mobs_mc_spider.b3d",
textures = {
{"mobs_mc_spider.png"},
{"mobs_mc_spider.png^(mobs_mc_spider_eyes.png^[makealpha:0,0,0)"},
},
visual_size = {x=1, y=1},
visual_size = {x=3, y=3},
makes_footstep_sound = false,
sounds = {
random = "mobs_mc_spider_random",
@ -279,5 +238,5 @@ mcl_vars.mg_overworld_min,
mcl_vars.mg_overworld_max)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:spider", S("Spider"), "#342d26", "#a80e0e", 0)
mcl_mobs:register_egg("mobs_mc:cave_spider", S("Cave Spider"), "#0c424e", "#a80e0e", 0)
mcl_mobs:register_egg("mobs_mc:spider", S("Spider"), "mobs_mc_spawn_icon_spider.png", 0)
mcl_mobs:register_egg("mobs_mc:cave_spider", S("Cave Spider"), "mobs_mc_spawn_icon_cave_spider.png", 0)

View File

@ -217,4 +217,4 @@ water-16,
water+1)
-- spawn eggs
mcl_mobs:register_egg("mobs_mc:squid", S("Squid"), "#223b4d", "#708999", 0)
mcl_mobs:register_egg("mobs_mc:squid", S("Squid"), "mobs_mc_spawn_icon_squid.png", 0)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 978 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 B

After

Width:  |  Height:  |  Size: 917 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 B

After

Width:  |  Height:  |  Size: 939 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

After

Width:  |  Height:  |  Size: 921 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 B

After

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 904 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 932 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 B

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 B

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 426 B

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

After

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 755 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Some files were not shown because too many files have changed in this diff Show More