Better Dropped Items

Better Dropped Items

1M Downloads

Some 2D items float above the ground

Zkyo42 opened this issue ยท 3 comments

commented

I've noticed a minor issue some dropped items will hover slightly above the ground. I haven't tested everything, but they all seem to be items that have a 2d sprite, but can be placed in the world as a block. Saplings, seeds, carrots, potatoes, vines, flowers, double flowers, doors, signs, grass, rails, glass panes, iron bars, ladders, and probably several more items hover.

2020-10-17_19 09 23

commented

The cause of this is all of these items are actually an AliasedBlockItem

commented

Solved
image

        // 0.01 barely brings flat items flush to the ground
        matrixStack.translate(0, 0, 0.01f);
        if(itemEntity.getStack().getItem() instanceof AliasedBlockItem) {

        } else if(itemEntity.getStack().getItem() instanceof BlockItem) {
            // make blocks flush with the ground
            matrixStack.translate(0, 0, -0.12f);
        }
commented

Fixed in 1.2.3+ thanks to Skylortrexler.