Merge branch 'master' of https://github.com/TBMCPlugins/ButtonCore.git
This commit is contained in:
commit
60730ac994
2 changed files with 79 additions and 1 deletions
|
@ -10,39 +10,83 @@ public class DebugPotato {
|
|||
private List<String> message;
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* Send the debug potato to a player
|
||||
*
|
||||
* @param player
|
||||
* The player
|
||||
*/
|
||||
public void Send(Player player) {
|
||||
DebugPotatoAPI.SendDebugPotato(this, player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message (lore of the potato).
|
||||
*
|
||||
* @return The message
|
||||
*/
|
||||
public List<String> getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the message (lore of the potato).
|
||||
*
|
||||
* @param message
|
||||
* The message
|
||||
* @return This potato
|
||||
*/
|
||||
public DebugPotato setMessage(List<String> message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the message (lore of the potato). It will be word wrapped automatically.
|
||||
*
|
||||
* @param message
|
||||
* The message
|
||||
* @return This potato
|
||||
*/
|
||||
public DebugPotato setMessage(String message) {
|
||||
this.message = WordWrap(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the message (lore of the potato).
|
||||
*
|
||||
* @param message
|
||||
* The message
|
||||
* @return This potato
|
||||
*/
|
||||
public DebugPotato setMessage(String[] message) {
|
||||
this.message = Arrays.asList(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the type (potato name).
|
||||
*
|
||||
* @return The type
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the type (potato name).
|
||||
*
|
||||
* @param type
|
||||
* The type
|
||||
* @return This potato
|
||||
*/
|
||||
public DebugPotato setType(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static List<String> WordWrap(String message) {
|
||||
private static List<String> WordWrap(String message) {
|
||||
String[] splitString = message.split("\\s+");
|
||||
List<String> newMessage = new ArrayList<String>();
|
||||
String currentLine = "";
|
||||
|
|
34
src/main/java/buttondevteam/lib/Gary.java
Normal file
34
src/main/java/buttondevteam/lib/Gary.java
Normal file
|
@ -0,0 +1,34 @@
|
|||
package buttondevteam.lib;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Gary extends DebugPotato {
|
||||
|
||||
public Gary() {
|
||||
super.setMessage("I'M A POTATO");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gary has a fixed message, therefore this method has no effect.
|
||||
*/
|
||||
@Override
|
||||
public DebugPotato setMessage(List<String> message) {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gary has a fixed message, therefore this method has no effect.
|
||||
*/
|
||||
@Override
|
||||
public DebugPotato setMessage(String message) {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gary has a fixed message, therefore this method has no effect.
|
||||
*/
|
||||
@Override
|
||||
public DebugPotato setMessage(String[] message) {
|
||||
return this;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue