mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-24 22:04:23 +00:00
format all the things!
This commit is contained in:
1 parent
54ec75fd3d
commit
b36c6dade6
377 files changed
+6833
-6772
No files matched your search
+9
-9
@@ -25,42 +25,42 @@ import minetweaker.runtime.IScriptProvider;
|
||||
*/
|
||||
public class ScriptProviderCustom implements IScriptProvider {
|
||||
private static final Charset UTF8 = Charset.forName("UTF-8");
|
||||
|
||||
|
||||
private final String moduleName;
|
||||
private final List<CustomScript> scripts;
|
||||
|
||||
|
||||
public ScriptProviderCustom(String moduleName) {
|
||||
this.moduleName = moduleName;
|
||||
scripts = new ArrayList<CustomScript>();
|
||||
}
|
||||
|
||||
|
||||
public void add(String name, byte[] content) {
|
||||
scripts.add(new CustomScript(name, content));
|
||||
}
|
||||
|
||||
|
||||
public void add(String name, String content) {
|
||||
add(name, content.getBytes(UTF8));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Iterator<IScriptIterator> getScripts() {
|
||||
return Collections.<IScriptIterator>singleton(new CustomScriptIterator()).iterator();
|
||||
}
|
||||
|
||||
|
||||
private class CustomScript {
|
||||
private final String name;
|
||||
private final byte[] content;
|
||||
|
||||
|
||||
public CustomScript(String name, byte[] content) {
|
||||
this.name = name;
|
||||
this.content = content;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private class CustomScriptIterator implements IScriptIterator {
|
||||
private CustomScript current;
|
||||
private final Iterator<CustomScript> iterator = scripts.iterator();
|
||||
|
||||
|
||||
@Override
|
||||
public String getGroupName() {
|
||||
return moduleName;
|
||||
|
||||
Reference in new issue
Block a user