Skip to content

Commit

Permalink
[6.0.11][publish] Experimental > update xseries
Browse files Browse the repository at this point in the history
  • Loading branch information
Bkm016 committed Jul 17, 2023
1 parent 0a7ed12 commit 3349592
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import taboolib.common.Isolated;
import taboolib.platform.BukkitPlugin;

import java.util.*;
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -1791,7 +1792,6 @@ public static void stopMusic(@NotNull Player player) {
* Plays an instrument's notes in an ascending form.
* This method is not really relevant to this utility class, but a nice feature.
*
* @param plugin the plugin handling schedulers.
* @param player the player to play the note from.
* @param playTo the entity to play the note to.
* @param instrument the instrument.
Expand All @@ -1801,7 +1801,7 @@ public static void stopMusic(@NotNull Player player) {
* @since 2.0.0
*/
@NotNull
public static BukkitTask playAscendingNote(@NotNull Plugin plugin, @NotNull Player player, @NotNull Entity playTo, @NotNull Instrument instrument,
public static BukkitTask playAscendingNote(@NotNull Player player, @NotNull Entity playTo, @NotNull Instrument instrument,
int ascendLevel, int delay) {
Objects.requireNonNull(player, "Cannot play note from null player");
Objects.requireNonNull(playTo, "Cannot play note to null entity");
Expand All @@ -1818,7 +1818,7 @@ public void run() {
player.playNote(playTo.getLocation(), instrument, Note.natural(1, Note.Tone.values()[ascendLevel - repeating]));
if (repeating-- == 0) cancel();
}
}.runTaskTimerAsynchronously(plugin, 0, delay);
}.runTaskTimerAsynchronously(BukkitPlugin.getInstance(), 0, delay);
}

/**
Expand Down Expand Up @@ -1863,7 +1863,6 @@ public boolean isSupported() {
/**
* Plays a sound repeatedly with the given delay at a moving target's location.
*
* @param plugin the plugin handling schedulers. (You can replace this with a static instance)
* @param entity the entity to play the sound to. We exactly need an entity to keep the track of location changes.
* @param volume the volume of the sound.
* @param pitch the pitch of the sound.
Expand All @@ -1874,14 +1873,13 @@ public boolean isSupported() {
* @since 2.0.0
*/
@NotNull
public BukkitTask playRepeatedly(@NotNull Plugin plugin, @NotNull Entity entity, float volume, float pitch, int repeat, int delay) {
return playRepeatedly(plugin, Collections.singleton(entity), volume, pitch, repeat, delay);
public BukkitTask playRepeatedly(@NotNull Entity entity, float volume, float pitch, int repeat, int delay) {
return playRepeatedly(Collections.singleton(entity), volume, pitch, repeat, delay);
}

/**
* Plays a sound repeatedly with the given delay at moving targets' locations.
*
* @param plugin the plugin handling schedulers. (You can replace this with a static instance)
* @param entities the entities to play the sound to. We exactly need the entities to keep the track of location changes.
* @param volume the volume of the sound.
* @param pitch the pitch of the sound.
Expand All @@ -1892,8 +1890,7 @@ public BukkitTask playRepeatedly(@NotNull Plugin plugin, @NotNull Entity entity,
* @since 2.0.0
*/
@NotNull
public BukkitTask playRepeatedly(@NotNull Plugin plugin, @NotNull Iterable<? extends Entity> entities, float volume, float pitch, int repeat, int delay) {
Objects.requireNonNull(plugin, "Cannot play repeating sound from null plugin");
public BukkitTask playRepeatedly(@NotNull Iterable<? extends Entity> entities, float volume, float pitch, int repeat, int delay) {
Objects.requireNonNull(entities, "Cannot play repeating sound at null locations");

if (repeat <= 0) throw new IllegalArgumentException("Cannot repeat playing sound " + repeat + " times");
Expand All @@ -1910,7 +1907,7 @@ public void run() {

if (repeating-- == 0) cancel();
}
}.runTaskTimer(plugin, 0, delay);
}.runTaskTimer(BukkitPlugin.getInstance(), 0, delay);
}

/**
Expand Down

0 comments on commit 3349592

Please sign in to comment.