Skip to content

Commit

Permalink
Add missing particle options (#2477)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImMorpheus authored Nov 17, 2023
1 parent fe7d8de commit f578181
Showing 1 changed file with 40 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.spongepowered.api.registry.RegistryTypes;
import org.spongepowered.api.util.Color;
import org.spongepowered.api.util.Direction;
import org.spongepowered.api.util.Ticks;
import org.spongepowered.math.vector.Vector3d;

/**
Expand Down Expand Up @@ -74,21 +75,21 @@ public final class ParticleOptions {
*/
public static final DefaultedRegistryReference<ParticleOption<Color>> COLOR = ParticleOptions.key(ResourceKey.sponge("color"));

/**
* This option will affect the delay of particles that are spawned.
* The only vanilla {@link ParticleType}s this option isn't applicable to are:
*
* <ul>
* <li>{@link ParticleTypes#SHRIEK}</li>
* </ul>
*/
public static final DefaultedRegistryReference<ParticleOption<Integer>> DELAY = ParticleOptions.key(ResourceKey.sponge("delay"));

/**
* This option will change the direction of a particle.
*/
public static final DefaultedRegistryReference<ParticleOption<Direction>> DIRECTION = ParticleOptions.key(ResourceKey.sponge("direction"));

// /** TODO
// * This option will modify the color of a particle. The only vanilla
// * {@link ParticleType}s this option is applicable to is
// * {@link ParticleTypes#FIREWORKS}.
// *
// * <p>The {@link List} may never be empty. Or a {@link IllegalArgumentException}
// * will be thrown when applying.</p>
// */
// public static final Supplier<ParticleOption<List<FireworkEffect>>> FIREWORK_EFFECTS = Sponge.getRegistry().getCatalogRegistry().provideSupplier(ParticleOption.class, "firework_effects");

/**
* This option will affect the appearance of a particle. The only vanilla
* {@link ParticleType} this option is applicable to are:
Expand All @@ -101,13 +102,6 @@ public final class ParticleOptions {
*/
public static final DefaultedRegistryReference<ParticleOption<ItemStackSnapshot>> ITEM_STACK_SNAPSHOT = ParticleOptions.key(ResourceKey.sponge("item_stack_snapshot"));

// /** TODO
// * This option will affect the appearance of a particle. The only vanilla
// * {@link ParticleType} this option is applicable to is
// * {@link ParticleTypes#NOTE}.
// */
// public static final Supplier<ParticleOption<NotePitch>> NOTE = Sponge.getRegistry().getCatalogRegistry().provideSupplier(ParticleOption.class, "note");

/**
* This option will affect how all the particles are spread.
*/
Expand All @@ -134,6 +128,16 @@ public final class ParticleOptions {
*/
public static final DefaultedRegistryReference<ParticleOption<Integer>> QUANTITY = ParticleOptions.key(ResourceKey.sponge("quantity"));

/**
* This option will change the roll of a particle. The only
* vanilla {@link ParticleType}s this option is applicable to is:
*
* <ul>
* <li>{@link ParticleTypes#SCULK_CHARGE}</li>
* </ul>
*/
public static final DefaultedRegistryReference<ParticleOption<Double>> ROLL = ParticleOptions.key(ResourceKey.sponge("roll"));

/**
* This option will change the scale of a particle. The only
* vanilla {@link ParticleType}s this option is applicable to is:
Expand All @@ -147,21 +151,25 @@ public final class ParticleOptions {
*/
public static final DefaultedRegistryReference<ParticleOption<Double>> SCALE = ParticleOptions.key(ResourceKey.sponge("scale"));

// /** TODO
// * This option will affect whether a particle type will have a lower
// * velocity in the horizontal plane. The only vanilla {@link ParticleType}s
// * that this option will affect are:
// *
// * <ul>
// * <li>{@link ParticleTypes#EFFECT}</li>
// * <li>{@link ParticleTypes#INSTANT_EFFECT}</li>
// * <li>{@link ParticleTypes#WITCH_MAGIC}</li>
// * </ul>
// *
// * <p>These particle types don't have a configurable velocity (through
// * {@link #VELOCITY}) in the horizontal plane.</p>
// */
// public static final Supplier<ParticleOption<Boolean>> SLOW_HORIZONTAL_VELOCITY = Sponge.getRegistry().getCatalogRegistry().provideSupplier(ParticleOption.class, "slow_horizontal_velocity");
/**
* This option will change the color the transition particle will change to.
* The only vanilla {@link ParticleType}s this option is applicable to is:
*
* <ul>
* <li>{@link ParticleTypes#DUST_COLOR_TRANSITION}</li>
* </ul>
*/
public static final DefaultedRegistryReference<ParticleOption<Color>> TO_COLOR = ParticleOptions.key(ResourceKey.sponge("to_color"));

/**
* This option will change the travel time of a particle.
* The only vanilla {@link ParticleType}s this option is applicable to is:
*
* <ul>
* <li>{@link ParticleTypes#VIBRATION}</li>
* </ul>
*/
public static final DefaultedRegistryReference<ParticleOption<Ticks>> TRAVEL_TIME = ParticleOptions.key(ResourceKey.sponge("travel_time"));

/**
* This option will affect how most particles are moving.
Expand Down

0 comments on commit f578181

Please sign in to comment.