2017-02-15 22:05:50 -07:00
|
|
|
/**
|
2018-02-25 20:55:34 -07:00
|
|
|
* Copyright Esophose 2018
|
2017-02-15 22:05:50 -07:00
|
|
|
* While using any of the code provided by this plugin
|
|
|
|
* you must not claim it as your own. This plugin may
|
|
|
|
* be modified and installed on a server, but may not
|
|
|
|
* be distributed to any person by any means.
|
|
|
|
*/
|
|
|
|
|
2018-02-26 01:36:14 -07:00
|
|
|
package com.esophose.playerparticles.particles;
|
2017-02-15 22:05:50 -07:00
|
|
|
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
import org.bukkit.Bukkit;
|
|
|
|
import org.bukkit.Location;
|
|
|
|
import org.bukkit.World;
|
|
|
|
|
|
|
|
public class FixedParticleEffect {
|
|
|
|
|
2018-02-25 21:24:22 -07:00
|
|
|
/**
|
|
|
|
* The UUID of the player who owns this effect
|
|
|
|
*/
|
|
|
|
private UUID pplayerUUID;
|
2017-02-15 22:05:50 -07:00
|
|
|
|
2018-02-25 21:24:22 -07:00
|
|
|
/**
|
|
|
|
* The ID of this effect, unique to the owner's UUID
|
|
|
|
*/
|
|
|
|
private int id;
|
2017-02-15 22:05:50 -07:00
|
|
|
|
2018-02-25 21:24:22 -07:00
|
|
|
/**
|
|
|
|
* The location for this effect to be displayed
|
|
|
|
*/
|
|
|
|
private Location location;
|
2017-02-15 22:05:50 -07:00
|
|
|
|
2018-02-25 21:24:22 -07:00
|
|
|
/**
|
|
|
|
* The effect and style this effect uses
|
|
|
|
*/
|
2018-09-23 20:42:52 -06:00
|
|
|
private ParticlePair particlePair;
|
2018-02-25 21:24:22 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructs a new FixedParticleEffect
|
|
|
|
* FixedParticleEffects can NOT use custom handled styles
|
|
|
|
*
|
|
|
|
* @param pplayerUUID The UUID of the player who owns the effect
|
|
|
|
* @param id The id this effect has, unique to the owner pplayer
|
|
|
|
* @param worldName The world name this effect will be displayed in
|
|
|
|
* @param xPos The X position in the world
|
|
|
|
* @param yPos The Y position in the world
|
|
|
|
* @param zPos The Z position in the world
|
2018-09-23 20:42:52 -06:00
|
|
|
* @param particlePair The ParticlePair that represents this FixedParticleEffect's appearance
|
2018-02-25 21:24:22 -07:00
|
|
|
*/
|
2018-09-23 20:42:52 -06:00
|
|
|
public FixedParticleEffect(UUID pplayerUUID, int id, String worldName, double xPos, double yPos, double zPos, ParticlePair particlePair) {
|
2018-02-25 21:24:22 -07:00
|
|
|
this.pplayerUUID = pplayerUUID;
|
|
|
|
this.id = id;
|
2018-09-23 20:42:52 -06:00
|
|
|
this.particlePair = particlePair;
|
2018-02-25 21:24:22 -07:00
|
|
|
|
|
|
|
World world = Bukkit.getWorld(worldName);
|
|
|
|
if (world == null) { // Default to the first world in case it doesn't exist
|
|
|
|
world = Bukkit.getWorlds().get(0); // All servers will have at least one world
|
|
|
|
}
|
|
|
|
|
|
|
|
this.location = new Location(world, xPos, yPos, zPos);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the owner of the effect's UUID
|
|
|
|
*
|
|
|
|
* @return The owner of the effect's UUID
|
|
|
|
*/
|
|
|
|
public UUID getOwnerUniqueId() {
|
|
|
|
return this.pplayerUUID;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the id unique to the owner's UUID
|
|
|
|
*
|
|
|
|
* @return This effect's id
|
|
|
|
*/
|
|
|
|
public int getId() {
|
|
|
|
return this.id;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-09-23 20:42:52 -06:00
|
|
|
* Gets the ParticlePair, which contains all spawn information about this fixed effect
|
2018-02-25 21:24:22 -07:00
|
|
|
*
|
2018-09-23 20:42:52 -06:00
|
|
|
* @return The ParticlePair that represents this FixedParticleEffect's appearance
|
2018-02-25 21:24:22 -07:00
|
|
|
*/
|
2018-09-23 20:42:52 -06:00
|
|
|
public ParticlePair getParticlePair() {
|
|
|
|
return this.particlePair;
|
2018-02-25 21:24:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the location this effect will be displayed at
|
|
|
|
*
|
|
|
|
* @return The effect's location
|
|
|
|
*/
|
|
|
|
public Location getLocation() {
|
|
|
|
return this.location.clone();
|
|
|
|
}
|
2017-02-15 22:05:50 -07:00
|
|
|
|
|
|
|
}
|