mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-25 18:17:46 +01:00
A few changes :3
This commit is contained in:
parent
25940bf5cf
commit
8b981cde75
@ -121,7 +121,8 @@ public class Leaderboard {
|
|||||||
String theLocation = "plugins/mcMMO/FlatFileStuff/Leaderboards/" + statName + ".mcmmo"; //$NON-NLS-1$ //$NON-NLS-2$
|
String theLocation = "plugins/mcMMO/FlatFileStuff/Leaderboards/" + statName + ".mcmmo"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
//CHECK IF THE FILE EXISTS
|
//CHECK IF THE FILE EXISTS
|
||||||
File theDir = new File(theLocation);
|
File theDir = new File(theLocation);
|
||||||
if(!theDir.exists()){
|
if(!theDir.exists())
|
||||||
|
{
|
||||||
//properties = new PropertiesFile(location);
|
//properties = new PropertiesFile(location);
|
||||||
FileWriter writer = null;
|
FileWriter writer = null;
|
||||||
try {
|
try {
|
||||||
|
@ -14,6 +14,8 @@ public class Users {
|
|||||||
private static volatile Users instance;
|
private static volatile Users instance;
|
||||||
protected static final Logger log = Logger.getLogger("Minecraft");
|
protected static final Logger log = Logger.getLogger("Minecraft");
|
||||||
String location = "plugins/mcMMO/FlatFileStuff/mcmmo.users";
|
String location = "plugins/mcMMO/FlatFileStuff/mcmmo.users";
|
||||||
|
String directory = "plugins/mcMMO/FlatFileStuff/";
|
||||||
|
String directoryb = "plugins/mcMMO/FlatFileStuff/Leaderboards/";
|
||||||
|
|
||||||
//public static ArrayList<PlayerProfile> players;
|
//public static ArrayList<PlayerProfile> players;
|
||||||
public static HashMap<Player, PlayerProfile> players = new HashMap<Player, PlayerProfile>();
|
public static HashMap<Player, PlayerProfile> players = new HashMap<Player, PlayerProfile>();
|
||||||
@ -36,14 +38,18 @@ public class Users {
|
|||||||
|
|
||||||
public void loadUsers()
|
public void loadUsers()
|
||||||
{
|
{
|
||||||
|
new File(directory).mkdir();
|
||||||
|
new File(directoryb).mkdir();
|
||||||
File theDir = new File(location);
|
File theDir = new File(location);
|
||||||
if(!theDir.exists()){
|
if(!theDir.exists())
|
||||||
|
{
|
||||||
//properties = new PropertiesFile(location);
|
//properties = new PropertiesFile(location);
|
||||||
FileWriter writer = null;
|
FileWriter writer = null;
|
||||||
try {
|
try {
|
||||||
writer = new FileWriter(location);
|
writer = new FileWriter(location);
|
||||||
//writer.write("#Storage place for user information\r\n");
|
//writer.write("#Storage place for user information\r\n");
|
||||||
} catch (Exception e) {
|
} catch (Exception e)
|
||||||
|
{
|
||||||
log.log(Level.SEVERE, "Exception while creating " + location, e);
|
log.log(Level.SEVERE, "Exception while creating " + location, e);
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
|
@ -50,7 +50,7 @@ public class PlayerProfile
|
|||||||
|
|
||||||
//Time to HashMap this shiz
|
//Time to HashMap this shiz
|
||||||
HashMap<String, Integer> stats = new HashMap<String, Integer>(); //Skills and XP
|
HashMap<String, Integer> stats = new HashMap<String, Integer>(); //Skills and XP
|
||||||
String location = "plugins/mcMMO/mcmmo.users";
|
String location = "plugins/mcMMO/FlatFileStuff/mcmmo.users";
|
||||||
|
|
||||||
public PlayerProfile(Player player)
|
public PlayerProfile(Player player)
|
||||||
{
|
{
|
||||||
|
@ -116,8 +116,6 @@ public class Skills {
|
|||||||
}
|
}
|
||||||
public static void monitorSkills(Player player){
|
public static void monitorSkills(Player player){
|
||||||
PlayerProfile PP = Users.getProfile(player);
|
PlayerProfile PP = Users.getProfile(player);
|
||||||
if(PP == null)
|
|
||||||
Users.addUser(player);
|
|
||||||
if(PP != null)
|
if(PP != null)
|
||||||
{
|
{
|
||||||
if(PP.getHoePreparationMode() && System.currentTimeMillis() - PP.getHoePreparationATS() >= 4000){
|
if(PP.getHoePreparationMode() && System.currentTimeMillis() - PP.getHoePreparationATS() >= 4000){
|
||||||
|
Loading…
Reference in New Issue
Block a user