mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-28 13:53:45 +01:00
Make compasses point upwards when dropped as an item
This commit is contained in:
parent
cb2bc52cbb
commit
75d9450002
@ -406,6 +406,14 @@ minetest.register_entity(":__builtin:item", {
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
local stack = ItemStack(itemstring)
|
local stack = ItemStack(itemstring)
|
||||||
|
if minetest.get_item_group(stack:get_name(), "compass") > 0 then
|
||||||
|
stack:set_name("mcl_compass:16")
|
||||||
|
itemstring = stack:to_string()
|
||||||
|
self.itemstring = itemstring
|
||||||
|
end
|
||||||
|
if minetest.get_item_group(stack:get_name(), "clock") > 0 then
|
||||||
|
self.is_clock = true
|
||||||
|
end
|
||||||
local count = stack:get_count()
|
local count = stack:get_count()
|
||||||
local max_count = stack:get_stack_max()
|
local max_count = stack:get_stack_max()
|
||||||
if count > max_count then
|
if count > max_count then
|
||||||
@ -428,7 +436,6 @@ minetest.register_entity(":__builtin:item", {
|
|||||||
description = def.description
|
description = def.description
|
||||||
glow = def.light_source
|
glow = def.light_source
|
||||||
end
|
end
|
||||||
self.is_clock = minetest.get_item_group(itemname, "clock") > 0
|
|
||||||
local s = 0.2 + 0.1 * (count / max_count)
|
local s = 0.2 + 0.1 * (count / max_count)
|
||||||
local wield_scale = (def and def.wield_scale and def.wield_scale.x) or 1
|
local wield_scale = (def and def.wield_scale and def.wield_scale.x) or 1
|
||||||
local c = s
|
local c = s
|
||||||
|
Loading…
Reference in New Issue
Block a user