This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Former-commit-id: 33618ff
- Loading branch information
xishift
committed
Jul 15, 2020
1 parent
59c6078
commit aa362de
Showing
15 changed files
with
147 additions
and
84 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/main/java/me/ishift/epicguard/bukkit/BukkitMethods.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package me.ishift.epicguard.bukkit; | ||
|
||
import me.ishift.epicguard.bukkit.util.Reflections; | ||
import me.ishift.epicguard.core.util.MethodInterface; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
|
||
import java.util.UUID; | ||
import java.util.logging.Logger; | ||
|
||
public class BukkitMethods implements MethodInterface { | ||
private final JavaPlugin plugin; | ||
|
||
public BukkitMethods(JavaPlugin plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
@Override | ||
public void sendActionBar(String message, UUID target) { | ||
Reflections.sendActionBar(Bukkit.getPlayer(target), message + " &8░ &7TPS: &6" + Reflections.getTPS()); | ||
} | ||
|
||
@Override | ||
public Logger getLogger() { | ||
return this.plugin.getLogger(); | ||
} | ||
|
||
@Override | ||
public String getVersion() { | ||
return this.plugin.getDescription().getVersion(); | ||
} | ||
|
||
@Override | ||
public void scheduleSyncTask(Runnable task, long seconds) { | ||
Bukkit.getScheduler().runTaskTimer(this.plugin, task, 20L, seconds * 20L); | ||
} | ||
|
||
@Override | ||
public void scheduleAsyncTask(Runnable task, long seconds) { | ||
Bukkit.getScheduler().runTaskTimerAsynchronously(this.plugin, task, 20L, seconds * 20L); | ||
} | ||
} |
15 changes: 0 additions & 15 deletions
15
src/main/java/me/ishift/epicguard/bukkit/BukkitNotificator.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/me/ishift/epicguard/bungee/BungeeMethods.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package me.ishift.epicguard.bungee; | ||
|
||
import me.ishift.epicguard.core.util.ChatUtils; | ||
import me.ishift.epicguard.core.util.MethodInterface; | ||
import net.md_5.bungee.api.ChatMessageType; | ||
import net.md_5.bungee.api.ProxyServer; | ||
import net.md_5.bungee.api.chat.TextComponent; | ||
import net.md_5.bungee.api.plugin.Plugin; | ||
|
||
import java.util.UUID; | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.logging.Logger; | ||
|
||
public class BungeeMethods implements MethodInterface { | ||
private final Plugin plugin; | ||
|
||
public BungeeMethods(Plugin plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
@Override | ||
public void sendActionBar(String message, UUID target) { | ||
ProxyServer.getInstance().getPlayer(target).sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(ChatUtils.colored(message))); | ||
} | ||
|
||
@Override | ||
public Logger getLogger() { | ||
return this.plugin.getLogger(); | ||
} | ||
|
||
@Override | ||
public String getVersion() { | ||
return this.plugin.getDescription().getVersion(); | ||
} | ||
|
||
@Override | ||
public void scheduleSyncTask(Runnable task, long seconds) { | ||
this.plugin.getProxy().getScheduler().schedule(this.plugin, task, seconds, TimeUnit.SECONDS); | ||
} | ||
|
||
@Override | ||
public void scheduleAsyncTask(Runnable task, long seconds) { | ||
// There are no async repeating tasks in BungeeCord | ||
this.scheduleSyncTask(task, seconds); | ||
} | ||
} |
16 changes: 0 additions & 16 deletions
16
src/main/java/me/ishift/epicguard/bungee/BungeeNotificator.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/me/ishift/epicguard/core/util/MethodInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package me.ishift.epicguard.core.util; | ||
|
||
import java.util.UUID; | ||
import java.util.logging.Logger; | ||
|
||
public interface MethodInterface { | ||
void sendActionBar(String message, UUID target); | ||
|
||
Logger getLogger(); | ||
|
||
String getVersion(); | ||
|
||
void scheduleSyncTask(Runnable task, long seconds); | ||
|
||
void scheduleAsyncTask(Runnable task, long seconds); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.