Draylar / better-dropped-items

https://www.curseforge.com/minecraft/mc-mods/better-dropped-items
Other
13 stars 17 forks source link

Some 2D items float above the ground #8

Closed Zkyo42 closed 4 years ago

Zkyo42 commented 4 years ago

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

skylorbeck commented 4 years ago

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

skylorbeck commented 4 years ago

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);
        }
Draylar commented 4 years ago

Fixed in 1.2.3+ thanks to Skylortrexler.