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

Method SendWindowOpen

src/Protocol/Protocol16x.cpp:170–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168
169
170void cProtocol161::SendWindowOpen(const cWindow & a_Window)
171{
172 if (a_Window.GetWindowType() < 0)
173 {
174 // Do not send for inventory windows
175 return;
176 }
177 cCSLock Lock(m_CSPacket);
178 WriteByte (PACKET_WINDOW_OPEN);
179 WriteChar (a_Window.GetWindowID());
180 WriteByte ((Byte)a_Window.GetWindowType());
181 WriteString(a_Window.GetWindowTitle());
182 WriteByte ((Byte)a_Window.GetNumNonInventorySlots());
183 WriteByte (1); // Use title
184 if (a_Window.GetWindowType() == cWindow::wtAnimalChest)
185 {
186 WriteInt(0); // TODO: The animal's EntityID
187 }
188 Flush();
189}
190
191
192

Callers 1

OpenedByPlayerMethod · 0.45

Calls 3

GetWindowTypeMethod · 0.80
GetWindowIDMethod · 0.80

Tested by

no test coverage detected