Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // new imports
- import java.util.Collections;
- import java.util.Enumeration;
- import java.util.LinkedHashSet;
- import java.util.Properties;
- // Put anywhere in ModLoader.java
- /**
- * LinkedProperties retains the put order, loads and save
- * no problem and remains perfectly sound and stable.
- */
- public static class LinkedProperties extends Properties {
- private final LinkedHashSet<Object> keys = new LinkedHashSet<Object>();
- public Enumeration<Object> keys() {
- return Collections.<Object> enumeration(keys);
- }
- public Object put(Object key, Object value) {
- keys.add(key);
- return super.put(key, value);
- }
- }
- // --------------------------------------------------------------------------------------
- // Changed only one thing in the method marked by comment.
- // --------------------------------------------------------------------------------------
- private static void setupProperties(Class class1) throws IllegalArgumentException, IllegalAccessException, IOException, SecurityException, NoSuchFieldException, NoSuchAlgorithmException, DigestException {
- LinkedList linkedlist = new LinkedList();
- Properties properties = new LinkedProperties(); // This instead.
Advertisement