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:
parent
9b645bce07
commit
272068d39f
3 changed files with 11 additions and 7 deletions
|
@ -20,8 +20,9 @@ public class DebugPotato {
|
||||||
* @param player
|
* @param player
|
||||||
* The player
|
* The player
|
||||||
*/
|
*/
|
||||||
public void Send(Player player) {
|
public void Send(Player player){
|
||||||
DebugPotatoAPI.SendDebugPotato(this, player);
|
player.getInventory().addItem(this.toItemStack());
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,7 +2,10 @@ package buttondevteam.lib;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
/**@deprecated
|
||||||
|
* Fully Replaced by DebugPotato Class - Construct a DebugPotato*/
|
||||||
public class DebugPotatoAPI {
|
public class DebugPotatoAPI {
|
||||||
|
/**@deprecated Replaced by DebugPotato.send*/
|
||||||
public static void SendDebugPotato(DebugPotato dp, Player player) {
|
public static void SendDebugPotato(DebugPotato dp, Player player) {
|
||||||
player.getInventory().addItem(dp.toItemStack());
|
player.getInventory().addItem(dp.toItemStack());
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -152,16 +152,16 @@ public final class TBMCCoreAPI {
|
||||||
Bukkit.getLogger().warning(sourcemsg);
|
Bukkit.getLogger().warning(sourcemsg);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Optional<? extends Player> randomPlayer = Bukkit.getOnlinePlayers().stream().findAny();
|
Optional<? extends Player> randomPlayer = Bukkit.getOnlinePlayers().stream().findAny();
|
||||||
if (randomPlayer.isPresent())
|
if (randomPlayer.isPresent()){
|
||||||
DebugPotatoAPI.SendDebugPotato(
|
DebugPotato potato = new DebugPotato()
|
||||||
new DebugPotato()
|
|
||||||
.setMessage(new String[] { //
|
.setMessage(new String[] { //
|
||||||
"§b§o" + potatoMessages[new Random().nextInt(potatoMessages.length)], //
|
"§b§o" + potatoMessages[new Random().nextInt(potatoMessages.length)], //
|
||||||
"§c§o" + sourcemsg, //
|
"§c§o" + sourcemsg, //
|
||||||
"§a§oFind a dev to fix this issue" })
|
"§a§oFind a dev to fix this issue" })
|
||||||
.setType(e instanceof IOException ? "Potato on a Stick"
|
.setType(e instanceof IOException ? "Potato on a Stick"
|
||||||
: e instanceof ClassCastException ? "Square Potato" : "Plain Potato"),
|
: e instanceof ClassCastException ? "Square Potato" : "Plain Potato");
|
||||||
randomPlayer.get());
|
potato.Send(randomPlayer.get());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue