Skip to content

Commit

Permalink
Library's visibility was set to package-specific
Browse files Browse the repository at this point in the history
"arch" variable substitution now happens inside library.getPath
and mods now need to decide based on library's name
  • Loading branch information
tomsik68 committed May 15, 2015
1 parent f18a690 commit adfeca0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package sk.tomsik68.mclauncher.api.mods;

import sk.tomsik68.mclauncher.impl.versions.mcdownload.Library;

import java.io.File;
import java.util.List;
Expand All @@ -25,10 +24,10 @@ public interface IModdingProfile {

/**
*
* @param library
* @param libraryName - Name of library to test
* @return True if specified library may be injected along with all vanilla libraries
*/
public boolean isLibraryAllowed(Library library);
public boolean isLibraryAllowed(String libraryName);

/**
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package sk.tomsik68.mclauncher.impl.common;

import sk.tomsik68.mclauncher.api.common.IOperatingSystem;
import sk.tomsik68.mclauncher.impl.versions.mcdownload.Library;

import java.util.HashMap;
import java.util.LinkedList;
Expand Down Expand Up @@ -38,7 +37,6 @@ public static IOperatingSystem getCurrentPlatform() {

public static void forcePlatform(IOperatingSystem p) {
currentOS = p;
Library.addLibraryPathVariable("arch", currentOS.getArchitecture());
}

public static String wrapName(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import java.util.ArrayList;
import java.util.HashMap;

public class Library {
private static final StringSubstitutor libraryPathSubstitutor = new StringSubstitutor("${%s}");
final class Library {
private final StringSubstitutor libraryPathSubstitutor = new StringSubstitutor("${%s}");
private final String name;
private final HashMap<String, String> natives = new HashMap<String, String>();
private final ArrayList<Rule> rules = new ArrayList<Rule>();
Expand Down Expand Up @@ -46,10 +46,6 @@ public Library(JSONObject json) {
}
}

public static void addLibraryPathVariable(String key, String value) {
libraryPathSubstitutor.setVariable(key, value);
}

public String getName() {
return name;
}
Expand All @@ -61,6 +57,7 @@ public String getNatives(IOperatingSystem os) {
}

public String getPath() {
libraryPathSubstitutor.setVariable("arch", Platform.getCurrentPlatform().getArchitecture());
String[] split = name.split(":");
StringBuilder result = new StringBuilder();

Expand Down

0 comments on commit adfeca0

Please sign in to comment.