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