mirror of
https://gitlab.com/SamB440/rpgregions-2.git
synced 2025-12-31 04:36:29 +00:00
Added MessageReward for simple message sending
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package net.islandearth.rpgregions.rewards;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Reward to send messages to the player. More complex messages can use the tellraw command in {@link ConsoleCommandReward}.
|
||||
*/
|
||||
public class MessageReward extends DiscoveryReward {
|
||||
|
||||
private final List<String> messages;
|
||||
|
||||
public MessageReward(List<String> messages) {
|
||||
this.messages = messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void award(Player player) {
|
||||
messages.forEach(message -> player.sendMessage(ChatColor.translateAlternateColorCodes('&', message)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Message";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user