forked from mtcontrib/mob_horse
Compare commits
8 Commits
0919faf76e
...
2ac1e816ed
Author | SHA1 | Date | |
---|---|---|---|
2ac1e816ed | |||
d7a5b88fb4 | |||
d2c0afcff2 | |||
aa867c3fa0 | |||
70f40e2fb4 | |||
858167c386 | |||
5f26b248b1 | |||
8dfead83c6 |
27
init.lua
27
init.lua
@ -6,7 +6,7 @@ local S = minetest.get_translator and minetest.get_translator("mob_horse") or
|
||||
|
||||
-- 0.4.17 or 5.0 check
|
||||
local y_off = 20
|
||||
if minetest.registered_nodes["default:permafrost"] then
|
||||
if minetest.features.object_independent_selectionbox then
|
||||
y_off = 10
|
||||
end
|
||||
|
||||
@ -29,7 +29,12 @@ mobs:register_mob("mob_horse:horse", {
|
||||
speed_normal = 15,
|
||||
speed_run = 30,
|
||||
stand_start = 25,
|
||||
stand_end = 75,
|
||||
stand_end = 50, -- 75
|
||||
stand2_start = 25,
|
||||
stand2_end = 25,
|
||||
stand3_start = 55,
|
||||
stand3_end = 75,
|
||||
stand3_loop = false,
|
||||
walk_start = 75,
|
||||
walk_end = 100,
|
||||
run_start = 75,
|
||||
@ -104,6 +109,14 @@ mobs:register_mob("mob_horse:horse", {
|
||||
|
||||
end,
|
||||
|
||||
do_punch = function(self, hitter)
|
||||
|
||||
-- don't cut the branch you're... ah, that's not about that
|
||||
if hitter ~= self.driver then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- make sure player is clicking
|
||||
@ -121,8 +134,10 @@ mobs:register_mob("mob_horse:horse", {
|
||||
return
|
||||
end
|
||||
|
||||
local player_name = clicker:get_player_name()
|
||||
|
||||
-- make sure tamed horse is being clicked by owner only
|
||||
if self.tamed and self.owner == clicker:get_player_name() then
|
||||
if self.tamed and self.owner == player_name then
|
||||
|
||||
local inv = clicker:get_inventory()
|
||||
local tool = clicker:get_wielded_item()
|
||||
@ -184,13 +199,15 @@ mobs:register_mob("mob_horse:horse", {
|
||||
end
|
||||
|
||||
-- show horse speed and jump stats with shoes fitted
|
||||
minetest.chat_send_player(clicker:get_player_name(),
|
||||
minetest.chat_send_player(player_name,
|
||||
S("Horse shoes fitted -")
|
||||
.. S(" speed: ") .. speed
|
||||
.. S(" , jump height: ") .. jump
|
||||
.. S(" , stop speed: ") .. reverse)
|
||||
|
||||
tool:take_item() ; clicker:set_wielded_item(tool)
|
||||
tool:take_item()
|
||||
|
||||
clicker:set_wielded_item(tool)
|
||||
|
||||
return
|
||||
end
|
||||
|
3
license.txt
Normal file
3
license.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Code: MIT
|
||||
Textures: CC-BY-SA 3.0 by Mjollna
|
||||
Model: MIT by KrupnovPavel
|
Reference in New Issue
Block a user