Fix display of mod status at the server

This commit is contained in:
Christian 2014-04-30 22:47:10 -04:00
parent af73743eb7
commit ad3b232604
2 changed files with 8 additions and 2 deletions

View file

@ -89,6 +89,7 @@ import cpw.mods.fml.common.StartupQuery;
import cpw.mods.fml.common.WrongMinecraftVersionException;
import cpw.mods.fml.common.eventhandler.EventBus;
import cpw.mods.fml.common.network.FMLNetworkEvent;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.common.registry.GameData;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.common.toposort.ModSortingException;
@ -700,7 +701,8 @@ public class FMLClientHandler implements IFMLSidedHandler
modListBldr.put(modObj.get("modid").getAsString(), modObj.get("version").getAsString());
}
serverDataTag.put(data, new ExtendedServerListData(type, true, modListBldr.build(), !moddedClientAllowed));
Map<String,String> modListMap = modListBldr.build();
serverDataTag.put(data, new ExtendedServerListData(type, FMLNetworkHandler.checkModList(modListMap, Side.CLIENT) == null, modListMap, !moddedClientAllowed));
}
else
{

View file

@ -126,10 +126,14 @@ public class FMLNetworkHandler
public static String checkModList(FMLHandshakeMessage.ModList modListPacket, Side side)
{
Map<String,String> modList = modListPacket.modList();
return checkModList(modList, side);
}
public static String checkModList(Map<String,String> listData, Side side)
{
List<ModContainer> rejects = Lists.newArrayList();
for (Entry<ModContainer, NetworkModHolder> networkMod : NetworkRegistry.INSTANCE.registry().entrySet())
{
boolean result = networkMod.getValue().check(modList, side);
boolean result = networkMod.getValue().check(listData, side);
if (!result)
{
rejects.add(networkMod.getKey());