mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 03:30:10 +00:00
Finish Syncing Project
No new features, just forgot to commit some files.
This commit is contained in:
parent
cdb36052c7
commit
c6824193fe
3 changed files with 47 additions and 0 deletions
Binary file not shown.
|
@ -1,5 +1,15 @@
|
|||
package com.projectkorra.ProjectKorra;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -219,6 +229,41 @@ public class Methods {
|
|||
DBConnection.sql.modifyQuery("UPDATE pk_players SET permaremoved = 'false' WHERE uuid = '" + uuid + "'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void deserializeFile() {
|
||||
File readFile = new File(".", "bendingPlayers.yml");
|
||||
File writeFile = new File(".", "converted.yml");
|
||||
if (readFile.exists()) {
|
||||
// plugin.log.info("File exists");
|
||||
try
|
||||
{
|
||||
DataInputStream input = new DataInputStream(new FileInputStream(readFile));
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(input));
|
||||
|
||||
DataOutputStream output = new DataOutputStream(new FileOutputStream(writeFile));
|
||||
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output));
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null)
|
||||
{
|
||||
if (!line.trim().contains("==: BendingPlayer"))
|
||||
{
|
||||
writer.write(line + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
reader.close();
|
||||
input.close();
|
||||
writer.close();
|
||||
output.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void stopBending() {
|
||||
List<AbilityModule> abilities = AbilityModuleManager.ability;
|
||||
|
|
|
@ -49,6 +49,8 @@ public class ProjectKorra extends JavaPlugin {
|
|||
} catch (IOException e) {
|
||||
// Failed to submit the stats :-(
|
||||
}
|
||||
|
||||
Methods.deserializeFile();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue