Skip to content

Commit 3349592

Browse files
committed
[6.0.11][publish] Experimental > update xseries
1 parent 0a7ed12 commit 3349592

File tree

1 file changed

+7
-10
lines changed
  • platform/platform-bukkit/src/main/java/taboolib/library/xseries

1 file changed

+7
-10
lines changed

platform/platform-bukkit/src/main/java/taboolib/library/xseries/XSound.java

+7-10
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.jetbrains.annotations.NotNull;
3636
import org.jetbrains.annotations.Nullable;
3737
import taboolib.common.Isolated;
38+
import taboolib.platform.BukkitPlugin;
3839

3940
import java.util.*;
4041
import java.util.concurrent.CompletableFuture;
@@ -1791,7 +1792,6 @@ public static void stopMusic(@NotNull Player player) {
17911792
* Plays an instrument's notes in an ascending form.
17921793
* This method is not really relevant to this utility class, but a nice feature.
17931794
*
1794-
* @param plugin the plugin handling schedulers.
17951795
* @param player the player to play the note from.
17961796
* @param playTo the entity to play the note to.
17971797
* @param instrument the instrument.
@@ -1801,7 +1801,7 @@ public static void stopMusic(@NotNull Player player) {
18011801
* @since 2.0.0
18021802
*/
18031803
@NotNull
1804-
public static BukkitTask playAscendingNote(@NotNull Plugin plugin, @NotNull Player player, @NotNull Entity playTo, @NotNull Instrument instrument,
1804+
public static BukkitTask playAscendingNote(@NotNull Player player, @NotNull Entity playTo, @NotNull Instrument instrument,
18051805
int ascendLevel, int delay) {
18061806
Objects.requireNonNull(player, "Cannot play note from null player");
18071807
Objects.requireNonNull(playTo, "Cannot play note to null entity");
@@ -1818,7 +1818,7 @@ public void run() {
18181818
player.playNote(playTo.getLocation(), instrument, Note.natural(1, Note.Tone.values()[ascendLevel - repeating]));
18191819
if (repeating-- == 0) cancel();
18201820
}
1821-
}.runTaskTimerAsynchronously(plugin, 0, delay);
1821+
}.runTaskTimerAsynchronously(BukkitPlugin.getInstance(), 0, delay);
18221822
}
18231823

18241824
/**
@@ -1863,7 +1863,6 @@ public boolean isSupported() {
18631863
/**
18641864
* Plays a sound repeatedly with the given delay at a moving target's location.
18651865
*
1866-
* @param plugin the plugin handling schedulers. (You can replace this with a static instance)
18671866
* @param entity the entity to play the sound to. We exactly need an entity to keep the track of location changes.
18681867
* @param volume the volume of the sound.
18691868
* @param pitch the pitch of the sound.
@@ -1874,14 +1873,13 @@ public boolean isSupported() {
18741873
* @since 2.0.0
18751874
*/
18761875
@NotNull
1877-
public BukkitTask playRepeatedly(@NotNull Plugin plugin, @NotNull Entity entity, float volume, float pitch, int repeat, int delay) {
1878-
return playRepeatedly(plugin, Collections.singleton(entity), volume, pitch, repeat, delay);
1876+
public BukkitTask playRepeatedly(@NotNull Entity entity, float volume, float pitch, int repeat, int delay) {
1877+
return playRepeatedly(Collections.singleton(entity), volume, pitch, repeat, delay);
18791878
}
18801879

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

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

19111908
if (repeating-- == 0) cancel();
19121909
}
1913-
}.runTaskTimer(plugin, 0, delay);
1910+
}.runTaskTimer(BukkitPlugin.getInstance(), 0, delay);
19141911
}
19151912

19161913
/**

0 commit comments

Comments
 (0)