Skip to content

Commit 2fd5f38

Browse files
committed
Change item entity collisionbox so that they don't sink into the ground
1 parent 03dae5f commit 2fd5f38

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

builtin/game/item_entity.lua

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ core.register_entity(":__builtin:item", {
2727
visual = "wielditem",
2828
visual_size = {x = 0.4, y = 0.4},
2929
textures = {""},
30-
spritediv = {x = 1, y = 1},
31-
initial_sprite_basepos = {x = 0, y = 0},
3230
is_visible = false,
3331
},
3432

@@ -56,7 +54,6 @@ core.register_entity(":__builtin:item", {
5654
local max_count = stack:get_stack_max()
5755
local count = math.min(stack:get_count(), max_count)
5856
local size = 0.2 + 0.1 * (count / max_count) ^ (1 / 3)
59-
local coll_height = size * 0.75
6057
local def = core.registered_nodes[itemname]
6158
local glow = def and math.floor(def.light_source / 2 + 0.5)
6259

@@ -65,9 +62,7 @@ core.register_entity(":__builtin:item", {
6562
visual = "wielditem",
6663
textures = {itemname},
6764
visual_size = {x = size, y = size},
68-
collisionbox = {-size, -coll_height, -size,
69-
size, coll_height, size},
70-
selectionbox = {-size, -size, -size, size, size, size},
65+
collisionbox = {-size, -size, -size, size, size, size},
7166
automatic_rotate = math.pi * 0.5 * 0.2 / size,
7267
wield_item = self.itemstring,
7368
glow = glow,

0 commit comments

Comments
 (0)