mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-21 18:25:12 +01:00
Renamed Player to APlayer to avoid conflict with bukkit Player class.
This commit is contained in:
parent
4be12da452
commit
c74b6720e9
@ -8,7 +8,7 @@ import us.tastybento.bskyblock.config.Settings;
|
||||
import us.tastybento.bskyblock.database.flatfile.FlatFileDatabase;
|
||||
import us.tastybento.bskyblock.database.mysql.MySQLDatabase;
|
||||
import us.tastybento.bskyblock.database.objects.Island;
|
||||
import us.tastybento.bskyblock.database.objects.Player;
|
||||
import us.tastybento.bskyblock.database.objects.APlayer;
|
||||
import us.tastybento.bskyblock.database.sqlite.SQLiteDatabase;
|
||||
|
||||
public abstract class ASBDatabase {
|
||||
@ -20,8 +20,8 @@ public abstract class ASBDatabase {
|
||||
return DatabaseType.FLATFILE.database;
|
||||
}
|
||||
|
||||
public abstract Player loadPlayerData(UUID uuid);
|
||||
public abstract void savePlayerData(Player player);
|
||||
public abstract APlayer loadPlayerData(UUID uuid);
|
||||
public abstract void savePlayerData(APlayer player);
|
||||
|
||||
public abstract Island loadIslandData(String location);
|
||||
public abstract void saveIslandData(Island island);
|
||||
|
@ -5,19 +5,19 @@ import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
import us.tastybento.bskyblock.BSkyBlock;
|
||||
import us.tastybento.bskyblock.database.objects.Player;
|
||||
import us.tastybento.bskyblock.database.objects.APlayer;
|
||||
|
||||
public class PlayersManager{
|
||||
|
||||
private BSkyBlock plugin;
|
||||
private ASBDatabase database;
|
||||
|
||||
private HashMap<UUID, Player> players;
|
||||
private HashMap<UUID, APlayer> players;
|
||||
|
||||
public PlayersManager(BSkyBlock plugin){
|
||||
this.plugin = plugin;
|
||||
database = ASBDatabase.getDatabase();
|
||||
players = new HashMap<UUID, Player>();
|
||||
players = new HashMap<UUID, APlayer>();
|
||||
}
|
||||
|
||||
public void load(){
|
||||
@ -30,13 +30,13 @@ public class PlayersManager{
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for(Entry<UUID, Player> entry : players.entrySet()){
|
||||
for(Entry<UUID, APlayer> entry : players.entrySet()){
|
||||
database.savePlayerData(entry.getValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
for(Entry<UUID, Player> entry : players.entrySet()){
|
||||
for(Entry<UUID, APlayer> entry : players.entrySet()){
|
||||
database.savePlayerData(entry.getValue());
|
||||
}
|
||||
}
|
||||
@ -47,7 +47,7 @@ public class PlayersManager{
|
||||
players.clear();
|
||||
}
|
||||
|
||||
public Player getPlayer(UUID uuid){
|
||||
public APlayer getPlayer(UUID uuid){
|
||||
return players.get(uuid);
|
||||
}
|
||||
}
|
||||
|
@ -6,18 +6,18 @@ import java.util.UUID;
|
||||
|
||||
import us.tastybento.bskyblock.database.ASBDatabase;
|
||||
import us.tastybento.bskyblock.database.objects.Island;
|
||||
import us.tastybento.bskyblock.database.objects.Player;
|
||||
import us.tastybento.bskyblock.database.objects.APlayer;
|
||||
|
||||
public class FlatFileDatabase extends ASBDatabase{
|
||||
|
||||
@Override
|
||||
public Player loadPlayerData(UUID uuid) {
|
||||
public APlayer loadPlayerData(UUID uuid) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void savePlayerData(Player player) {
|
||||
public void savePlayerData(APlayer player) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
@ -6,18 +6,18 @@ import java.util.UUID;
|
||||
|
||||
import us.tastybento.bskyblock.database.ASBDatabase;
|
||||
import us.tastybento.bskyblock.database.objects.Island;
|
||||
import us.tastybento.bskyblock.database.objects.Player;
|
||||
import us.tastybento.bskyblock.database.objects.APlayer;
|
||||
|
||||
public class MySQLDatabase extends ASBDatabase{
|
||||
|
||||
@Override
|
||||
public Player loadPlayerData(UUID uuid) {
|
||||
public APlayer loadPlayerData(UUID uuid) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void savePlayerData(Player player) {
|
||||
public void savePlayerData(APlayer player) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import us.tastybento.bskyblock.config.Settings;
|
||||
* @author Tastybento
|
||||
* @author Poslovitch
|
||||
*/
|
||||
public class Player {
|
||||
public class APlayer {
|
||||
private UUID uuid;
|
||||
|
||||
private String locale;
|
||||
@ -27,7 +27,7 @@ public class Player {
|
||||
* Constructor - initializes the variables
|
||||
* @param uuid - UUID of the player
|
||||
*/
|
||||
public Player(UUID uuid){
|
||||
public APlayer(UUID uuid){
|
||||
this.uuid = uuid;
|
||||
|
||||
this.locale = "";
|
@ -6,18 +6,18 @@ import java.util.UUID;
|
||||
|
||||
import us.tastybento.bskyblock.database.ASBDatabase;
|
||||
import us.tastybento.bskyblock.database.objects.Island;
|
||||
import us.tastybento.bskyblock.database.objects.Player;
|
||||
import us.tastybento.bskyblock.database.objects.APlayer;
|
||||
|
||||
public class SQLiteDatabase extends ASBDatabase{
|
||||
|
||||
@Override
|
||||
public Player loadPlayerData(UUID uuid) {
|
||||
public APlayer loadPlayerData(UUID uuid) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void savePlayerData(Player player) {
|
||||
public void savePlayerData(APlayer player) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user