Enforce more consistent region rules

This commit is contained in:
NotAlexNoyle committed 2026-07-20 00:42:20 -04:00
1 parent 2fa49f9490
commit b85f5ae2b1
23 files changed
+1093 -79

No files matched your search

@@ -0,0 +1,85 @@
package me.wiefferink.areashop.commands;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;
import me.wiefferink.areashop.MessageBridge;
import me.wiefferink.areashop.commands.util.AreashopCommandBean;
import me.wiefferink.areashop.commands.util.RegionParseUtil;
import me.wiefferink.areashop.features.confirmation.ShopConfirmationGui;
import me.wiefferink.areashop.managers.IFileManager;
import me.wiefferink.areashop.regions.BuyRegion;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.incendo.cloud.Command;
import org.incendo.cloud.bean.CommandProperties;
import org.incendo.cloud.context.CommandContext;
import org.incendo.cloud.parser.flag.CommandFlag;
import javax.annotation.Nonnull;
/**
* Opens the confirmation screen used by chat and sign buy actions.
*/
@Singleton
public class ConfirmBuyCommand extends AreashopCommandBean {
private final CommandFlag<BuyRegion> regionFlag;
private final MessageBridge messageBridge;
private final ShopConfirmationGui confirmationGui;
@Inject
public ConfirmBuyCommand(@Nonnull IFileManager fileManager, @Nonnull MessageBridge messageBridge,
@Nonnull ShopConfirmationGui confirmationGui)
{
this.regionFlag = RegionParseUtil.createDefaultBuy(fileManager);
this.messageBridge = messageBridge;
this.confirmationGui = confirmationGui;
}
@Override
public String getHelpKey(CommandSender target) {
return null;
}
@Override
public String stringDescription() {
return null;
}
@Override
protected @Nonnull CommandProperties properties() {
return CommandProperties.of("confirmbuy");
}
@Override
protected @Nonnull Command.Builder<? extends CommandSender> configureCommand(
@Nonnull Command.Builder<CommandSender> builder)
{
return builder.literal("confirmbuy").flag(regionFlag).senderType(Player.class).handler(this::handleCommand);
}
private void handleCommand(@Nonnull CommandContext<Player> context) {
Player player = context.sender();
if (!player.hasPermission("areashop.buy")) {
messageBridge.message(player, "buy-noPermission");
return;
}
confirmationGui.openBuyConfirmation(player, RegionParseUtil.getOrParseBuyRegion(context, regionFlag));
}
}
@@ -0,0 +1,93 @@
package me.wiefferink.areashop.commands;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;
import me.wiefferink.areashop.MessageBridge;
import me.wiefferink.areashop.commands.util.AreashopCommandBean;
import me.wiefferink.areashop.commands.util.RegionParseUtil;
import me.wiefferink.areashop.features.confirmation.ShopConfirmationGui;
import me.wiefferink.areashop.managers.IFileManager;
import me.wiefferink.areashop.regions.BuyRegion;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.incendo.cloud.Command;
import org.incendo.cloud.bean.CommandProperties;
import org.incendo.cloud.context.CommandContext;
import org.incendo.cloud.parser.flag.CommandFlag;
import javax.annotation.Nonnull;
/**
* Opens the confirmation screen used by chat and sign sell-back actions.
*/
@Singleton
public class ConfirmSellCommand extends AreashopCommandBean {
private final CommandFlag<BuyRegion> regionFlag;
private final MessageBridge messageBridge;
private final ShopConfirmationGui confirmationGui;
@Inject
public ConfirmSellCommand(@Nonnull IFileManager fileManager, @Nonnull MessageBridge messageBridge,
@Nonnull ShopConfirmationGui confirmationGui)
{
this.regionFlag = RegionParseUtil.createDefaultBuy(fileManager);
this.messageBridge = messageBridge;
this.confirmationGui = confirmationGui;
}
@Override
public String getHelpKey(CommandSender target) {
return null;
}
@Override
public String stringDescription() {
return null;
}
@Override
protected @Nonnull CommandProperties properties() {
return CommandProperties.of("confirmsell");
}
@Override
protected @Nonnull Command.Builder<? extends CommandSender> configureCommand(
@Nonnull Command.Builder<CommandSender> builder)
{
return builder.literal("confirmsell").flag(regionFlag).senderType(Player.class).handler(this::handleCommand);
}
private void handleCommand(@Nonnull CommandContext<Player> context) {
Player player = context.sender();
if (!player.hasPermission("areashop.sell") && !player.hasPermission("areashop.sellown")) {
messageBridge.message(player, "sell-noPermission");
return;
}
BuyRegion region = RegionParseUtil.getOrParseBuyRegion(context, regionFlag);
if (!region.isSold()) {
messageBridge.message(player, "sell-notBought", region);
return;
}
confirmationGui.openSellConfirmation(player, region);
}
}
@@ -119,7 +119,7 @@ public class InfoRegionCommand extends AreashopCommandBean {
if (buy.isInResellingMode()) {
messageBridge.messageNoPrefix(sender, "info-regionReselling", buy);
messageBridge.messageNoPrefix(sender, jubileeKey("info-regionReselPrice"), buy);
messageBridge.messageNoPrefix(sender, jubileeKey("info-regionReselPriceClick"), buy);
} else {
@@ -0,0 +1,83 @@
package me.wiefferink.areashop.commands;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;
import me.wiefferink.areashop.commands.util.AreashopCommandBean;
import me.wiefferink.areashop.commands.util.RegionParseUtil;
import me.wiefferink.areashop.features.confirmation.RentOptionsGui;
import me.wiefferink.areashop.managers.IFileManager;
import me.wiefferink.areashop.regions.RentRegion;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.incendo.cloud.Command;
import org.incendo.cloud.bean.CommandProperties;
import org.incendo.cloud.context.CommandContext;
import org.incendo.cloud.parser.flag.CommandFlag;
import javax.annotation.Nonnull;
/**
* Opens rent management for the current renter, or a pay-rent confirmation for
* another player.
*/
@Singleton
public class RentOptionsCommand extends AreashopCommandBean {
private final CommandFlag<RentRegion> regionFlag;
private final RentOptionsGui rentOptionsGui;
@Inject
public RentOptionsCommand(@Nonnull IFileManager fileManager, @Nonnull RentOptionsGui rentOptionsGui) {
this.regionFlag = RegionParseUtil.createDefaultRent(fileManager);
this.rentOptionsGui = rentOptionsGui;
}
@Override
public String getHelpKey(CommandSender target) {
return null;
}
@Override
public String stringDescription() {
return null;
}
@Override
protected @Nonnull CommandProperties properties() {
return CommandProperties.of("rentoptions");
}
@Override
protected @Nonnull Command.Builder<? extends CommandSender> configureCommand(
@Nonnull Command.Builder<CommandSender> builder)
{
return builder.literal("rentoptions").flag(regionFlag).senderType(Player.class).handler(this::handleCommand);
}
private void handleCommand(@Nonnull CommandContext<Player> context) {
Player player = context.sender();
RentRegion region = RegionParseUtil.getOrParseRentRegion(context, regionFlag);
if (region.isRenter(player)) {
rentOptionsGui.openRentOptions(player, region);
} else {
rentOptionsGui.openPayRentConfirmation(player, region);
}
}
}
@@ -9,6 +9,8 @@ import me.wiefferink.areashop.commands.AddCommand;
import me.wiefferink.areashop.commands.AddFriendCommand;
import me.wiefferink.areashop.commands.AddSignCommand;
import me.wiefferink.areashop.commands.BuyCommand;
import me.wiefferink.areashop.commands.ConfirmBuyCommand;
import me.wiefferink.areashop.commands.ConfirmSellCommand;
import me.wiefferink.areashop.commands.DelCommand;
import me.wiefferink.areashop.commands.DelFriendCommand;
import me.wiefferink.areashop.commands.DelSignCommand;
@@ -31,6 +33,7 @@ import me.wiefferink.areashop.commands.QuickDeleteCommand;
import me.wiefferink.areashop.commands.QuickRentCommand;
import me.wiefferink.areashop.commands.ReloadCommand;
import me.wiefferink.areashop.commands.RentCommand;
import me.wiefferink.areashop.commands.RentOptionsCommand;
import me.wiefferink.areashop.commands.ResellCommand;
import me.wiefferink.areashop.commands.SchematicEventCommand;
import me.wiefferink.areashop.commands.SellCommand;
@@ -70,12 +73,13 @@ import java.util.List;
public class AreashopCommands {
private static final List<Class<? extends AreashopCommandBean>> COMMAND_CLASSES = List.of(AddCommand.class,
AddFriendCommand.class, AddSignCommand.class, BuyCommand.class, DelCommand.class, DelFriendCommand.class,
DelSignCommand.class, FindCommand.class, GroupAddCommand.class, GroupDelCommand.class,
GroupInfoCommand.class, GroupListCommand.class, HelpCommand.class, InfoCommand.class, InfoBaseCommand.class,
InfoPlayerCommand.class, InfoRegionCommand.class, LinkSignsCommand.class, MeCommand.class,
MessageCommand.class, PayRentCommand.class, QuickBuyCommand.class, QuickDeleteCommand.class,
QuickRentCommand.class, ReloadCommand.class, RentCommand.class, ResellCommand.class,
AddFriendCommand.class, AddSignCommand.class, BuyCommand.class, ConfirmBuyCommand.class,
ConfirmSellCommand.class, DelCommand.class, DelFriendCommand.class, DelSignCommand.class, FindCommand.class,
GroupAddCommand.class, GroupDelCommand.class, GroupInfoCommand.class, GroupListCommand.class,
HelpCommand.class, InfoCommand.class, InfoBaseCommand.class, InfoPlayerCommand.class,
InfoRegionCommand.class, LinkSignsCommand.class, MeCommand.class, MessageCommand.class,
PayRentCommand.class, QuickBuyCommand.class, QuickDeleteCommand.class, QuickRentCommand.class,
ReloadCommand.class, RentCommand.class, RentOptionsCommand.class, ResellCommand.class,
SchematicEventCommand.class, SellCommand.class, SetDurationCommand.class, SetLandlordCommand.class,
SetOwnerCommand.class, SetPriceCommand.class, SetRestoreCommand.class, SetTeleportCommand.class,
SetTransferCommand.class, StackCommand.class, StopResellCommand.class, TeleportCommand.class,
@@ -0,0 +1,36 @@
package me.wiefferink.areashop.features.confirmation;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.google.inject.Singleton;
import me.wiefferink.areashop.AreaShop;
import me.wiefferink.areashop.MessageBridge;
import javax.annotation.Nonnull;
/**
* Registers the inventory listener used for buy and sell-back confirmations.
*/
public class ConfirmationModule extends AbstractModule {
@Provides
@Singleton
public ShopConfirmationGui provideShopConfirmationGui(@Nonnull AreaShop plugin) {
ShopConfirmationGui confirmationGui = new ShopConfirmationGui(plugin);
plugin.getServer().getPluginManager().registerEvents(confirmationGui, plugin);
return confirmationGui;
}
@Provides
@Singleton
public RentOptionsGui provideRentOptionsGui(@Nonnull AreaShop plugin, @Nonnull MessageBridge messageBridge) {
RentOptionsGui rentOptionsGui = new RentOptionsGui(plugin, messageBridge);
plugin.getServer().getPluginManager().registerEvents(rentOptionsGui, plugin);
return rentOptionsGui;
}
}
@@ -0,0 +1,403 @@
package me.wiefferink.areashop.features.confirmation;
import me.wiefferink.areashop.AreaShop;
import me.wiefferink.areashop.MessageBridge;
import me.wiefferink.areashop.commands.UnrentCommand;
import me.wiefferink.areashop.regions.RentRegion;
import me.wiefferink.areashop.tools.Utils;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
import java.util.List;
/**
* ARM-style rent management and unrent confirmation screens.
*/
public class RentOptionsGui implements Listener {
private static final int INVENTORY_SIZE = 9;
private static final int PRIMARY_SLOT = 0;
private static final int CANCEL_SLOT = INVENTORY_SIZE / 2;
private static final int SECONDARY_SLOT = INVENTORY_SIZE - 1;
private final AreaShop plugin;
private final MessageBridge messageBridge;
RentOptionsGui(AreaShop plugin, MessageBridge messageBridge) {
this.plugin = plugin;
this.messageBridge = messageBridge;
}
/**
* Show the renter's choices to pay, decline payment, or stop renting.
*
* @param player The current renter
* @param region The rented shop
*/
public void openRentOptions(Player player, RentRegion region) {
open(player, region, Screen.OPTIONS);
}
/**
* Ask a player to confirm whether they want to pay this shop's rent.
*
* @param player The prospective payer
* @param region The rented shop
*/
public void openPayRentConfirmation(Player player, RentRegion region) {
open(player, region, Screen.PAY_RENT_CONFIRMATION);
}
/**
* Pay rent on behalf of the renter, using the same checks as /as payrent.
*
* @param payer The player paying
* @param region The rented shop
*/
public void payRent(Player payer, RentRegion region) {
if (!payer.hasPermission("areashop.payrent")) {
messageBridge.message(payer, "payrent-noPermission");
return;
}
if (!region.isRented()) {
messageBridge.message(payer, "payrent-notRented", region.getName());
return;
}
if (plugin.isJubilee()) {
messageBridge.message(payer, "payrent-jubilee", region.getName());
return;
}
if (region.isRenter(payer)) {
region.rent(payer);
} else {
region.rent(Bukkit.getOfflinePlayer(region.getRenter()), payer);
}
}
private void open(Player player, RentRegion region, Screen screen) {
RentInventoryHolder holder = new RentInventoryHolder(region, screen);
Inventory inventory = Bukkit.createInventory(holder, INVENTORY_SIZE, Utils.applyColors(screen.title()));
holder.setInventory(inventory);
inventory.setItem(PRIMARY_SLOT, screen == Screen.UNRENT_CONFIRMATION ? createUnrentItem(region)
: createPayRentItem(region, screen == Screen.OPTIONS));
for (int slot = PRIMARY_SLOT + 1; slot < SECONDARY_SLOT; slot++) {
inventory.setItem(slot,
screen == Screen.OPTIONS && slot == CANCEL_SLOT ? createDoNotPayItem() : createFillerItem());
}
inventory.setItem(SECONDARY_SLOT, screen == Screen.OPTIONS ? createSellBackItem(region)
: screen == Screen.UNRENT_CONFIRMATION ? createKeepRentingItem() : createDoNotPayItem());
player.openInventory(inventory);
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onInventoryClick(InventoryClickEvent event) {
if (!(event.getView().getTopInventory().getHolder() instanceof RentInventoryHolder holder)) {
return;
}
event.setCancelled(true);
if (!(event.getWhoClicked() instanceof Player player)) {
return;
}
int rawSlot = event.getRawSlot();
if (rawSlot < 0 || rawSlot >= INVENTORY_SIZE) {
return;
}
if (holder.screen() == Screen.OPTIONS) {
handleOptionsClick(player, holder.region(), rawSlot);
} else if (holder.screen() == Screen.PAY_RENT_CONFIRMATION) {
handlePayRentConfirmationClick(player, holder.region(), rawSlot);
} else {
handleUnrentConfirmationClick(player, holder.region(), rawSlot);
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onInventoryDrag(InventoryDragEvent event) {
if (event.getView().getTopInventory().getHolder() instanceof RentInventoryHolder) {
event.setCancelled(true);
}
}
private void handleOptionsClick(Player player, RentRegion region, int rawSlot) {
if (rawSlot == PRIMARY_SLOT) {
open(player, region, Screen.PAY_RENT_CONFIRMATION);
return;
}
if (rawSlot == CANCEL_SLOT) {
player.closeInventory();
return;
}
if (rawSlot == SECONDARY_SLOT) {
if (!UnrentCommand.canUse(player, region)) {
messageBridge.message(player, "unrent-noPermission");
return;
}
open(player, region, Screen.UNRENT_CONFIRMATION);
}
}
private void handlePayRentConfirmationClick(Player player, RentRegion region, int rawSlot) {
if (rawSlot == SECONDARY_SLOT) {
player.closeInventory();
return;
}
if (rawSlot == PRIMARY_SLOT) {
player.closeInventory();
payRent(player, region);
}
}
private void handleUnrentConfirmationClick(Player player, RentRegion region, int rawSlot) {
if (rawSlot == SECONDARY_SLOT) {
player.closeInventory();
return;
}
if (rawSlot == PRIMARY_SLOT) {
player.closeInventory();
region.unRent(true, player);
}
}
private ItemStack createPayRentItem(RentRegion region, boolean requiresConfirmation) {
ItemStack item = new ItemStack(Material.DIAMOND);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(Utils.applyColors("&aPay rent"));
List<String> lore = new ArrayList<>(
List.of(Utils.applyColors("&7Extend &6" + region.getName()), Utils.applyColors(
"&7Cost: " + (plugin.isJubilee() ? Utils.formatCurrency(0) : region.getFormattedPrice()))));
if (plugin.isJubilee()) {
lore.add(Utils.applyColors("&8The jubilee includes all extensions"));
}
lore.add(Utils.applyColors(requiresConfirmation ? "&8Click to continue" : "&8Click to pay"));
meta.setLore(lore);
item.setItemMeta(meta);
return item;
}
private ItemStack createSellBackItem(RentRegion region) {
ItemStack item = new ItemStack(Material.REDSTONE_BLOCK);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(Utils.applyColors("&cStop renting and sell back"));
String refund = plugin.isJubilee() ? Utils.formatCurrency(0) : region.getFormattedMoneyBackAmount();
List<String> lore = new ArrayList<>(List.of(Utils.applyColors("&7Release &6" + region.getName()),
Utils.applyColors("&7Diamonds returned: " + refund)));
if (plugin.isJubilee()) {
lore.add(Utils.applyColors("&cNo Diamonds are returned during the jubilee"));
}
lore.add(Utils.applyColors("&8Click to continue"));
meta.setLore(lore);
item.setItemMeta(meta);
return item;
}
private ItemStack createUnrentItem(RentRegion region) {
ItemStack item = new ItemStack(Material.MELON);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(Utils.applyColors("&aYes, stop renting"));
String refund = plugin.isJubilee() ? Utils.formatCurrency(0) : region.getFormattedMoneyBackAmount();
List<String> lore = new ArrayList<>(List.of(Utils.applyColors("&7Release &6" + region.getName()),
Utils.applyColors("&7Diamonds returned: " + refund)));
if (plugin.isJubilee()) {
lore.add(Utils.applyColors("&cNo Diamonds are returned during the jubilee"));
}
lore.add(Utils.applyColors("&8Click to confirm"));
meta.setLore(lore);
item.setItemMeta(meta);
return item;
}
private ItemStack createKeepRentingItem() {
ItemStack item = new ItemStack(Material.REDSTONE_BLOCK);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(Utils.applyColors("&cNo, keep renting"));
meta.setLore(List.of(Utils.applyColors("&7Return to your rented shop")));
item.setItemMeta(meta);
return item;
}
private ItemStack createDoNotPayItem() {
ItemStack item = new ItemStack(Material.REDSTONE_BLOCK);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(Utils.applyColors("&cNo, do not pay"));
meta.setLore(List.of(Utils.applyColors("&7Return without paying rent")));
item.setItemMeta(meta);
return item;
}
private ItemStack createFillerItem() {
ItemStack item = new ItemStack(Material.GRAY_STAINED_GLASS_PANE);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(Utils.applyColors("&8 "));
item.setItemMeta(meta);
return item;
}
private enum Screen {
OPTIONS("&2Rent options"), PAY_RENT_CONFIRMATION("&2Pay rent?"),
UNRENT_CONFIRMATION("&4Stop renting this shop?");
private final String title;
Screen(String title) {
this.title = title;
}
String title() {
return title;
}
}
private static final class RentInventoryHolder implements InventoryHolder {
private final RentRegion region;
private final Screen screen;
private Inventory inventory;
private RentInventoryHolder(RentRegion region, Screen screen) {
this.region = region;
this.screen = screen;
}
private RentRegion region() {
return region;
}
private Screen screen() {
return screen;
}
private void setInventory(Inventory inventory) {
this.inventory = inventory;
}
@Override
public Inventory getInventory() {
return inventory;
}
}
}
@@ -0,0 +1,250 @@
package me.wiefferink.areashop.features.confirmation;
import me.wiefferink.areashop.AreaShop;
import me.wiefferink.areashop.regions.BuyRegion;
import me.wiefferink.areashop.tools.Utils;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
import java.util.List;
/**
* ARM-style, one-row warning screens for shop purchases and sell-backs.
*/
public class ShopConfirmationGui implements Listener {
private static final int INVENTORY_SIZE = 9;
private static final int CONFIRM_SLOT = 0;
private static final int CANCEL_SLOT = INVENTORY_SIZE - 1;
private final AreaShop plugin;
ShopConfirmationGui(AreaShop plugin) {
this.plugin = plugin;
}
/**
* Show a confirmation screen before a player buys a shop.
*
* @param player The player buying the shop
* @param region The shop to buy
*/
public void openBuyConfirmation(Player player, BuyRegion region) {
openConfirmation(player, region, Transaction.BUY);
}
/**
* Show a confirmation screen before a player sells their shop back.
*
* @param player The player selling the shop
* @param region The shop to sell
*/
public void openSellConfirmation(Player player, BuyRegion region) {
openConfirmation(player, region, Transaction.SELL);
}
private void openConfirmation(Player player, BuyRegion region, Transaction transaction) {
ConfirmationInventoryHolder holder = new ConfirmationInventoryHolder(region, transaction);
Inventory inventory = Bukkit.createInventory(holder, INVENTORY_SIZE, Utils.applyColors(transaction.title()));
holder.setInventory(inventory);
inventory.setItem(CONFIRM_SLOT, createConfirmItem(holder));
for (int slot = CONFIRM_SLOT + 1; slot < CANCEL_SLOT; slot++) {
inventory.setItem(slot, createFillerItem());
}
inventory.setItem(CANCEL_SLOT, createCancelItem());
player.openInventory(inventory);
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onInventoryClick(InventoryClickEvent event) {
if (!(event.getView().getTopInventory().getHolder() instanceof ConfirmationInventoryHolder holder)) {
return;
}
// The dialog is read-only, including the player's lower inventory.
event.setCancelled(true);
if (!(event.getWhoClicked() instanceof Player player)) {
return;
}
int rawSlot = event.getRawSlot();
if (rawSlot < 0 || rawSlot >= INVENTORY_SIZE) {
return;
}
if (rawSlot == CANCEL_SLOT) {
player.closeInventory();
return;
}
if (rawSlot == CONFIRM_SLOT) {
player.closeInventory();
if (holder.transaction() == Transaction.BUY) {
holder.region().buy(player);
} else {
// This is the normal sell-back path, including Diamond payback.
holder.region().sell(true, player);
}
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onInventoryDrag(InventoryDragEvent event) {
if (event.getView().getTopInventory().getHolder() instanceof ConfirmationInventoryHolder) {
event.setCancelled(true);
}
}
private ItemStack createConfirmItem(ConfirmationInventoryHolder holder) {
BuyRegion region = holder.region();
boolean buying = holder.transaction() == Transaction.BUY;
boolean willPayBack = !buying && !plugin.isJubilee();
String price = buying
? (region.isInResellingMode() ? region.getFormattedResellPrice() : region.getFormattedPrice())
: region.getFormattedMoneyBackAmount();
ItemStack item = new ItemStack(Material.MELON);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(Utils.applyColors(buying ? "&aYes, buy this shop" : "&aYes, sell this shop"));
List<String> lore = new ArrayList<>(
List.of(Utils.applyColors("&7" + (buying ? "Buy " : "Sell ") + "&6" + region.getName()),
Utils.applyColors("&7" + (buying ? "Cost: " : "Diamonds returned: ")
+ (willPayBack || buying ? price : Utils.formatCurrency(0)))));
if (!buying && !willPayBack) {
lore.add(Utils.applyColors("&cNo Diamonds are returned during the jubilee"));
}
lore.add(Utils.applyColors("&8Click to confirm"));
meta.setLore(lore);
item.setItemMeta(meta);
return item;
}
private ItemStack createCancelItem() {
ItemStack item = new ItemStack(Material.REDSTONE_BLOCK);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(Utils.applyColors("&cNo, cancel"));
meta.setLore(List.of(Utils.applyColors("&7Keep the shop unchanged")));
item.setItemMeta(meta);
return item;
}
private ItemStack createFillerItem() {
ItemStack item = new ItemStack(Material.GRAY_STAINED_GLASS_PANE);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(Utils.applyColors("&8 "));
item.setItemMeta(meta);
return item;
}
private enum Transaction {
BUY("&2Buy this shop?"), SELL("&4Sell this shop?");
private final String title;
Transaction(String title) {
this.title = title;
}
String title() {
return title;
}
}
private static final class ConfirmationInventoryHolder implements InventoryHolder {
private final BuyRegion region;
private final Transaction transaction;
private Inventory inventory;
private ConfirmationInventoryHolder(BuyRegion region, Transaction transaction) {
this.region = region;
this.transaction = transaction;
}
private BuyRegion region() {
return region;
}
private Transaction transaction() {
return transaction;
}
private void setInventory(Inventory inventory) {
this.inventory = inventory;
}
@Override
public Inventory getInventory() {
return inventory;
}
}
}
@@ -7,6 +7,7 @@ import com.google.inject.assistedinject.FactoryModuleBuilder;
import me.wiefferink.areashop.AreaShop;
import me.wiefferink.areashop.MessageBridge;
import me.wiefferink.areashop.features.FeatureFactory;
import me.wiefferink.areashop.features.confirmation.ConfirmationModule;
import me.wiefferink.areashop.features.signs.SignManager;
import me.wiefferink.areashop.features.signs.SignsModule;
import me.wiefferink.areashop.interfaces.WorldEditInterface;
@@ -73,6 +74,7 @@ public class AreaShopModule extends AbstractModule {
// bind(CommandManager.class).in(Singleton.class);
bind(SignLinkerManager.class).in(Singleton.class);
bind(ServiceManager.class).toInstance(this.serviceManager);
install(new ConfirmationModule());
install(new SignsModule());
install(new RegionModule());
install(new FactoryModuleBuilder().build(FeatureFactory.class));
@@ -13,7 +13,6 @@ import me.wiefferink.interactivemessenger.Log;
import me.wiefferink.interactivemessenger.processing.Message;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.World;
@@ -780,14 +779,35 @@ public class Utils {
*/
public static String applyColors(String input) {
String result = null;
if (input != null) {
if (input == null) {
result = ChatColor.translateAlternateColorCodes('&', input);
return null;
}
return result;
StringBuilder result = new StringBuilder(input.length());
for (int index = 0; index < input.length(); index++) {
char character = input.charAt(index);
if (character == '&' && index + 1 < input.length() && isColorCode(input.charAt(index + 1))) {
result.append('\u00A7').append(Character.toLowerCase(input.charAt(++index)));
} else {
result.append(character);
}
}
return result.toString();
}
private static boolean isColorCode(char character) {
return "0123456789abcdefklmnorx".indexOf(Character.toLowerCase(character)) >= 0;
}
+22 -11
View File
@@ -45,8 +45,8 @@ general:
signProfile:
forrent:
line1: '&2For Rent:'
line2: '&0&l%region%'
line3: '&e%durationshort% (12x)'
line2: '&f&l%region%'
line3: '&f%durationshort% (12x)'
line4: '%price%'
rightClickPlayer:
- 'areashop info region --region %region%'
@@ -56,7 +56,7 @@ general:
- 'areashop info region --region %region%'
rented:
line1: '&2Rented:'
line2: '&0&l%region%'
line2: '&f&l%region%'
line3: '&3&lShopkeeper:'
line4: '&0%playercolor%%player%'
rightClickPlayer:
@@ -65,13 +65,14 @@ general:
# - 'areashop message %clicker% %lang:confirm-extend|%region%|%' # Alternative to first ask for confirmation (remove rightClickPlayer section)
leftClickPlayer:
- 'areashop info region --region %region%'
# Every Shift-click opens a rent GUI; the current renter can also sell back the shop.
shiftRightClickPlayer:
- 'areashop payrent --region %region%'
- 'areashop rentoptions --region %region%'
shiftLeftClickPlayer:
- 'areashop payrent --region %region%'
- 'areashop rentoptions --region %region%'
forsale:
line1: '&2For Sale:'
line2: '&0&l%region%'
line2: '&f&l%region%'
line3: '%price%'
line4: '&8%width%x%depth%x%height%'
rightClickPlayer:
@@ -80,9 +81,11 @@ general:
# - 'areashop message %clicker% %lang:confirm-buy|%region%|%' # Alternative to first ask for confirmation (remove rightClickPlayer section)
leftClickPlayer:
- 'areashop info region --region %region%'
shiftRightClickPlayer:
- 'areashop confirmbuy --region %region%'
resell:
line1: '&2For Sale:'
line2: '&0&l%region%'
line2: '&f&l%region%'
line3: '%resellprice%'
line4: '&8%width%x%depth%x%height%'
rightClickPlayer:
@@ -93,17 +96,19 @@ general:
- 'areashop info region --region %region%'
shiftRightClickPlayer:
- 'areashop stopresell --region %region%'
shiftLeftClickPlayer:
- 'areashop confirmbuy --region %region%'
sold:
line1: '&4Sold:'
line2: '&0&l%region%'
line2: '&f&l%region%'
line3: '&0%playercolor%%player%'
line4: '&2No Expiry'
rightClickPlayer:
- 'areashop info region --region %region%'
leftClickPlayer:
- 'areashop info region --region %region%'
shiftRightClickConsole:
- 'areashop message %clicker% %lang:confirm-sell|%region%|%'
shiftRightClickPlayer:
- 'areashop confirmsell --region %region%'
##### Set WorldGuard regions flags depending on the region state.
# All normal region flags as present in WorldGuard can be used, in addition to 'members', 'owners', 'priority' and 'parent'.
@@ -123,24 +128,30 @@ general:
block-break: 'allow g:members'
block-place: 'allow g:members'
chest-access: 'allow g:members'
can-flippy: allow
forrent:
greeting: '%lang:wgPrefix%&6This shop can be rented for %price% &6per &2%duration%'
interact: 'allow g:all'
use: 'allow g:all'
rented:
members: '%uuid%, %friendsuuid%'
greeting: ''
interact: 'deny g:non_members'
use: 'allow g:members'
forsale:
greeting: '%lang:wgPrefix%&6This shop can be purchased for %price%'
interact: 'allow g:all'
use: 'allow g:all'
sold:
members: '%uuid%, %friendsuuid%'
greeting: ''
interact: 'deny g:non_members'
use: 'allow g:members'
resell:
members: '%uuid%, %friendsuuid%'
greeting: '%lang:wgPrefix%&6This shop can be purchased for %resellprice%'
use: 'allow g:all'
interact: 'deny g:non_members'
use: 'allow g:members'
##### Save and restore schematics to clean up regions.
# After 'save:' or 'restore:' you enter the name of the file to restore from/to (.schematic is added automatically).
+3 -3
View File
@@ -207,7 +207,7 @@
- "[bold]Kaufen für[/bold]"
- " hover: Kaufe %region% für %price%"
- " hover: %lang:action|Kaufe %region%|%"
- " command: /areashop buy %region%"
- " command: /areashop confirmbuy --region %region%"
- ": [gray]%price%."
"info-regionReselPrice": "[darkgreen][bold]►[reset] Weiterverkaufspreis: [gray]%resellprice% (Du kannst es von %lang:player% kaufen)."
"info-regionFriends": "[darkgreen][bold]►[reset] Hinzugefügte Freunde: [gray]%0%."
@@ -224,7 +224,7 @@
- "[bold]Verkaufsrückzahlung[/bold]"
- " hover: Verkaufe %region% und bekomme %moneyback% zurück"
- " hover: %lang:action|Verkaufe %region%|%"
- " command: /areashop sell %region%"
- " command: /areashop confirmsell --region %region%"
- ": [gray]%moneyback% (%moneybackpercent%% des Kaufpreises)."
"info-regionMoneyBackRent": "[darkgreen][bold]►[reset] Rückzahlung bei Mietkündigung: [gray]%moneyback% (%moneybackpercent%% der verbleibenden Zeit)."
"info-regionMoneyBackRentClick":
@@ -518,4 +518,4 @@
"greeting-rented": "%region% ist vermietet an %player% bis %until%."
"greeting-forsale": "%region% kann gekauft werden für %price%."
"greeting-bought": "%region% ist Eigentum von %player%."
"greeting-resale": "%region% kann für %resellprice% von 1%player% gekauft werden."
"greeting-resale": "%region% kann für %resellprice% von 1%player% gekauft werden."
+15 -2
View File
@@ -278,10 +278,19 @@ info-regionCanBeRented: |-
<bold><dark_green>►</dark_green></bold> <click:run_command:'/areashop rent %region%'><hover:show_text:'Rent %region% for %price% per %duration%
%lang:action|Rent %region%|%'><bold>Rent for</bold></hover></click>: <gray>%price% per %duration%.
info-regionCanBeBought: |-
<bold><dark_green>►</dark_green></bold> <click:run_command:'/areashop buy %region%'><hover:show_text:'Buy %region% for %price%
<bold><dark_green>►</dark_green></bold> <click:run_command:'/areashop confirmbuy --region %region%'><hover:show_text:'Buy %region% for %price%
%lang:action|Buy %region%|%'><bold>Buy for</bold></hover></click>: <gray>%price%.
info-regionCanBeBoughtJubilee: |-
<bold><dark_green>►</dark_green></bold> <click:run_command:'/areashop confirmbuy --region %region%'><hover:show_text:'Buy %region% for free (jubilee)
%lang:action|Buy %region%|%'><bold>Buy</bold></hover></click>: <gray>free (jubilee).
info-regionReselPrice: '<bold><dark_green>►</dark_green></bold> Resell price: <gray>%resellprice%
(you can buy it from %lang:player%).'
info-regionReselPriceClick: |-
<bold><dark_green>►</dark_green></bold> <click:run_command:'/areashop confirmbuy --region %region%'><hover:show_text:'Buy %region% from %player% for %resellprice%
%lang:action|Buy %region%|%'><bold>Buy from %lang:player%</bold></hover></click>: <gray>%resellprice%.
info-regionReselPriceClickJubilee: |-
<bold><dark_green>►</dark_green></bold> <click:run_command:'/areashop confirmbuy --region %region%'><hover:show_text:'Buy %region% from %player% for free (jubilee)
%lang:action|Buy %region%|%'><bold>Buy from %lang:player%</bold></hover></click>: <gray>free (jubilee).
info-regionFriends: '<bold><dark_green>►</dark_green></bold> Added friends: <gray>%0%.'
info-friend: '%lang:tPlayer|%0%|%'
info-friendRemove: |-
@@ -290,8 +299,12 @@ info-friendRemove: |-
info-regionMoneyBackBuy: '<bold><dark_green>►</dark_green></bold> Selling payback:
<gray>%moneyback% (%moneybackpercent%% of the price).'
info-regionMoneyBackBuyClick: |-
<bold><dark_green>►</dark_green></bold> <click:run_command:'/areashop sell %region%'><hover:show_text:'Sell %region% and get back %moneyback%
<bold><dark_green>►</dark_green></bold> <click:run_command:'/areashop confirmsell --region %region%'><hover:show_text:'Sell %region% and get back %moneyback%
%lang:action|Sell %region%|%'><bold>Selling payback</bold></hover></click>: <gray>%moneyback% (%moneybackpercent%% of the price).
info-regionMoneyBackBuyJubilee: '<bold><dark_green>►</dark_green></bold> Selling: <gray>gives no Diamonds back (jubilee).'
info-regionMoneyBackBuyClickJubilee: |-
<bold><dark_green>►</dark_green></bold> <click:run_command:'/areashop confirmsell --region %region%'><hover:show_text:'Sell %region% (no Diamonds back during the jubilee)
%lang:action|Sell %region%|%'><bold>Sell</bold></hover></click>: <gray>gives no Diamonds back (jubilee).
info-regionMoneyBackRent: '<bold><dark_green>►</dark_green></bold> Unrenting payback:
<gray>%moneyback% (%moneybackpercent%% of the remaining time).'
info-regionMoneyBackRentClick: |-
+19 -5
View File
@@ -287,17 +287,31 @@ info-regionCanBeBought:
- "[bold]Buy for[/bold]"
- " hover: Buy %region% for %price%"
- " hover: %lang:action|Buy %region%|%"
- " command: /areashop buy %region%"
- " command: /areashop confirmbuy --region %region%"
- ": [gray]%price%[gray]."
info-regionCanBeBoughtJubilee:
- "[darkgreen][bold]►[reset] "
- "[bold]Buy[/bold]"
- " hover: Buy %region% for free (jubilee)"
- " hover: %lang:action|Buy %region%|%"
- " command: /areashop buy %region%"
- " command: /areashop confirmbuy --region %region%"
- ": [gray]free (jubilee)."
info-regionReselPrice: "[darkgreen][bold]►[reset] Resell price: [gray]%resellprice%[gray] (you can buy it from %lang:player%)."
info-regionReselPriceJubilee: "[darkgreen][bold]►[reset] Resell: [gray]you can take it over from %lang:player% for free (jubilee)."
info-regionReselPriceClick:
- "[darkgreen][bold]►[reset] "
- "[bold]Buy from %lang:player%[/bold]"
- " hover: Buy %region% from %player% for %resellprice%"
- " hover: %lang:action|Buy %region%|%"
- " command: /areashop confirmbuy --region %region%"
- ": [gray]%resellprice%[gray]."
info-regionReselPriceClickJubilee:
- "[darkgreen][bold]►[reset] "
- "[bold]Buy from %lang:player%[/bold]"
- " hover: Buy %region% from %player% for free (jubilee)"
- " hover: %lang:action|Buy %region%|%"
- " command: /areashop confirmbuy --region %region%"
- ": [gray]free (jubilee)."
info-regionFriends: "[darkgreen][bold]►[reset] Added friends: [gray]%0%."
info-friend: "%lang:tPlayer|%0%|%"
info-friendRemove:
@@ -313,7 +327,7 @@ info-regionMoneyBackBuyClick:
- "[bold]Selling payback[/bold]"
- " hover: Sell %region% and get back %moneyback%"
- " hover: %lang:action|Sell %region%|%"
- " command: /areashop sell %region%"
- " command: /areashop confirmsell --region %region%"
- ": [gray]%moneyback%[gray] (%moneybackpercent%% of the price)."
info-regionMoneyBackBuyJubilee:
- "[darkgreen][bold]►[reset] Selling: [gray]gives no Diamonds back (jubilee)."
@@ -322,7 +336,7 @@ info-regionMoneyBackBuyClickJubilee:
- "[bold]Sell[/bold]"
- " hover: Sell %region% (no Diamonds back during the jubilee)"
- " hover: %lang:action|Sell %region%|%"
- " command: /areashop sell %region%"
- " command: /areashop confirmsell --region %region%"
- ": [gray]gives no Diamonds back (jubilee)."
info-regionMoneyBackRent:
- "[darkgreen][bold]►[reset] Unrenting payback: [gray]%moneyback%[gray] (%moneybackpercent%% of the remaining time)."
@@ -706,4 +720,4 @@ update-playerNotify:
- "[bold]Github[/bold]"
- " hover: %lang:action|Go to the AreaShop Github Releases|%"
- " link: https://github.com/md5sha256/releases"
- " (and leave a review)."
- " (and leave a review)."
+3 -3
View File
@@ -216,7 +216,7 @@
- "[bold]Comprar por[/bold]"
- " hover: Comprar %region% por %price%"
- " hover: %lang:action|Comprar %region%|%"
- " command: /areashop buy %region%"
- " command: /areashop confirmbuy --region %region%"
- ": [gray]%price%."
"info-regionReselPrice": "[darkgreen][bold]►[reset] Precio de reventa: [gray]%resellprice% (puedes comprarla de %lang:player%)."
"info-regionFriends": "[darkgreen][bold]►[reset] Jugadores agregados: [gray]%0%."
@@ -233,7 +233,7 @@
- "[bold]Paga de venta[/bold]"
- " hover: Vender %region% y recuperar %moneyback%"
- " hover: %lang:action|Vender %region%|%"
- " command: /areashop sell %region%"
- " command: /areashop confirmsell --region %region%"
- ": [gray]%moneyback% (%moneybackpercent%% del precio)."
"info-regionMoneyBackRent": "[darkgreen][bold]►[reset] Paga por desalquilar: [gray]%moneyback% (%moneybackpercent%% del tiempo restante)."
"info-regionMoneyBackRentClick":
@@ -554,4 +554,4 @@
"greeting-forsale": "%region% puede ser comprada por %price%."
"greeting-bought": "%region% está comprada por %player%."
"greeting-resale": "%region% puede ser comprada por %resaleprice% al jugador %player%."
"update-playerNotify": "[darkgreen]Hay una actualización disponible para AreaShop (V%0% - %1%). Consigue la más reciente en https://github.com/NLthijs48/AreaShop/releases."
"update-playerNotify": "[darkgreen]Hay una actualización disponible para AreaShop (V%0% - %1%). Consigue la más reciente en https://github.com/NLthijs48/AreaShop/releases."
+3 -3
View File
@@ -216,7 +216,7 @@
- "[bold]Prix d'achat[/bold]"
- " hover: Acheter%region% pour %price%"
- " hover: %lang:action|Acheter %region%|%"
- " command: /areashop buy %region%"
- " command: /areashop confirmbuy --region %region%"
- ": [gray]%price%."
"info-regionReselPrice": "[darkgreen][bold]►[reset] Prix de revente : [gray]%resellprice% (vous pouvez l'acheter à %player%)."
"info-regionFriends": "[darkgreen][bold]►[reset] Ami(s) ajouté(s) : [gray]%0%."
@@ -233,7 +233,7 @@
- "[bold]Retour sur investissement de la vente[/bold]"
- " hover: Vendez %region% et recupérer %moneyback% de retour sur investissement"
- " hover: %lang:action|Vendre %region%|%"
- " command: /areashop sell %region%"
- " command: /areashop confirmsell --region %region%"
- ": [gray]%moneyback% (%moneybackpercent%% du prix)."
"info-regionMoneyBackRent": "[darkgreen][bold]►[reset] Remboursement de location : [gray]%moneyback% (%moneybackpercent%% du temps restant)"
"info-regionMoneyBackRentClick":
@@ -561,4 +561,4 @@
- "[bold]Spigot[/bold]"
- " hover: %lang:action|Aller à la page Spigot de AreaShop|%"
- " link: https://www.spigotmc.org/resources/areashop.2991/"
- "(et laissez un avis)."
- "(et laissez un avis)."
+3 -3
View File
@@ -216,7 +216,7 @@
- "[bold]Koop voor[/bold]"
- " hover: Koop %region% voor %price%"
- " hover: %lang:action|Koop %region%|%"
- " command: /areashop buy %region%"
- " command: /areashop confirmbuy --region %region%"
- ": [gray]%price%."
"info-regionReselPrice": "[darkgreen][bold]►[reset] Doorverkoop prijs: [gray]%resellprice% (je kunt het kopen van %lang:player%)."
"info-regionFriends": "[darkgreen][bold]►[reset] Toegevoegde vrienden: [gray]%0%."
@@ -233,7 +233,7 @@
- "[bold]Verkoop terugbetaling[/bold]"
- " hover: Verkoop %region% en krijg %moneyback% terug"
- " hover: %lang:action|Verkoop %region%|%"
- " command: /areashop sell %region%"
- " command: /areashop confirmsell --region %region%"
- ": [gray]%moneyback% (%moneybackpercent%% van de prijs)."
"info-regionMoneyBackRent": "[darkgreen][bold]►[reset] Stop met huren terugbetaling: [gray]%moneyback% (%moneybackpercent%% van de overgebleven tijd)."
"info-regionMoneyBackRentClick":
@@ -561,4 +561,4 @@
- "[bold]Spigot[/bold]"
- " hover: %lang:action|Ga naar de Spigot AreaShop pagina|%"
- " link: https://www.spigotmc.org/resources/areashop.2991/"
- " (en schrijf een review)."
- " (en schrijf een review)."
+3 -3
View File
@@ -182,7 +182,7 @@
- "[bold]Kjøp for[/bold]"
- " hover: Kjøp %region% for %price%"
- " hover: %lang:action|Buy %region%|%"
- " kommando: /areashop buy %region%"
- " kommando: /areashop confirmbuy --region %region%"
- ": [gray]%price%."
"info-regionReselPrice": "[darkgreen][bold]►[reset] Videresalgs pris: [gray]%resellprice% (du kan kjøpe den fra %lang:player%)."
"info-regionFriends": "[darkgreen][bold]►[reset] Venner lagt til: [gray]%0%."
@@ -199,7 +199,7 @@
- "[bold]Penger tilbake etter salg[/bold]"
- " hover: Selg %region% å få igjen %moneyback%"
- " hover: %lang:action|Sell %region%|%"
- " kommando: /areashop sell %region%"
- " kommando: /areashop confirmsell --region %region%"
- ": [gray]%moneyback% (%moneybackpercent%% av prisen)."
"info-regionMoneyBackRent": "[darkgreen][bold]►[reset] Penger tilbake fra leie: [gray]%moneyback% (%moneybackpercent%% fra gjenstående tid)."
"info-regionMoneyBackRentClick":
@@ -471,4 +471,4 @@
"greeting-forrent": "%region% kan bli leid for %price% per %duration%."
"greeting-rented": "%region% er leid av %player% til %until%."
"greeting-forsale": "%region% kan bli kjøpt for %price%."
"greeting-bought": "%region% er kjøpt av %player%."
"greeting-bought": "%region% er kjøpt av %player%."
+3 -3
View File
@@ -216,7 +216,7 @@
- "[bold]Kupno działki za[/bold]"
- " hover: Kup działkę %region% za %price%"
- " hover: %lang:action|Kup działkę %region%|%"
- " command: /areashop buy %region%"
- " command: /areashop confirmbuy --region %region%"
- ": [gray]%price%."
"info-regionReselPrice": "[darkgreen][bold]►[reset] Cena odkupienia: [gray]%resellprice% (możesz odkupić tę działkę od gracza %lang:player%)."
"info-regionFriends": "[darkgreen][bold]►[reset] Dodani gracze: [gray]%0%."
@@ -233,7 +233,7 @@
- "[bold]Zwrot przy sprzedaży[/bold]"
- " hover: Sprzedaj działkę %region% i otrzymaj zwrot %moneyback%"
- " hover: %lang:action|Sprzedaj działkę %region%|%"
- " command: /areashop sell %region%"
- " command: /areashop confirmsell --region %region%"
- ": [gray]%moneyback% (%moneybackpercent%% ceny)."
"info-regionMoneyBackRent": "[darkgreen][bold]►[reset] Zwrot przy zwolnieniu: [gray]%moneyback% (%moneybackpercent%% pozostałego czasu)."
"info-regionMoneyBackRentClick":
@@ -561,4 +561,4 @@
- "[bold]Spigota[/bold]"
- " hover: %lang:action|Przejdź do strony pluginu na Spigocie|%"
- " link: https://www.spigotmc.org/resources/areashop.2991/"
- " (i pozostaw recenzję pluginu)."
- " (i pozostaw recenzję pluginu)."
+3 -3
View File
@@ -206,7 +206,7 @@
- "[bold]Купить за[/bold]"
- " hover: Купить %region% за %price%"
- " hover: %lang:action|Купить %region%|%"
- " command: /areashop buy %region%"
- " command: /areashop confirmbuy --region %region%"
- ": [gray]%price%."
"info-regionReselPrice": "[darkgreen][bold]►[reset] Стоимость перепродажи: [gray]%resellprice% (вы можете купить его у %lang:player%)."
"info-regionFriends": "[darkgreen][bold]►[reset] Добавленные друзья: [gray]%0%."
@@ -223,7 +223,7 @@
- "[bold]Окупаемость продажи[/bold]"
- " hover: Продать %region% и получить обратно %moneyback%"
- " hover: %lang:action|Продать %region%|%"
- " command: /areashop sell %region%"
- " command: /areashop confirmsell --region %region%"
- ": [gray]%moneyback% (%moneybackpercent%% от стоимости)."
"info-regionMoneyBackRent": "[darkgreen][bold]►[reset] Окупаемость снятия аренды: [gray]%moneyback% (%moneybackpercent%% от оставшиеся времени)."
"info-regionMoneyBackRentClick":
@@ -530,4 +530,4 @@
- "[bold]Spigot[/bold]"
- " hover: %lang:action|Перейти к странице AreaShop на Spigot|%"
- " link: https://www.spigotmc.org/resources/areashop.2991/"
- " (И оставить отзыв)."
- " (И оставить отзыв)."
+3 -3
View File
@@ -189,7 +189,7 @@
- "[bold]Köp för[/bold]"
- " hover: Köp %region% för %price%"
- " hover: %lang:action|Köp %region%|%"
- " command: /areashop buy %region%"
- " command: /areashop confirmbuy --region %region%"
- ": [gray]%price%."
"info-regionReselPrice": "[darkgreen][bold]►[reset] Återsäljningspris: [gray]%resellprice% (du kan köpa den från %lang:player%)."
"info-regionFriends": "[darkgreen][bold]►[reset] Tillagda vänner: [gray]%0%."
@@ -206,7 +206,7 @@
- "[bold]Försäljning återbetalning[/bold]"
- " hover: Sälj %region% och få tillbaka %moneyback%"
- " hover: %lang:action|Sälj%region%|%"
- " command: /areashop sell %region%"
- " command: /areashop confirmsell --region %region%"
- ": [gray]%moneyback% (%moneybackpercent%% av priset)."
"info-regionMoneyBackRent": "[darkgreen][bold]►[reset] Avbruten hyras återbetalning: [gray]%moneyback% (%moneybackpercent%% av återstående tid)."
"info-regionMoneyBackRentClick":
@@ -489,4 +489,4 @@
"greeting-forrent": "%region% kan hyras för %price% per %duration%."
"greeting-rented": "%region% hyrs av %player% fram till %until%."
"greeting-forsale": "%region% kan köpas för %price%."
"greeting-bought": "%region% är köpt av %player%."
"greeting-bought": "%region% är köpt av %player%."
+3 -3
View File
@@ -205,7 +205,7 @@
- "[bold]Buy for[/bold]"
- " hover: Buy %region% for %price%"
- " hover: %lang:action|Buy %region%|%"
- " command: /areashop buy %region%"
- " command: /areashop confirmbuy --region %region%"
- ": [gray]%price%."
"info-regionReselPrice": "[darkgreen][bold]►[reset] 转售价格: [gray]%resellprice% (你可以购买 %lang:player%)."
"info-regionFriends": "[darkgreen][bold]►[reset] 添加好友: [gray]%0%."
@@ -222,7 +222,7 @@
- "[bold]点击执行出售和获得一部分金币[/bold]"
- " hover: 出售 %region% 可以收到:%moneyback% 金币"
- " hover: %lang:action|出售 %region%|%"
- " command: /areashop sell %region%"
- " command: /areashop confirmsell --region %region%"
- ": [gray]%moneyback% (%moneybackpercent%% 的价格)."
"info-regionMoneyBackRent": "[darkgreen][bold]►[reset] 放弃租用: [gray]%moneyback% (%moneybackpercent%% 剩余时间)."
"info-regionMoneyBackRentClick":
@@ -515,4 +515,4 @@
"greeting-forsale": "区域商店:&2&l%region%&r可以花费&2&l%price%&r金币购买."
"greeting-bought": "区域商店:&2&l%region%&r被&2&l%player%&r购买了."
"greeting-resale": "区域商店:&2&l%region%&r可以找&2&l%player%&r购买&2&l%resaleprice%&r."
"update-playerNotify": "[darkgreen]请更新AreaShop 版本%0% 到 %1% 版本 , 获取最新版本 https://github.com/NLthijs48/AreaShop/releases."
"update-playerNotify": "[darkgreen]请更新AreaShop 版本%0% 到 %1% 版本 , 获取最新版本 https://github.com/NLthijs48/AreaShop/releases."
+22 -22
View File
@@ -3,7 +3,7 @@ main: me.wiefferink.areashop.AreaShop
version: "${version}"
description: "Selling and renting WorldGuard regions to your players, highly configurable."
depend: [DiamondBank-OG, LuckPerms, WorldGuard, WorldEdit]
softdepend: [Multiverse-Core, FastAsyncWorldEdit, Essentials]
softdepend: [Multiverse-Core, FastAsyncWorldEdit, Essentials, Utilities-OG]
authors: [NLThijs48, md5sha256, Dartanman]
website: https://github.com/md5sha256/AreaShop
#commands:
@@ -152,30 +152,30 @@ permissions:
areashop.setduration.landlord:
description: Allows you to change the duration of a region that you are landlord of
default: false
areashop.teleport:
description: Teleport to your region
default: true
areashop.teleport:
description: Teleport to your region
default: false
areashop.teleportall:
description: Teleport to all regions
default: op
areashop.teleportsign:
description: Teleport to signs of regions you own
default: true
areashop.teleportsign:
description: Teleport to signs of regions you own
default: false
areashop.teleportsignall:
description: Teleport to signs of all regions
default: op
areashop.teleportfriend:
description: Teleport to regions where you are added as friend
default: true
areashop.teleportfriendsign:
description: Teleport to the sign of regions where you are added as friend
default: true
areashop.teleportavailable:
description: Teleport to regions which are available
default: true
areashop.teleportavailablesign:
description: Teleport to the sign of regions which are available
default: true
areashop.teleportfriend:
description: Teleport to regions where you are added as friend
default: false
areashop.teleportfriendsign:
description: Teleport to the sign of regions where you are added as friend
default: false
areashop.teleportavailable:
description: Teleport to regions which are available
default: false
areashop.teleportavailablesign:
description: Teleport to the sign of regions which are available
default: false
areashop.setteleport:
description: Set the teleport spot for your region
default: true
@@ -188,9 +188,9 @@ permissions:
areashop.tabcomplete:
description: Allows you to tabcomplete all commands (also where you dont have permission)
default: op
areashop.find:
description: Allows you to teleport to a free region (/as find)
default: true
areashop.find:
description: Allows you to teleport to a free region (/as find)
default: false
areashop.groupadd:
description: Allows you to add regions to groups
default: op