dmulloy2 / ProtocolLib

Provides read and write access to the Minecraft protocol with Bukkit.
GNU General Public License v2.0
1.03k stars 257 forks source link

`WrappedDataWatcher` entry for `PARTICLES` (note - plural) #3137

Open AffectedArc07 opened 3 months ago

AffectedArc07 commented 3 months ago

Is your feature request related to a problem? Please describe. 1.21 bought about a PARTICLES list in the entity metadata - instead of just a varint for the colour of user particles, its now a list inside the datawatcher (index 10 on LivingEntity).

This currently makes wrapping the watcher nigh-impossible as nothing else in the WDW uses lists.

Describe the solution you'd like A wrapped for PARTICLES.

Describe alternatives you've considered No idea - if we get a generic Array type on WDWs then we might be able to re-use the existing PARTICLE serialiser, not sure.

Additional context NMS LivingEntity

private static final EntityDataAccessor<List<ParticleOptions>> DATA_EFFECT_PARTICLES = SynchedEntityData.defineId(LivingEntity.class, EntityDataSerializers.PARTICLES);

NMS Data Serialiser

    public static final EntityDataSerializer<List<ParticleOptions>> PARTICLES = EntityDataSerializer.forValueType(
        ParticleTypes.STREAM_CODEC.apply(ByteBufCodecs.list())
    );
AffectedArc07 commented 3 months ago

@dmulloy2 do you do bounties in this project?