-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
204 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
src/main/java/sawfowl/guishopmanager/configure/locale/abstractlocale/Debug.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
package sawfowl.guishopmanager.configure.locale.abstractlocale; | ||
|
||
import org.spongepowered.api.item.inventory.ItemStack; | ||
|
||
public interface Debug { | ||
|
||
String errorTakeMoney(String player); | ||
|
||
String errorGiveMoney(String player); | ||
|
||
String infoTakeMoney(String player, double removed, double balance); | ||
String infoTakeMoney(ItemStack itemStack, String player, double removed, double balance); | ||
|
||
String infoGiveMoney(String player, double added, double balance); | ||
String infoGiveMoney(ItemStack itemStack, String player, double added, double balance); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/sawfowl/guishopmanager/configure/locale/def/ImplementDebug.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package sawfowl.guishopmanager.configure.locale.def; | ||
|
||
import org.spongepowered.api.item.ItemTypes; | ||
import org.spongepowered.api.item.inventory.ItemStack; | ||
import org.spongepowered.configurate.objectmapping.ConfigSerializable; | ||
import org.spongepowered.configurate.objectmapping.meta.Setting; | ||
|
||
import sawfowl.guishopmanager.configure.locale.PlaceholderKeys; | ||
import sawfowl.guishopmanager.configure.locale.abstractlocale.Debug; | ||
|
||
@ConfigSerializable | ||
public class ImplementDebug implements Debug { | ||
|
||
@Setting("ErrorTakeMoney") | ||
private String errorTakeMoney = "Failed to remove money from balance of player %player%."; | ||
@Setting("ErrorGiveMoney") | ||
private String errorGiveMoney = "Failed to add money to the balance of player %player%."; | ||
@Setting("InfoTakeMoney") | ||
private String infoTakeMoney = "Item [%item%]%amount% removed from inventory of player %player%&a. Added money %removed%. Balance %balance%."; | ||
@Setting("InfoGiveMoney") | ||
private String infoGiveMoney = "Item [%item%]%amount% added to inventory of player %player%. Removed money %removed%. Balance %balance%."; | ||
public ImplementDebug() {} | ||
|
||
@Override | ||
public String errorTakeMoney(String player) { | ||
return errorTakeMoney.replace(PlaceholderKeys.PLAYER, player); | ||
} | ||
|
||
@Override | ||
public String errorGiveMoney(String player) { | ||
return errorGiveMoney.replace(PlaceholderKeys.PLAYER, player); | ||
} | ||
|
||
@Override | ||
public String infoTakeMoney(ItemStack itemStack, String player, double removed, double balance) { | ||
return infoTakeMoney.replace(PlaceholderKeys.ITEM, ItemTypes.registry().valueKey(itemStack.type()).asString()).replace(PlaceholderKeys.AMOUNT, String.valueOf(itemStack.quantity())).replace(PlaceholderKeys.PLAYER, player).replace(PlaceholderKeys.REMOVED, String.valueOf(removed)).replace(PlaceholderKeys.BALANCE, String.valueOf(balance)); | ||
} | ||
|
||
@Override | ||
public String infoGiveMoney(ItemStack itemStack, String player, double added, double balance) { | ||
return infoGiveMoney.replace(PlaceholderKeys.ITEM, ItemTypes.registry().valueKey(itemStack.type()).asString()).replace(PlaceholderKeys.AMOUNT, String.valueOf(itemStack.quantity())).replace(PlaceholderKeys.PLAYER, player).replace(PlaceholderKeys.ADDED, String.valueOf(added)).replace(PlaceholderKeys.BALANCE, String.valueOf(balance)); | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/sawfowl/guishopmanager/configure/locale/def/ImplementGui.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package sawfowl.guishopmanager.configure.locale.def; | ||
|
||
import org.spongepowered.configurate.objectmapping.ConfigSerializable; | ||
import org.spongepowered.configurate.objectmapping.meta.Setting; | ||
|
||
import sawfowl.guishopmanager.configure.locale.abstractlocale.Gui; | ||
import sawfowl.guishopmanager.configure.locale.def.gui.*; | ||
|
||
@ConfigSerializable | ||
public class ImplementGui implements Gui { | ||
|
||
@Setting("Auction") | ||
private ImplementAuction auction = new ImplementAuction(); | ||
@Setting("Shop") | ||
private ImplementShop shop = new ImplementShop(); | ||
@Setting("CommandShop") | ||
private ImplementCommandShop commandShop = new ImplementCommandShop(); | ||
public ImplementGui() {} | ||
|
||
@Override | ||
public Auction auction() { | ||
return auction; | ||
} | ||
|
||
@Override | ||
public Shop shop() { | ||
return shop; | ||
} | ||
|
||
@Override | ||
public CommandShop commandShop() { | ||
return commandShop; | ||
} | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/sawfowl/guishopmanager/configure/locale/def/gui/ImplementAuction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package sawfowl.guishopmanager.configure.locale.def.gui; | ||
|
||
import org.spongepowered.configurate.objectmapping.ConfigSerializable; | ||
import org.spongepowered.configurate.objectmapping.meta.Setting; | ||
|
||
import net.kyori.adventure.text.Component; | ||
|
||
import sawfowl.guishopmanager.configure.locale.abstractlocale.Gui.Auction; | ||
import sawfowl.localeapi.api.TextUtils; | ||
|
||
@ConfigSerializable | ||
public class ImplementAuction implements Auction { | ||
|
||
@Setting("Auction") | ||
private Component auction = TextUtils.deserializeLegacy("&2Auction"); | ||
@Setting("Bet") | ||
private Component bet = TextUtils.deserializeLegacy("&2Bet"); | ||
@Setting("ReturnItems") | ||
private Component returnItems = TextUtils.deserializeLegacy("&2Return items"); | ||
@Setting("Edit") | ||
private Component edit = TextUtils.deserializeLegacy("&2Setting an item"); | ||
public ImplementAuction() {} | ||
|
||
@Override | ||
public Component auction() { | ||
return auction; | ||
} | ||
|
||
@Override | ||
public Component bet() { | ||
return bet; | ||
} | ||
|
||
@Override | ||
public Component returnItems() { | ||
return returnItems; | ||
} | ||
|
||
@Override | ||
public Component edit() { | ||
return edit; | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/sawfowl/guishopmanager/configure/locale/def/gui/ImplementCommandShop.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package sawfowl.guishopmanager.configure.locale.def.gui; | ||
|
||
import org.spongepowered.configurate.objectmapping.ConfigSerializable; | ||
import org.spongepowered.configurate.objectmapping.meta.Setting; | ||
|
||
import net.kyori.adventure.text.Component; | ||
|
||
import sawfowl.guishopmanager.configure.locale.abstractlocale.Gui.CommandShop; | ||
import sawfowl.localeapi.api.TextUtils; | ||
|
||
@ConfigSerializable | ||
public class ImplementCommandShop implements CommandShop { | ||
|
||
@Setting("Edit") | ||
private Component edit = TextUtils.deserializeLegacy("&2Setting of purchase commands"); | ||
public ImplementCommandShop() {} | ||
|
||
@Override | ||
public Component edit() { | ||
return edit; | ||
} | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/sawfowl/guishopmanager/configure/locale/def/gui/ImplementShop.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package sawfowl.guishopmanager.configure.locale.def.gui; | ||
|
||
import org.spongepowered.configurate.objectmapping.ConfigSerializable; | ||
import org.spongepowered.configurate.objectmapping.meta.Setting; | ||
|
||
import net.kyori.adventure.text.Component; | ||
|
||
import sawfowl.guishopmanager.configure.locale.abstractlocale.Gui.Shop; | ||
import sawfowl.localeapi.api.TextUtils; | ||
|
||
@ConfigSerializable | ||
public class ImplementShop implements Shop { | ||
|
||
@Setting("EditBuy") | ||
private Component editBuy = TextUtils.deserialize("&2Setting of purchase item"); | ||
@Setting("EditSell") | ||
private Component editSell = TextUtils.deserialize("&2Setting of sell item"); | ||
@Setting("BuyTransaction") | ||
private Component buyTransaction = TextUtils.deserialize("&2Buy"); | ||
@Setting("SellTransaction") | ||
private Component sellTransaction = TextUtils.deserialize("&2Sell"); | ||
public ImplementShop() {} | ||
|
||
@Override | ||
public Component editBuy() { | ||
return editBuy; | ||
} | ||
|
||
@Override | ||
public Component editSell() { | ||
return editSell; | ||
} | ||
|
||
@Override | ||
public Component buyTransaction() { | ||
return buyTransaction; | ||
} | ||
|
||
@Override | ||
public Component sellTransaction() { | ||
return sellTransaction; | ||
} | ||
|
||
} |