Change snooper/crash report brand handling. fmlbranding now loads another string!
This commit is contained in:
parent
1bfb87a701
commit
41cd50d4c0
|
@ -38,6 +38,7 @@ import net.minecraft.world.World;
|
||||||
import net.minecraft.world.storage.SaveHandler;
|
import net.minecraft.world.storage.SaveHandler;
|
||||||
import net.minecraft.world.storage.WorldInfo;
|
import net.minecraft.world.storage.WorldInfo;
|
||||||
|
|
||||||
|
import com.google.common.base.Joiner;
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
@ -244,12 +245,9 @@ public class FMLCommonHandler
|
||||||
{
|
{
|
||||||
brd.addAll(sidedDelegate.getAdditionalBrandingInformation());
|
brd.addAll(sidedDelegate.getAdditionalBrandingInformation());
|
||||||
}
|
}
|
||||||
try {
|
if (Loader.instance().getFMLBrandingProperties().containsKey("fmlbranding"))
|
||||||
Properties props=new Properties();
|
{
|
||||||
props.load(getClass().getClassLoader().getResourceAsStream("fmlbranding.properties"));
|
brd.add(Loader.instance().getFMLBrandingProperties().get("fmlbranding"));
|
||||||
brd.add(props.getProperty("fmlbranding"));
|
|
||||||
} catch (Exception ex) {
|
|
||||||
// Ignore - no branding file found
|
|
||||||
}
|
}
|
||||||
int tModCount = Loader.instance().getModList().size();
|
int tModCount = Loader.instance().getModList().size();
|
||||||
int aModCount = Loader.instance().getActiveModList().size();
|
int aModCount = Loader.instance().getActiveModList().size();
|
||||||
|
@ -469,4 +467,20 @@ public class FMLCommonHandler
|
||||||
{
|
{
|
||||||
Loader.instance().serverStopped();
|
Loader.instance().serverStopped();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getModName()
|
||||||
|
{
|
||||||
|
List<String> modNames = Lists.newArrayListWithExpectedSize(3);
|
||||||
|
modNames.add("fml");
|
||||||
|
if (!noForge)
|
||||||
|
{
|
||||||
|
modNames.add("forge");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Loader.instance().getFMLBrandingProperties().containsKey("snooperbranding"))
|
||||||
|
{
|
||||||
|
modNames.add(Loader.instance().getFMLBrandingProperties().get("snooperbranding"));
|
||||||
|
}
|
||||||
|
return Joiner.on(',').join(modNames);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,6 +152,7 @@ public class Loader
|
||||||
private static File minecraftDir;
|
private static File minecraftDir;
|
||||||
private static List<String> injectedContainers;
|
private static List<String> injectedContainers;
|
||||||
private File loggingProperties;
|
private File loggingProperties;
|
||||||
|
private ImmutableMap<String, String> fmlBrandingProperties;
|
||||||
|
|
||||||
public static Loader instance()
|
public static Loader instance()
|
||||||
{
|
{
|
||||||
|
@ -821,4 +822,21 @@ public class Loader
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String,String> getFMLBrandingProperties()
|
||||||
|
{
|
||||||
|
if (fmlBrandingProperties == null)
|
||||||
|
{
|
||||||
|
Properties loaded = new Properties();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
loaded.load(getClass().getClassLoader().getResourceAsStream("fmlbranding.properties"));
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
// File not found - ignore
|
||||||
|
}
|
||||||
|
fmlBrandingProperties = Maps.fromProperties(loaded);
|
||||||
|
}
|
||||||
|
return fmlBrandingProperties;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue