Many things changed between 3.x.x and 4.x.x versions.
For some short time I'll try to maintain 3.x.x version to give some time
for migration (few months I think).
At least I hope it will be possible because lately
there were many irritating internal MC changes that I barely
made backward compatible (I'm looking at you, LIGHT
and VIBRATION
particle).
- Important changes to keep in mind
- General tips
ParticleNativeAPI
Particles_X
related classesServerConnection
andPlayerConnection
ParticleType
related classes
- methods annotated with
@Shared
annotation returns ONE AND THE SAME instance with changed internal state for memory efficiency- to make independent copy of such object, use
detachCopy()
(for example packet caching)
- to make independent copy of such object, use
- classes in API have been moved around some packages or slightly renamed
- I think it is better to remove imports and include them again
- general usage flow has changed (for better, no more
Object
NMS Packet)- see how-to-use.md for details about it
- it is now abstract class instead of interface
- now has particle lists in fields instead of getter methods
- renamed to
ParticleList_X
- they are now abstract classes instead of interfaces
- now have particles in fields instead of getter methods
- they are removed
- replaced by
ParticlePacket
returned by particle types - now there is no way to send any NMS
Packet
- that previous opportunity was due to how packet sending was structured
- instead, it is now much easier to send packets
using
ParticlePacket
in method chain - methods sending in radius are slightly changed for performance reasons
- now they accept list of players instead of
Location
because packet position is now stored inParticlePacket
- this was changed because
Location -> getWorld() -> getPlayers()
creates new list on each call which I didn't account for, lol
- now they accept list of players instead of
- they are now interfaces
- their base implementation is in
core
module and are basically the same as previous ones that were inapi
module
- their base implementation is in
isValid
method- renamed to
isPresent
- renamed to
packet
methods now returnParticlePacket
instead ofObject
that was literally NMSPacket
- returned object is ONE AND THE SAME instance with changed
wrapped NMS
Packet
- (IMPORTANT) if you were caching them somewhere,
call
detachCopy()
on them before storing them somewhere in lists, fields etc.
- returned object is ONE AND THE SAME instance with changed
wrapped NMS
- methods selecting particle properties of complex particle type
now returns ONE AND THE SAME instance of particle type
with changed internal state
- (IMPORTANT) if you were caching them somewhere,
call
detachCopy()
on them before storing them somewhere in fields etc.
- (IMPORTANT) if you were caching them somewhere,
call
ParticleTypeVibration
- renamed to
ParticleTypeVibrationSingle
because it can only spawn one particle- this is due to how badly it is implemented by MC in 1.17 and 1.18
- it is compatible with MC 1.19 upwards but limited to one particle
- a better alternative is
ParticleTypeVibration
which starts from MC 1.19 and allows spawning particles in traditional way usingParticleType
- renamed to