Moved Send() to DebugPotato, from DPAPI

Moved DebugPotatoAPI.sendDebugPotato() to DebugPotato.send(), and
deprecated DebugPotatoAPI. Changed TBMCCoreAPI to reflect the
deprecation
This commit is contained in:
alisolarflare 2016-11-21 13:29:40 -05:00
parent 9b645bce07
commit 272068d39f
3 changed files with 11 additions and 7 deletions

View file

@ -21,7 +21,8 @@ public class DebugPotato {
* The player
*/
public void Send(Player player){
DebugPotatoAPI.SendDebugPotato(this, player);
player.getInventory().addItem(this.toItemStack());
return;
}
/**

View file

@ -2,7 +2,10 @@ package buttondevteam.lib;
import org.bukkit.entity.Player;
/**@deprecated
* Fully Replaced by DebugPotato Class - Construct a DebugPotato*/
public class DebugPotatoAPI {
/**@deprecated Replaced by DebugPotato.send*/
public static void SendDebugPotato(DebugPotato dp, Player player) {
player.getInventory().addItem(dp.toItemStack());
return;

View file

@ -152,16 +152,16 @@ public final class TBMCCoreAPI {
Bukkit.getLogger().warning(sourcemsg);
e.printStackTrace();
Optional<? extends Player> randomPlayer = Bukkit.getOnlinePlayers().stream().findAny();
if (randomPlayer.isPresent())
DebugPotatoAPI.SendDebugPotato(
new DebugPotato()
if (randomPlayer.isPresent()){
DebugPotato potato = new DebugPotato()
.setMessage(new String[] { //
"§b§o" + potatoMessages[new Random().nextInt(potatoMessages.length)], //
"§c§o" + sourcemsg, //
"§a§oFind a dev to fix this issue" })
.setType(e instanceof IOException ? "Potato on a Stick"
: e instanceof ClassCastException ? "Square Potato" : "Plain Potato"),
randomPlayer.get());
: e instanceof ClassCastException ? "Square Potato" : "Plain Potato");
potato.Send(randomPlayer.get());
}
}
/**