MCPcopy Create free account
hub / github.com/cuberite/cuberite / HandleCreativeInventory

Method HandleCreativeInventory

src/ClientHandle.cpp:450–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448
449
450void cClientHandle::HandleCreativeInventory(short a_SlotNum, const cItem & a_HeldItem)
451{
452 // This is for creative Inventory changes
453 if (!m_Player->IsGameModeCreative())
454 {
455 LOGWARNING("Got a CreativeInventoryAction packet from user \"%s\" while not in creative mode. Ignoring.", m_Username.c_str());
456 return;
457 }
458 if (m_Player->GetWindow()->GetWindowType() != cWindow::wtInventory)
459 {
460 LOGWARNING("Got a CreativeInventoryAction packet from user \"%s\" while not in the inventory window. Ignoring.", m_Username.c_str());
461 return;
462 }
463
464 m_Player->GetWindow()->Clicked(*m_Player, 0, a_SlotNum, (a_SlotNum >= 0) ? caLeftClick : caLeftClickOutside, a_HeldItem);
465}
466
467
468

Calls 5

c_strMethod · 0.80
GetWindowTypeMethod · 0.80
IsGameModeCreativeMethod · 0.45
GetWindowMethod · 0.45
ClickedMethod · 0.45

Tested by

no test coverage detected