86 lines
3.1 KiB
Java
86 lines
3.1 KiB
Java
package com.alttd.models;
|
|
|
|
import com.alttd.objects.APartType;
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
import lombok.Getter;
|
|
import lombok.Setter;
|
|
|
|
import java.util.Map;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* Represents the configuration data for a particle effect, including its name, type, display properties,
|
|
* animations, and permissions. This class is primarily used for managing particle data in the context
|
|
* of custom particle effects and animations.
|
|
* <p>
|
|
* Fields:
|
|
* - particleName: The unique name of the particle effect, used internally.
|
|
* - displayName: The name displayed to the user.
|
|
* - particleType: The type of the particle effect, which corresponds to an {@link APartType}.
|
|
* - lore: Additional descriptive text associated with the particle effect.
|
|
* - displayItem: An item representation for display purposes in order to visually represent the effect.
|
|
* - permission: The permission string required for accessing the particle effect.
|
|
* - packagePermission: A specific permission string linked to a grouped set of effects.
|
|
* - frameDelay: The delay between animation frames, in milliseconds.
|
|
* - repeat: The number of times the particle animation should repeat.
|
|
* - repeatDelay: The delay between repeat executions, in milliseconds.
|
|
* - randomOffset: A random position offset applied to the particle effect for variances.
|
|
* - stationary: Determines if the particle effect remains static or follows movement.
|
|
* - frames: A map defining animation frames for the particle effect. The key is an identifier, and the
|
|
* value is a list of {@link ParticleInfo} objects representing the frame's particle configuration.
|
|
* <p>
|
|
* Methods:
|
|
* - getAPartType(): Converts the particleType string field into an equivalent {@link APartType} enum value.
|
|
* This allows for accessing predefined properties of the particle type.
|
|
*/
|
|
@Setter
|
|
@Getter
|
|
public class ParticleData {
|
|
// TODO add optional property for a list of users that can use the particle
|
|
// If that list is present the particle should be loaded as a dev particle
|
|
// Dev particles should disable all others while in use and all be grouped together
|
|
// (since the dev should know what each particle is and does)
|
|
// Seeing dev particles should require a permission
|
|
@JsonProperty("user_list")
|
|
private List<String> userList;
|
|
|
|
@JsonProperty("particle_name")
|
|
private String particleName;
|
|
|
|
@JsonProperty("display_name")
|
|
private String displayName;
|
|
|
|
@JsonProperty("particle_type")
|
|
private String particleType;
|
|
|
|
private String lore;
|
|
|
|
@JsonProperty("display_item")
|
|
private String displayItem;
|
|
|
|
private String permission;
|
|
|
|
@JsonProperty("package_permission")
|
|
private String packagePermission;
|
|
|
|
@JsonProperty("frame_delay")
|
|
private int frameDelay;
|
|
|
|
private int repeat;
|
|
|
|
@JsonProperty("repeat_delay")
|
|
private int repeatDelay;
|
|
|
|
@JsonProperty("random_offset")
|
|
private double randomOffset;
|
|
|
|
private boolean stationary;
|
|
|
|
private Map<String, List<ParticleInfo>> frames;
|
|
|
|
public APartType getAPartType() {
|
|
return APartType.valueOf(particleType);
|
|
}
|
|
|
|
}
|