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

Method ShiftClicked

src/UI/SlotArea.cpp:177–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175
176
177void cSlotArea::ShiftClicked(cPlayer & a_Player, int a_SlotNum, const cItem & a_ClickedItem)
178{
179 // Make a copy of the slot, distribute it among the other areas, then update the slot to contain the leftover:
180 cItem Slot(*GetSlot(a_SlotNum, a_Player));
181 m_ParentWindow.DistributeStack(Slot, a_Player, this, true);
182 if (Slot.IsEmpty())
183 {
184 // Empty the slot completely, the cilent doesn't like left-over ItemType with zero count
185 Slot.Empty();
186 }
187 SetSlot(a_SlotNum, a_Player, Slot);
188
189 // Some clients try to guess our actions and not always right (armor slots in 1.2.5), so we fix them:
190 m_ParentWindow.BroadcastWholeWindow();
191}
192
193
194

Callers

nothing calls this directly

Calls 4

EmptyMethod · 0.80
BroadcastWholeWindowMethod · 0.80
DistributeStackMethod · 0.45
IsEmptyMethod · 0.45

Tested by

no test coverage detected