Cuberite Forum
Packets - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: Packets (/thread-822.html)



Packets - NiLSPACE - 03-09-2013

I'm not realy familiar with packets but is it possible to do for example:
World:SendPacket(PACKET_SOUND_PARTICLE_EFFECT, 2000*, BlockX, BlockY, BlockZ)
*2000 is the fire particle
to spawn smoke particles at a point?


RE: Packets - xoft - 03-09-2013

Currently, no. It is planned that some packets may be available to plugins, but only a handful, such as the plugin channel message or the scoreboard (when I find out what it does Wink )

To make things more complicated, MCServer is trying to walk away from these cryptic functions (see, you yourself had to put a note underneath it saying what it does) towards more friendly names. So we have cProtocol::SendSpawnObject() and cProtocol::SendSpawnVehicle() functions, although they both use the same packet. This might come in handy if ever the protocol decides to spawn vehicles in a different way than "objects", but it's also handy in how people reading the code immediately know what the function does, instead of looking up parameters for packets.


RE: Packets - NiLSPACE - 03-29-2013

then is there a way to spawn:
  • lightning
  • Particles of any kind
  • Sounds



RE: Packets - bearbin - 03-29-2013

Do you mean lightning?


RE: Packets - NiLSPACE - 03-29-2013

(03-29-2013, 02:58 AM)bearbin Wrote: Do you mean lightning?

yea sorry. Wink


RE: Packets - xoft - 03-29-2013

Lightning: cWorld:CastThunderbolt(BlockX, BlockY, BlockZ);
Particles: not available to plugins yet; C++ uses cWorld::BroadcastSoundParticleEffect()
Sounds: not available to plugins yet; C++ uses cWorld::BroadcastSoundEffect() or cWorld::BroadcastSoundParticleEffect() (depending on the sound)


RE: Packets - NiLSPACE - 03-29-2013

thanks but maybe something to note is that i just found out that CastThunderbolt doesn't make any sound.


RE: Packets - xoft - 03-29-2013

I'm not sure whether that's a bad thing or a good thing. Imagine a plugin wants to cast thunderbolts with different sound / no sound at all. This way it'd be possible (when sounds are exported to API)

Definitely good to mention that in the documentation, though.