Skip to content

Commit

Permalink
Update ActionBarUtils.java
Browse files Browse the repository at this point in the history
  • Loading branch information
CustomEntity authored Jul 8, 2020
1 parent 2817fcc commit 82e7211
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ActionBarUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
*/
public class ActionBarUtils {

private JavaPlugin plugin;
private static String nmsver;
private static boolean useOldMethods = false;
private static boolean isSuperior1_16Ver = false;

public ActionBarUtils(JavaPlugin plugin) {
public ActionBarUtils() {
nmsver = Bukkit.getServer().getClass().getPackage().getName();
nmsver = nmsver.substring(nmsver.lastIndexOf(".") + 1);

Expand All @@ -33,7 +32,6 @@ public ActionBarUtils(JavaPlugin plugin) {
if(nmsver.equalsIgnoreCase("v1_16_R1")) {
isSuperior1_16Ver = true;
}
this.plugin = plugin;
}

public static void sendActionBar(Player player, String message) {
Expand Down Expand Up @@ -95,7 +93,7 @@ public static void sendActionBar(final Player player, final String message, int
public void run() {
sendActionBar(player, "");
}
}.runTaskLater(plugin, duration + 1);
}.runTaskLater(yourPluginInstance, duration + 1);
}

while (duration > 40) {
Expand All @@ -105,7 +103,7 @@ public void run() {
public void run() {
sendActionBar(player, message);
}
}.runTaskLater(plugin, (long) duration);
}.runTaskLater(yourPluginInstance, (long) duration);
}
}

Expand Down

0 comments on commit 82e7211

Please sign in to comment.