Player::Player(const char *name, IItemDefManager *idef):
- camera_barely_in_ceiling(false),
- inventory(idef),
- hp(PLAYER_MAX_HP),
- peer_id(PEER_ID_INEXISTENT),
- keyPressed(0),
-// protected
- m_breath(PLAYER_MAX_BREATH),
- m_pitch(0),
- m_yaw(0),
- m_speed(0,0,0),
- m_position(0,0,0),
- m_collisionbox(-BS*0.30,0.0,-BS*0.30,BS*0.30,BS*1.75,BS*0.30)
+ inventory(idef)
{
strlcpy(m_name, name, PLAYERNAME_SIZE);
inventory.clear();
inventory.addList("main", PLAYER_INVENTORY_SIZE);
+ inventory.addList("hand", 1);
InventoryList *craft = inventory.addList("craft", 9);
craft->setWidth(3);
inventory.addList("craftpreview", 1);
hud_flags =
HUD_FLAG_HOTBAR_VISIBLE | HUD_FLAG_HEALTHBAR_VISIBLE |
HUD_FLAG_CROSSHAIR_VISIBLE | HUD_FLAG_WIELDITEM_VISIBLE |
- HUD_FLAG_BREATHBAR_VISIBLE | HUD_FLAG_MINIMAP_VISIBLE;
+ HUD_FLAG_BREATHBAR_VISIBLE | HUD_FLAG_MINIMAP_VISIBLE |
+ HUD_FLAG_MINIMAP_RADAR_VISIBLE;
hud_hotbar_itemcount = HUD_HOTBAR_ITEMCOUNT_DEFAULT;
}
clearHud();
}
-v3s16 Player::getLightPosition() const
-{
- return floatToInt(m_position + v3f(0,BS+BS/2,0), BS);
-}
-
u32 Player::addHud(HudElement *toadd)
{
MutexAutoLock lock(m_mutex);