Fix display of mod status at the server
This commit is contained in:
parent
af73743eb7
commit
ad3b232604
2 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue