Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
TaskManager#startWorldTask
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteZ1337 committed Sep 13, 2021
1 parent 48d3af5 commit b431362
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/java/xyz/xenondevs/particle/ParticlePacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ public Object createPacket(Location location) {

/**
* Creates a new packet for particles that don't need any extra checks.
* <p>
* <b>Note: This method does not check if the given particle and
* data match!</b>
*
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/xyz/xenondevs/particle/PropertyType.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

package xyz.xenondevs.particle;

import xyz.xenondevs.particle.data.color.DustColorTransitionData;
import xyz.xenondevs.particle.data.color.DustData;
import xyz.xenondevs.particle.data.color.RegularColor;

/**
Expand Down Expand Up @@ -89,6 +91,8 @@ public enum PropertyType {
* A dust particle accepts a custom color and a custom size (between 0-4). Please note that
* this {@link PropertyType} is not supported on pre 1.13 servers.
*
* @see DustData
* @see DustColorTransitionData
* @see RegularColor
* @see ParticleEffect#REDSTONE
* @see ParticleEffect#DUST_COLOR_TRANSITION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import java.awt.*;

/**
* The DustData class hols information on the colors
* The DustData class holds information on the colors
* and size of various dust particles. The standard
* implementation below supports a custom color and
* size. If you're looking for Transitioning colors
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/xyz/xenondevs/particle/task/TaskManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package xyz.xenondevs.particle.task;

import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Player;
import xyz.xenondevs.particle.utils.ParticleUtils;
import xyz.xenondevs.particle.utils.ReflectionUtils;
Expand Down Expand Up @@ -101,6 +102,20 @@ public static int startGlobalTask(List<Object> packets, int tickDelay) {
return getTaskManager().startTask(new GlobalTask(packets, tickDelay));
}

/**
* Starts a new {@link WorldTask}.
*
* @param packets {@link List} of packets
* @param tickDelay The delay of ticks between each execution
* @param world The target {@link World}
* @return the id of the BukkitTask which can be cancelled using {@link TaskManager#stopTask(int)}
* @see WorldTask
* @see TaskManager#stopTask(int)
*/
public static int startWorldTask(List<Object> packets, int tickDelay, World world) {
return getTaskManager().startTask(new WorldTask(packets, tickDelay, world));
}

/**
* Starts a new {@link TargetedTask}.
*
Expand Down
1 change: 0 additions & 1 deletion src/main/java/xyz/xenondevs/particle/utils/MathUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public static int generateRandomInteger(int minimum, int maximum) {
return minimum + (int) (RANDOM.nextDouble() * ((maximum - minimum) + 1));
}


/**
* Checks if a specific {@link Integer} is in the given range.
* If not the respective bound of the range is returned.
Expand Down

0 comments on commit b431362

Please sign in to comment.