Skip to content

Commit af1ddce

Browse files
committed
Update 0.3.3
1 parent e1d61f4 commit af1ddce

File tree

7 files changed

+79
-7
lines changed

7 files changed

+79
-7
lines changed

common/src/main/java/com/fox2code/foxloader/loader/Mod.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ public final ModContainer getModContainer() {
1616
return Objects.requireNonNull(modContainer == null ? ModContainer.tmp : modContainer);
1717
}
1818

19+
/**
20+
* @param configObject to use for the config screen.
21+
*/
22+
protected final void setConfigObject(Object configObject) {
23+
this.getModContainer().configObject = configObject;
24+
}
25+
26+
/**
27+
* @return Object to use for the config screen.
28+
*/
29+
public final Object getConfigObject() {
30+
return this.getModContainer().configObject;
31+
}
32+
1933
/**
2034
* @return mod logger
2135
*/

common/src/main/java/com/fox2code/foxloader/loader/ModContainer.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public final class ModContainer {
4343
Mod clientMod;
4444
String clientModCls;
4545
String clientMixins;
46+
Object configObject;
4647

4748
ModContainer(File file, String id, String name, String version, String description, String jitpack) {
4849
this(file, id, name, version, Semver.coerce(version), description, jitpack, false);
@@ -86,6 +87,10 @@ public String getFileName() {
8687
return this.file == null ? "built-in" : this.file.getName();
8788
}
8889

90+
public Object getConfigObject() {
91+
return configObject;
92+
}
93+
8994
void applyPrePatch() throws ReflectiveOperationException {
9095
if (prePatch != null) {
9196
PreClassTransformer preClassTransformer =
@@ -151,16 +156,17 @@ void loadLanguageTo(String lang, Properties target) {
151156

152157
private Mod initializeMod(String clsName) throws ReflectiveOperationException {
153158
if (clsName == null) return null;
154-
tmp = this;
155159
Mod mod;
160+
Class<? extends Mod> cls = Class.forName(clsName, false,
161+
FoxLauncher.getFoxClassLoader()).asSubclass(Mod.class);
156162
try {
157-
mod = Class.forName(clsName, false, FoxLauncher.getFoxClassLoader())
158-
.asSubclass(Mod.class).newInstance();
159-
LifecycleListener.register(mod);
160-
mod.modContainer = this;
163+
tmp = this;
164+
mod = cls.newInstance();
161165
} finally {
162166
tmp = null;
163167
}
168+
LifecycleListener.register(mod);
169+
mod.modContainer = this;
164170
return mod;
165171
}
166172

final/src/main/java/com/fox2code/foxloader/installer/InstallerGUI.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,9 @@ public void extractMMCInstance() {
320320
copy(Files.newInputStream(Main.currentInstallerFile.toPath()), zipOutputStream);
321321
zipOutputStream.closeEntry();
322322
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
323-
for (String entry : new String[]{"patches/com.fox2code.foxloader.json", "instance.cfg", "mmc-pack.json"}) {
323+
for (String entry : new String[]{"patches/com.fox2code.foxloader.json",
324+
"patches/net.minecraft.json", "patches/net.minecraftforge.json",
325+
"instance.cfg", "mmc-pack.json"}) {
324326
zipOutputStream.putNextEntry(new ZipEntry(entry));
325327
byteArrayOutputStream.reset();
326328
copyAndClose(InstallerGUI.class.getResourceAsStream(

final/src/main/resources/mmc/mmc-pack.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,30 @@
2020
"important": true,
2121
"uid": "com.fox2code.foxloader",
2222
"version": "#version#"
23+
},
24+
{
25+
"cachedName": "Workaround to prevent MultiMC Crash",
26+
"cachedRequires": [
27+
{
28+
"uid": "com.fox2code.foxloader"
29+
}
30+
],
31+
"cachedVersion": "no-op",
32+
"disabled": true,
33+
"uid": "net.minecraft",
34+
"version": "no-op"
35+
},
36+
{
37+
"cachedName": "Workaround to display CoreMods tab",
38+
"cachedRequires": [
39+
{
40+
"uid": "com.fox2code.foxloader"
41+
}
42+
],
43+
"cachedVersion": "no-op",
44+
"disabled": true,
45+
"uid": "net.minecraftforge",
46+
"version": "no-op"
2347
}
2448
],
2549
"formatVersion": 1
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"formatVersion": 1,
3+
"name": "Workaround to prevent MultiMC Crash",
4+
"releaseTime": "2011-07-08T00:00:00+02:00",
5+
"requires": [
6+
{
7+
"uid": "com.fox2code.foxloader"
8+
}
9+
],
10+
"type": "old_beta",
11+
"uid": "net.minecraft",
12+
"version": "no-op"
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"formatVersion": 1,
3+
"name": "Workaround to display CoreMods tab",
4+
"releaseTime": "2011-07-08T00:00:00+02:00",
5+
"requires": [
6+
{
7+
"uid": "com.fox2code.foxloader"
8+
}
9+
],
10+
"type": "old_beta",
11+
"uid": "net.minecraftforge",
12+
"version": "no-op"
13+
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ org.gradle.parallel=true
33
org.gradle.jvmargs=-Xmx1024m -XX:-UseGCOverheadLimit -Dfile.encoding=UTF-8
44

55
# FoxLoader properties
6-
foxloader.version=0.3.2
6+
foxloader.version=0.3.3
77
foxloader.lastReIndevTransformerChanges=0.3.0
88

99
# ReIndev properties

0 commit comments

Comments
 (0)