Merge remote-tracking branch 'origin/master'

Conflicts:
	src/main/java/us/tastybento/bskyblock/database/ASBDatabase.java
	src/main/java/us/tastybento/bskyblock/database/IslandsManager.java
	src/main/java/us/tastybento/bskyblock/database/PlayersManager.java
	src/main/java/us/tastybento/bskyblock/database/flatfile/FlatFileDatabase.java
	src/main/java/us/tastybento/bskyblock/database/mysql/MySQLDatabase.java
	src/main/java/us/tastybento/bskyblock/database/sqlite/SQLiteDatabase.java
This commit is contained in:
tastybento 2017-05-21 00:08:38 -07:00
commit ed114a4333
14 changed files with 38 additions and 36 deletions

View File

@ -2,14 +2,16 @@ BSkyBlock
========== ==========
[![Build Status](https://travis-ci.org/tastybento/bskyblock.svg?branch=master)](https://travis-ci.org/tastybento/bskyblock) [![Build Status](https://travis-ci.org/tastybento/bskyblock.svg?branch=master)](https://travis-ci.org/tastybento/bskyblock)
A Skyblock Bukkit plugin for Minecraft derived from BSkyBlock! A Skyblock Bukkit plugin for Minecraft derived from the well-known ASkyBlock!
This is a survival game where the player starts with an island in the sky. This is a survival game where the player starts with an island in the sky.
BSkyBlock (Better SkyBlock) represents a turning point on ASkyBlock's history : Tastybento and Poslovitch thought and designed together this complete rewrite in order to provide a whole new way to play Skyblock.
**Discover today BSkyBlock, its gameplay overhaul, and enjoy the Skyblock revival!**
Bugs and Feature requests Bugs and Feature requests
========================= =========================
File bug and feature requests here: https://github.com/tastybento/BSkyBlock-Bugs-N-Features/issues File bug and feature requests here: https://github.com/tastybento/bskyblock/issues
Note for developers Note for developers
=================== ===================

View File

@ -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);

View File

@ -4,7 +4,7 @@ import org.bukkit.command.CommandSender;
import us.tastybento.bskyblock.BSkyBlock; import us.tastybento.bskyblock.BSkyBlock;
public class AdminCommand extends ASBCommand{ public class AdminCommand extends BSBCommand{
public AdminCommand(BSkyBlock plugin) { public AdminCommand(BSkyBlock plugin) {
super(plugin); super(plugin);

View File

@ -21,10 +21,10 @@ import us.tastybento.bskyblock.util.Util;
* *
* @author Poslovitch * @author Poslovitch
*/ */
public abstract class ASBCommand implements CommandExecutor, TabCompleter{ public abstract class BSBCommand implements CommandExecutor, TabCompleter{
private Map<String, CommandArgumentHandler> arguments; private Map<String, CommandArgumentHandler> arguments;
protected ASBCommand(BSkyBlock plugin){ protected BSBCommand(BSkyBlock plugin){
arguments = new HashMap<String, CommandArgumentHandler>(); arguments = new HashMap<String, CommandArgumentHandler>();
// Automatically register the help argument // Automatically register the help argument

View File

@ -18,7 +18,7 @@ import us.tastybento.bskyblock.util.VaultHelper;
* @author Tastybento * @author Tastybento
* @author Poslovitch * @author Poslovitch
*/ */
public class IslandCommand extends ASBCommand{ public class IslandCommand extends BSBCommand{
private BSkyBlock plugin; private BSkyBlock plugin;
public IslandCommand(BSkyBlock plugin) { public IslandCommand(BSkyBlock plugin) {

View 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);

View File

@ -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;

View File

@ -11,9 +11,9 @@ import us.tastybento.bskyblock.database.objects.Island;
import us.tastybento.bskyblock.database.objects.Players; import us.tastybento.bskyblock.database.objects.Players;
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;
} }
} }

View File

@ -16,7 +16,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 HashMap<UUID, Island> islandsByUUID; private HashMap<UUID, Island> islandsByUUID;
@ -30,7 +30,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>();
islandsByUUID = new HashMap<UUID, Island>(); islandsByUUID = new HashMap<UUID, Island>();
spawn = null; spawn = null;

View File

@ -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>>();
} }

View File

@ -18,7 +18,7 @@ import us.tastybento.bskyblock.util.VaultHelper;
public class PlayersManager{ public class PlayersManager{
private BSkyBlock plugin; private BSkyBlock plugin;
private ASBDatabase database; private BSBDatabase database;
private HashMap<UUID, Players> playerCache; private HashMap<UUID, Players> playerCache;
@ -31,7 +31,7 @@ public class PlayersManager{
*/ */
public PlayersManager(BSkyBlock plugin){ public PlayersManager(BSkyBlock plugin){
this.plugin = plugin; this.plugin = plugin;
database = ASBDatabase.getDatabase(); database = BSBDatabase.getDatabase();
playerCache = new HashMap<UUID, Players>(); playerCache = new HashMap<UUID, Players>();
} }

View File

@ -6,11 +6,11 @@ import java.util.UUID;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import us.tastybento.bskyblock.database.ASBDatabase; import us.tastybento.bskyblock.database.BSBDatabase;
import us.tastybento.bskyblock.database.objects.Island; import us.tastybento.bskyblock.database.objects.Island;
import us.tastybento.bskyblock.database.objects.Players; import us.tastybento.bskyblock.database.objects.Players;
public class FlatFileDatabase extends ASBDatabase{ public class FlatFileDatabase extends BSBDatabase{
@Override @Override
public UUID getUUID(String name, boolean adminCheck) { public UUID getUUID(String name, boolean adminCheck) {

View File

@ -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.BSBDatabase;
import us.tastybento.bskyblock.database.objects.Island; import us.tastybento.bskyblock.database.objects.Island;
import us.tastybento.bskyblock.database.objects.Players; import us.tastybento.bskyblock.database.objects.Players;
public class MySQLDatabase extends ASBDatabase{ public class MySQLDatabase extends BSBDatabase{
@Override @Override
public Players loadPlayerData(UUID uuid) { public Players loadPlayerData(UUID uuid) {

View File

@ -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.BSBDatabase;
import us.tastybento.bskyblock.database.objects.Island; import us.tastybento.bskyblock.database.objects.Island;
import us.tastybento.bskyblock.database.objects.Players; import us.tastybento.bskyblock.database.objects.Players;
public class SQLiteDatabase extends ASBDatabase{ public class SQLiteDatabase extends BSBDatabase{
@Override @Override
public Players loadPlayerData(UUID uuid) { public Players loadPlayerData(UUID uuid) {