mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-25 04:05:36 +01:00
Changed ASB classes prefix to BSB
This commit is contained in:
parent
7e8ffea32b
commit
3e381ec1f6
@ -7,9 +7,9 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.config.ASBLocale;
|
import us.tastybento.bskyblock.config.BSBLocale;
|
||||||
import us.tastybento.bskyblock.config.Settings;
|
import us.tastybento.bskyblock.config.Settings;
|
||||||
import us.tastybento.bskyblock.database.ASBDatabase;
|
import us.tastybento.bskyblock.database.BSBDatabase;
|
||||||
import us.tastybento.bskyblock.database.IslandsManager;
|
import us.tastybento.bskyblock.database.IslandsManager;
|
||||||
import us.tastybento.bskyblock.database.OfflineHistoryMessages;
|
import us.tastybento.bskyblock.database.OfflineHistoryMessages;
|
||||||
import us.tastybento.bskyblock.database.PlayersManager;
|
import us.tastybento.bskyblock.database.PlayersManager;
|
||||||
@ -23,7 +23,7 @@ import us.tastybento.bskyblock.util.VaultHelper;
|
|||||||
public class BSkyBlock extends JavaPlugin{
|
public class BSkyBlock extends JavaPlugin{
|
||||||
private static BSkyBlock plugin;
|
private static BSkyBlock plugin;
|
||||||
|
|
||||||
private HashMap<String, ASBLocale> locales = new HashMap<String, ASBLocale>();
|
private HashMap<String, BSBLocale> locales = new HashMap<String, BSBLocale>();
|
||||||
|
|
||||||
// Databases
|
// Databases
|
||||||
private PlayersManager playersManager;
|
private PlayersManager playersManager;
|
||||||
@ -116,7 +116,7 @@ public class BSkyBlock extends JavaPlugin{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return ASBDatabase.getDatabase().toString();
|
return BSBDatabase.getDatabase().toString();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -133,7 +133,7 @@ public class BSkyBlock extends JavaPlugin{
|
|||||||
* Returns an HashMap of locale identifier and the related object
|
* Returns an HashMap of locale identifier and the related object
|
||||||
* @return the locales
|
* @return the locales
|
||||||
*/
|
*/
|
||||||
public HashMap<String, ASBLocale> getLocales(){
|
public HashMap<String, BSBLocale> getLocales(){
|
||||||
return locales;
|
return locales;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ public class BSkyBlock extends JavaPlugin{
|
|||||||
* Returns the default locale
|
* Returns the default locale
|
||||||
* @return the default locale
|
* @return the default locale
|
||||||
*/
|
*/
|
||||||
public ASBLocale getLocale(){
|
public BSBLocale getLocale(){
|
||||||
return locales.get(Settings.defaultLanguage);
|
return locales.get(Settings.defaultLanguage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ public class BSkyBlock extends JavaPlugin{
|
|||||||
* @param sender - CommandSender to get the locale
|
* @param sender - CommandSender to get the locale
|
||||||
* @return if sender is a player, the player's locale, otherwise the default locale
|
* @return if sender is a player, the player's locale, otherwise the default locale
|
||||||
*/
|
*/
|
||||||
public ASBLocale getLocale(CommandSender sender){
|
public BSBLocale getLocale(CommandSender sender){
|
||||||
if(sender instanceof Player) return getLocale(((Player) sender).getUniqueId());
|
if(sender instanceof Player) return getLocale(((Player) sender).getUniqueId());
|
||||||
else return getLocale();
|
else return getLocale();
|
||||||
}
|
}
|
||||||
@ -160,7 +160,7 @@ public class BSkyBlock extends JavaPlugin{
|
|||||||
* @param player - Player to get the locale
|
* @param player - Player to get the locale
|
||||||
* @return the locale for this player
|
* @return the locale for this player
|
||||||
*/
|
*/
|
||||||
public ASBLocale getLocale(UUID player){
|
public BSBLocale getLocale(UUID player){
|
||||||
String locale = getPlayers().getPlayer(player).getLocale();
|
String locale = getPlayers().getPlayer(player).getLocale();
|
||||||
if(locale.isEmpty() || !locales.containsKey(locale)) return locales.get(Settings.defaultLanguage);
|
if(locale.isEmpty() || !locales.containsKey(locale)) return locales.get(Settings.defaultLanguage);
|
||||||
|
|
||||||
|
4
src/main/java/us/tastybento/bskyblock/config/ASBLocale.java → src/main/java/us/tastybento/bskyblock/config/BSBLocale.java
Executable file → Normal file
4
src/main/java/us/tastybento/bskyblock/config/ASBLocale.java → src/main/java/us/tastybento/bskyblock/config/BSBLocale.java
Executable file → Normal file
@ -15,7 +15,7 @@ import us.tastybento.bskyblock.BSkyBlock;
|
|||||||
* @author Tastybento
|
* @author Tastybento
|
||||||
* @author Poslovitch
|
* @author Poslovitch
|
||||||
*/
|
*/
|
||||||
public class ASBLocale {
|
public class BSBLocale {
|
||||||
|
|
||||||
private BSkyBlock plugin;
|
private BSkyBlock plugin;
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ public class ASBLocale {
|
|||||||
* @param plugin
|
* @param plugin
|
||||||
* @param localeName - name of the yaml file that will be used
|
* @param localeName - name of the yaml file that will be used
|
||||||
*/
|
*/
|
||||||
public ASBLocale(BSkyBlock plugin, String localeID){
|
public BSBLocale(BSkyBlock plugin, String localeID){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.localeID = localeID;
|
this.localeID = localeID;
|
||||||
getLocale(localeID);
|
getLocale(localeID);
|
@ -3,7 +3,7 @@ package us.tastybento.bskyblock.config;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.database.ASBDatabase.DatabaseType;
|
import us.tastybento.bskyblock.database.BSBDatabase.DatabaseType;
|
||||||
import us.tastybento.bskyblock.database.OfflineHistoryMessages.HistoryMessageType;
|
import us.tastybento.bskyblock.database.OfflineHistoryMessages.HistoryMessageType;
|
||||||
import us.tastybento.bskyblock.database.objects.Island.SettingsFlag;
|
import us.tastybento.bskyblock.database.objects.Island.SettingsFlag;
|
||||||
|
|
||||||
|
@ -11,9 +11,9 @@ import us.tastybento.bskyblock.database.objects.Island;
|
|||||||
import us.tastybento.bskyblock.database.objects.APlayer;
|
import us.tastybento.bskyblock.database.objects.APlayer;
|
||||||
import us.tastybento.bskyblock.database.sqlite.SQLiteDatabase;
|
import us.tastybento.bskyblock.database.sqlite.SQLiteDatabase;
|
||||||
|
|
||||||
public abstract class ASBDatabase {
|
public abstract class BSBDatabase {
|
||||||
|
|
||||||
public static ASBDatabase getDatabase(){
|
public static BSBDatabase getDatabase(){
|
||||||
for(DatabaseType type : DatabaseType.values()){
|
for(DatabaseType type : DatabaseType.values()){
|
||||||
if(type == Settings.databaseType) return type.database;
|
if(type == Settings.databaseType) return type.database;
|
||||||
}
|
}
|
||||||
@ -34,9 +34,9 @@ public abstract class ASBDatabase {
|
|||||||
MYSQL(new MySQLDatabase()),
|
MYSQL(new MySQLDatabase()),
|
||||||
SQLITE(new SQLiteDatabase());
|
SQLITE(new SQLiteDatabase());
|
||||||
|
|
||||||
ASBDatabase database;
|
BSBDatabase database;
|
||||||
|
|
||||||
DatabaseType(ASBDatabase database){
|
DatabaseType(BSBDatabase database){
|
||||||
this.database = database;
|
this.database = database;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -12,7 +12,7 @@ import us.tastybento.bskyblock.database.objects.Island;
|
|||||||
public class IslandsManager {
|
public class IslandsManager {
|
||||||
|
|
||||||
private BSkyBlock plugin;
|
private BSkyBlock plugin;
|
||||||
private ASBDatabase database;
|
private BSBDatabase database;
|
||||||
|
|
||||||
private HashMap<Location, Island> islands;
|
private HashMap<Location, Island> islands;
|
||||||
private Island spawn;
|
private Island spawn;
|
||||||
@ -22,7 +22,7 @@ public class IslandsManager {
|
|||||||
|
|
||||||
public IslandsManager(BSkyBlock plugin){
|
public IslandsManager(BSkyBlock plugin){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
database = ASBDatabase.getDatabase();
|
database = BSBDatabase.getDatabase();
|
||||||
islands = new HashMap<Location, Island>();
|
islands = new HashMap<Location, Island>();
|
||||||
spawn = null;
|
spawn = null;
|
||||||
}
|
}
|
||||||
|
@ -18,14 +18,14 @@ import us.tastybento.bskyblock.config.Settings;
|
|||||||
*/
|
*/
|
||||||
public class OfflineHistoryMessages {
|
public class OfflineHistoryMessages {
|
||||||
private BSkyBlock plugin;
|
private BSkyBlock plugin;
|
||||||
private ASBDatabase database;
|
private BSBDatabase database;
|
||||||
|
|
||||||
// Offline Messages
|
// Offline Messages
|
||||||
private HashMap<UUID, List<String>> messages;
|
private HashMap<UUID, List<String>> messages;
|
||||||
|
|
||||||
public OfflineHistoryMessages(BSkyBlock plugin){
|
public OfflineHistoryMessages(BSkyBlock plugin){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
database = ASBDatabase.getDatabase();
|
database = BSBDatabase.getDatabase();
|
||||||
messages = new HashMap<UUID, List<String>>();
|
messages = new HashMap<UUID, List<String>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,13 +10,13 @@ import us.tastybento.bskyblock.database.objects.APlayer;
|
|||||||
public class PlayersManager{
|
public class PlayersManager{
|
||||||
|
|
||||||
private BSkyBlock plugin;
|
private BSkyBlock plugin;
|
||||||
private ASBDatabase database;
|
private BSBDatabase database;
|
||||||
|
|
||||||
private HashMap<UUID, APlayer> players;
|
private HashMap<UUID, APlayer> players;
|
||||||
|
|
||||||
public PlayersManager(BSkyBlock plugin){
|
public PlayersManager(BSkyBlock plugin){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
database = ASBDatabase.getDatabase();
|
database = BSBDatabase.getDatabase();
|
||||||
players = new HashMap<UUID, APlayer>();
|
players = new HashMap<UUID, APlayer>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,11 +4,11 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.database.ASBDatabase;
|
|
||||||
import us.tastybento.bskyblock.database.objects.Island;
|
import us.tastybento.bskyblock.database.objects.Island;
|
||||||
|
import us.tastybento.bskyblock.database.BSBDatabase;
|
||||||
import us.tastybento.bskyblock.database.objects.APlayer;
|
import us.tastybento.bskyblock.database.objects.APlayer;
|
||||||
|
|
||||||
public class FlatFileDatabase extends ASBDatabase{
|
public class FlatFileDatabase extends BSBDatabase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public APlayer loadPlayerData(UUID uuid) {
|
public APlayer loadPlayerData(UUID uuid) {
|
||||||
|
@ -4,11 +4,11 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.database.ASBDatabase;
|
|
||||||
import us.tastybento.bskyblock.database.objects.Island;
|
import us.tastybento.bskyblock.database.objects.Island;
|
||||||
|
import us.tastybento.bskyblock.database.BSBDatabase;
|
||||||
import us.tastybento.bskyblock.database.objects.APlayer;
|
import us.tastybento.bskyblock.database.objects.APlayer;
|
||||||
|
|
||||||
public class MySQLDatabase extends ASBDatabase{
|
public class MySQLDatabase extends BSBDatabase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public APlayer loadPlayerData(UUID uuid) {
|
public APlayer loadPlayerData(UUID uuid) {
|
||||||
|
@ -4,11 +4,11 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.database.ASBDatabase;
|
|
||||||
import us.tastybento.bskyblock.database.objects.Island;
|
import us.tastybento.bskyblock.database.objects.Island;
|
||||||
|
import us.tastybento.bskyblock.database.BSBDatabase;
|
||||||
import us.tastybento.bskyblock.database.objects.APlayer;
|
import us.tastybento.bskyblock.database.objects.APlayer;
|
||||||
|
|
||||||
public class SQLiteDatabase extends ASBDatabase{
|
public class SQLiteDatabase extends BSBDatabase{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public APlayer loadPlayerData(UUID uuid) {
|
public APlayer loadPlayerData(UUID uuid) {
|
||||||
|
Loading…
Reference in New Issue
Block a user