cuberite / cuberite

A lightweight, fast and extensible game server for Minecraft

Home Page:https://cuberite.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hoppers don't drop their content when broken

AirOne01 opened this issue · comments

Client version: 1.12.2
Server OS: Manjaro Linux
Cuberite Commit id: 95bc2ea

Expected behavior

When breaking a block with storage, it will drop its content to the floor.

Actual behavior

Hoppers will not drop their content when broken.

Steps to reproduce the behavior

Break a hopper with items inside.

Is this in creative or survival?

In creative mode only.

Block entities not dropping contents on creative was intended :)

Block entities not dropping contents on creative was intended :)

Intended ? Like is this how it's supposed to be in Cuberite? Because this si not notchian.
If Cuberite is taking different approaches than the vanilla behaviour on some aspect, could you tell me how I can be informed of those, to avoid making useless pull requests?

When did you make a pull request?

I meant issue.
But the point is, what do you mean by intended?

We could do with a page in the users manual listing the deliberate differences between Cuberite and vanilla... But for now there's no harm in opening an issue - nothing wrong with discussion and getting institutional knowledge written down.

Alright! I guess this kind of decisions is for the active Members to handle. Closing this since it was intended.

cuberite/src/ClientHandle.cpp

Lines 1394 to 1401 in d49ce75

if (m_Player->IsGameModeSurvival())
{
World->DropBlockAsPickups(absPos, m_Player, &m_Player->GetEquippedItem());
}
else
{
World->DigBlock(absPos, m_Player);
}

The code treats getting pickups from blocks and block entities the same; this was intentional for neatness but explains the behaviour. A divergence from Vanilla is a bug, a PR to fix should never be a waste of time. In this case pushing the decision of whether to drop (based on gamemode) into DropBlockAsPickups could work well.

Not sure why I didn't reopen this when I saw your comment. Reopened now.