-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Woo, dynamic patching! This is pretty much a rewrite which includes:
- Loading patch info from a JSON file - Added an ugly UI for generating this file - Blacklist file also uses JSON and supports multiple blacklists - Removed the need for me to patch things :) - Can't remember the others There are still a few things I need to finish up and a few cases I should account for.
- Loading branch information
Showing
18 changed files
with
699 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.skcraft.alicefixes; | ||
|
||
import com.google.gson.Gson; | ||
import com.google.gson.GsonBuilder; | ||
import org.apache.commons.io.FileUtils; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.File; | ||
import java.io.FileReader; | ||
import java.io.FileWriter; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class Blacklist { | ||
|
||
private static File config; | ||
private static Map<String, int[]> blacklists = new HashMap<String, int[]>(); | ||
private static BlackLists lists = new BlackLists(); | ||
|
||
public static void load(File configDir) { | ||
try { | ||
Gson gson = new Gson(); | ||
config = new File(configDir, "Blacklists.json"); | ||
BufferedReader br = new BufferedReader(new FileReader(config)); | ||
BlackLists storedLists = gson.fromJson(br, BlackLists.class); | ||
if(storedLists != null) { | ||
blacklists.putAll(storedLists.blacklists); | ||
} | ||
br.close(); | ||
} | ||
catch(Throwable t) { | ||
t.printStackTrace(); | ||
} | ||
} | ||
|
||
public static void save() { | ||
Gson gson = new GsonBuilder().setPrettyPrinting().create(); | ||
try { | ||
lists.setBlacklists(blacklists); | ||
FileUtils.writeStringToFile(config, gson.toJson(lists)); | ||
} catch(Throwable t) { | ||
t.printStackTrace(); | ||
} | ||
} | ||
|
||
public static void addBlacklist(String key, int[] def) { | ||
if(!blacklists.containsKey(key)) { | ||
blacklists.put(key, def); | ||
} | ||
} | ||
|
||
public static int[] getBlacklist(String key) { | ||
return blacklists.get(key); | ||
} | ||
|
||
public static class BlackLists { | ||
private Map<String, int[]> blacklists = new HashMap(); | ||
|
||
public void setBlacklists(Map lists) { | ||
blacklists = lists; | ||
} | ||
} | ||
} |
35 changes: 0 additions & 35 deletions
35
src/main/java/com/skcraft/alicefixes/BreakerBlacklist.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/com/skcraft/alicefixes/jsongenerator/Generator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.skcraft.alicefixes.jsongenerator; | ||
|
||
import javax.swing.*; | ||
|
||
public class Generator { | ||
|
||
public static void main(String[] args) { | ||
SwingUtilities.invokeLater(new Runnable() { | ||
@Override | ||
public void run() { | ||
try{ | ||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); | ||
new GeneratorFrame().setVisible(true); | ||
} catch(Throwable t) { | ||
|
||
} | ||
} | ||
}); | ||
} | ||
} |
Oops, something went wrong.