mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 00:56:47 +01:00
Made mcremove work for FlatFile (sort of).
This commit is contained in:
parent
6cc22a3b63
commit
7aa7de75a2
@ -73,9 +73,25 @@ public class McremoveCommand implements CommandExecutor {
|
|||||||
|
|
||||||
System.out.println("User "+playerName+" removed from MySQL DB!");
|
System.out.println("User "+playerName+" removed from MySQL DB!");
|
||||||
} else {
|
} else {
|
||||||
|
//FlatFile removal
|
||||||
|
//TODO: Properly remove users from FlatFile, it's going to be a huge bitch with how our FlatFile system works. Let's adopt SQLite support.
|
||||||
|
if(Bukkit.getServer().getPlayer(playerName) != null)
|
||||||
|
{
|
||||||
|
Player targetPlayer = Bukkit.getServer().getPlayer(playerName);
|
||||||
|
if(targetPlayer.isOnline())
|
||||||
|
{
|
||||||
|
Users.getProfile(targetPlayer).resetAllData();
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("[mcMMO] This command is not fully functional for FlatFile yet, the player needs to be online.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("[mcMMO] This command is not fully functional for FlatFile yet, the player needs to be online.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Force PlayerProfile stuff to update
|
||||||
if(Bukkit.getServer().getPlayer(playerName) != null)
|
if(Bukkit.getServer().getPlayer(playerName) != null)
|
||||||
{
|
{
|
||||||
Player targetPlayer = Bukkit.getServer().getPlayer(playerName);
|
Player targetPlayer = Bukkit.getServer().getPlayer(playerName);
|
||||||
|
@ -434,6 +434,31 @@ public class PlayerProfile
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void resetAllData()
|
||||||
|
{
|
||||||
|
//This will reset everything to default values and then save the information to FlatFile/MySQL
|
||||||
|
for(SkillType skillType : SkillType.values())
|
||||||
|
{
|
||||||
|
if(skillType == SkillType.ALL)
|
||||||
|
continue;
|
||||||
|
skills.put(skillType, 0);
|
||||||
|
skillsXp.put(skillType, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(AbilityType abilityType : AbilityType.values())
|
||||||
|
{
|
||||||
|
skillsDATS.put(abilityType, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Misc stuff
|
||||||
|
myspawn = "";
|
||||||
|
party = "";
|
||||||
|
myspawnworld = "";
|
||||||
|
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
|
||||||
public void addPlayer()
|
public void addPlayer()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user