diff --git a/src/main/java/net/minecraftforge/client/event/RegisterParticleProvidersEvent.java b/src/main/java/net/minecraftforge/client/event/RegisterParticleProvidersEvent.java index eacb569436..4fc92d9bed 100644 --- a/src/main/java/net/minecraftforge/client/event/RegisterParticleProvidersEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RegisterParticleProvidersEvent.java @@ -7,6 +7,7 @@ package net.minecraftforge.client.event; import net.minecraft.client.particle.ParticleEngine; import net.minecraft.client.particle.ParticleProvider; +import net.minecraft.client.particle.TextureSheetParticle; import net.minecraft.core.particles.ParticleOptions; import net.minecraft.core.particles.ParticleType; import net.minecraftforge.eventbus.api.Cancelable; @@ -39,38 +40,109 @@ public class RegisterParticleProvidersEvent extends Event implements IModBusEven } /** - * Registers a ParticleProvider for a non-json-based ParticleType. - * These particles do not receive a list of texture sprites to use for rendering themselves. + *

Registers a ParticleProvider for a non-json-based ParticleType. + * These particles do not receive a list of texture sprites to use for rendering themselves.

+ * + *

There must be no particle json with an ID matching the ParticleType, + * or a redundant texture list error will occur when particle jsons load.

+ * * @param ParticleOptions used by the ParticleType and ParticleProvider. * @param type ParticleType to register a ParticleProvider for. - * There must be no particle json with an ID matching this ParticleType, - * or a redundant texture list error will occur when particle jsons load. - * @param provider ParticleProvider responsible for providing that ParticleType's particles. + * @param provider ParticleProvider function responsible for providing that ParticleType's particles. */ @SuppressWarnings("deprecation") - public void register(ParticleType type, ParticleProvider provider) - { + public void registerSpecial(ParticleType type, ParticleProvider provider) { particleEngine.register(type, provider); } + /** + *

Registers a ParticleProvider for a non-json-based ParticleType. + * These particles do not receive a list of texture sprites to use for rendering themselves.

+ * + * There must be no particle json with an ID matching the ParticleType, + * or a redundant texture list error will occur when particle jsons load.

+ * + * @param ParticleOptions used by the ParticleType and ParticleProvider. + * @param type ParticleType to register a ParticleProvider for. + * @param provider ParticleProvider function responsible for providing that ParticleType's particles. + * @see #registerSpecial + * @deprecated Renamed to {@link #registerSpecial} + */ + @Deprecated(forRemoval = true, since = "1.19.4") + public void register(ParticleType type, ParticleProvider provider) + { + registerSpecial(type, provider); + } + + /** + *

Registers a ParticleProvider for a json-based ParticleType with a single texture; + * the resulting {@link TextureSheetParticle}s will use that texture when created.

+ * + *

A particle json with an ID matching the ParticleType must exist in the particles asset folder, + * or a missing texture list error will occur when particle jsons load.

+ * + * @param ParticleOptions used by the ParticleType and Sprite function. + * @param type ParticleType to register a ParticleProvider for. + * @param sprite Sprite function responsible for providing that ParticleType's particles. + */ @SuppressWarnings("deprecation") - public void register(ParticleType type, ParticleProvider.Sprite sprite) + public void registerSprite(ParticleType type, ParticleProvider.Sprite sprite) { particleEngine.register(type, sprite); } /** - * Registers a ParticleProvider for a json-based ParticleType. - * Particle jsons define a list of texture sprites which the particle can use to render itself. - * @param ParticleOptions used by the ParticleType and ParticleProvider. + *

Registers a ParticleProvider for a json-based ParticleType with a single texture; + * the resulting {@link TextureSheetParticle}s will use that texture when created.

+ * + *

A particle json with an ID matching the ParticleType must exist in the particles asset folder, + * or a missing texture list error will occur when particle jsons load.

+ * + * @param ParticleOptions used by the ParticleType and Sprite function. * @param type ParticleType to register a ParticleProvider for. - * There must be a particle json with an ID matching this ParticleType in the particles asset folder, - * or a missing texture list error will occur when particle jsons load. - * @param registration SpriteParticleRegistration responsible for providing that ParticleType's particles. + * @param sprite Sprite function responsible for providing that ParticleType's particles. + * @see #registerSprite + * @deprecated Renamed to {@link #registerSprite} + */ + @Deprecated(forRemoval = true, since = "1.19.4") + public void register(ParticleType type, ParticleProvider.Sprite sprite) + { + registerSprite(type, sprite); + } + + /** + *

Registers a ParticleProvider for a json-based ParticleType. + * Particle jsons define a list of texture sprites which the particle can use to render itself.

+ * + *

A particle json with an ID matching the ParticleType must exist in the particles asset folder, + * or a missing texture list error will occur when particle jsons load.

+ * + * @param ParticleOptions used by the ParticleType and SpriteParticleRegistration function. + * @param type ParticleType to register a particle provider for. + * @param registration SpriteParticleRegistration function responsible for providing that ParticleType's particles. */ @SuppressWarnings("deprecation") - public void register(ParticleType type, ParticleEngine.SpriteParticleRegistration registration) + public void registerSpriteSet(ParticleType type, ParticleEngine.SpriteParticleRegistration registration) { particleEngine.register(type, registration); } + + /** + *

Registers a ParticleProvider for a json-based ParticleType. + * Particle jsons define a list of texture sprites which the particle can use to render itself.

+ * + *

A particle json with an ID matching the ParticleType must exist in the particles asset folder, + * or a missing texture list error will occur when particle jsons load.

+ * + * @param ParticleOptions used by the ParticleType and SpriteParticleRegistration function. + * @param type ParticleType to register a particle provider for. + * @param registration SpriteParticleRegistration function responsible for providing that ParticleType's particles. + * @see #registerSpriteSet + * @deprecated Renamed to {@link #registerSpriteSet} + */ + @Deprecated(forRemoval = true, since = "1.19.4") + public void register(ParticleType type, ParticleEngine.SpriteParticleRegistration registration) + { + registerSpriteSet(type, registration); + } }