Use Components in ConverstationManager.java
This commit is contained in:
parent
bc2c38263a
commit
439796a7f4
|
|
@ -4,7 +4,9 @@ import com.alttd.playershops.gui.ShopManagementGui;
|
||||||
import com.alttd.playershops.shop.PlayerShop;
|
import com.alttd.playershops.shop.PlayerShop;
|
||||||
import com.alttd.playershops.shop.ShopType;
|
import com.alttd.playershops.shop.ShopType;
|
||||||
import com.alttd.playershops.utils.EconomyUtils;
|
import com.alttd.playershops.utils.EconomyUtils;
|
||||||
|
import com.alttd.playershops.utils.Util;
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
import org.bukkit.conversations.*;
|
import org.bukkit.conversations.*;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
@ -71,8 +73,8 @@ public class ConversationManager implements ConversationAbandonedListener {
|
||||||
super("buy", "sell", "none"); // todo can this be automated shoptype.values()
|
super("buy", "sell", "none"); // todo can this be automated shoptype.values()
|
||||||
}
|
}
|
||||||
|
|
||||||
public @NotNull String getPromptText(ConversationContext context) {
|
public @NotNull Component getPromptMessage(ConversationContext context) {
|
||||||
return "What shoptype would you like to use: " + Joiner.on(", ").join(fixedSet) + " Type cancel to cancel this action.";
|
return Util.parseMiniMessage("What shoptype would you like to use: " + Joiner.on(", ").join(fixedSet) + " Type cancel to cancel this action.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -87,8 +89,8 @@ public class ConversationManager implements ConversationAbandonedListener {
|
||||||
|
|
||||||
private class ChangePricePrompt extends NumericPrompt {
|
private class ChangePricePrompt extends NumericPrompt {
|
||||||
|
|
||||||
public @NotNull String getPromptText(ConversationContext context) {
|
public @NotNull Component getPromptMessage(ConversationContext context) { // TODO load from config?
|
||||||
return "What should the price be? Type cancel to cancel this action.";
|
return Util.parseMiniMessage("What should the price be? Type cancel to cancel this action.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -112,8 +114,8 @@ public class ConversationManager implements ConversationAbandonedListener {
|
||||||
|
|
||||||
private class ChangeAmountPrompt extends NumericPrompt {
|
private class ChangeAmountPrompt extends NumericPrompt {
|
||||||
|
|
||||||
public @NotNull String getPromptText(ConversationContext context) {
|
public @NotNull Component getPromptMessage(ConversationContext context) { // TODO load from config?
|
||||||
return "How many items would you like to sell? Type cancel to cancel this action.";
|
return Util.parseMiniMessage("How many items would you like to sell? Type cancel to cancel this action.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -137,8 +139,8 @@ public class ConversationManager implements ConversationAbandonedListener {
|
||||||
|
|
||||||
private class AddBalancePrompt extends NumericPrompt {
|
private class AddBalancePrompt extends NumericPrompt {
|
||||||
|
|
||||||
public @NotNull String getPromptText(ConversationContext context) {
|
public @NotNull Component getPromptMessage(ConversationContext context) { // TODO load from config?
|
||||||
return "How much money would you like to add? Type cancel to cancel this action.";
|
return Util.parseMiniMessage("How much money would you like to add? Type cancel to cancel this action.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -165,8 +167,8 @@ public class ConversationManager implements ConversationAbandonedListener {
|
||||||
|
|
||||||
private class WithdrawBalancePrompt extends NumericPrompt {
|
private class WithdrawBalancePrompt extends NumericPrompt {
|
||||||
|
|
||||||
public @NotNull String getPromptText(ConversationContext context) {
|
public @NotNull Component getPromptMessage(ConversationContext context) { // TODO load from config?
|
||||||
return "How much money would you like to withdraw? Type cancel to cancel this action.";
|
return Util.parseMiniMessage("How much money would you like to withdraw? Type cancel to cancel this action.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -197,8 +199,8 @@ public class ConversationManager implements ConversationAbandonedListener {
|
||||||
super("continue");
|
super("continue");
|
||||||
}
|
}
|
||||||
|
|
||||||
public @NotNull String getPromptText(ConversationContext context) {
|
public @NotNull Component getPromptMessage(ConversationContext context) { // TODO load from config?
|
||||||
return "Hold the item you would like to sell and type continue? Type cancel to cancel this action.";
|
return Util.parseMiniMessage("Hold the item you would like to sell and type continue? Type cancel to cancel this action.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user