mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-28 23:39:33 +00:00
Make env crash callables be usable from other mods.
Now takes a mod ID parameter which becomes 'ModID Environment' for the label.
This commit is contained in:
1 parent
adc2c9cb79
commit
f2fddff1dd
3 files changed
+14
-5
No files matched your search
@@ -79,12 +79,12 @@ public class EnvironmentChecks
|
||||
|
||||
if (modIds.size() == 0)
|
||||
{
|
||||
ICrashCallable callable = new CallableSuppConfig();
|
||||
ICrashCallable callable = new CallableSuppConfig(modId);
|
||||
FMLCommonHandler.instance().registerCrashCallable(callable);
|
||||
}
|
||||
else
|
||||
{
|
||||
ICrashCallable callable = new CallableUnsuppConfig(modIds);
|
||||
ICrashCallable callable = new CallableUnsuppConfig(modId, modIds);
|
||||
FMLCommonHandler.instance().registerCrashCallable(callable);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,13 @@ import cpw.mods.fml.common.ICrashCallable;
|
||||
public class CallableSuppConfig implements ICrashCallable
|
||||
{
|
||||
|
||||
private String modId;
|
||||
|
||||
public CallableSuppConfig(String modId)
|
||||
{
|
||||
this.modId = modId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String call () throws Exception
|
||||
{
|
||||
@@ -19,7 +26,7 @@ public class CallableSuppConfig implements ICrashCallable
|
||||
@Override
|
||||
public String getLabel ()
|
||||
{
|
||||
return "Mantle Env";
|
||||
return modId + " Environment";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,17 +8,19 @@ import java.util.List;
|
||||
public class CallableUnsuppConfig implements ICrashCallable
|
||||
{
|
||||
|
||||
private String modId;
|
||||
private List<String> modIds;
|
||||
|
||||
public CallableUnsuppConfig(List<String> modIds)
|
||||
public CallableUnsuppConfig(String modId, List<String> modIds)
|
||||
{
|
||||
this.modId = modId;
|
||||
this.modIds = modIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel ()
|
||||
{
|
||||
return "Mantle Environment";
|
||||
return modId + " Environment";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user