Fix static method, closes #271

Don't spam the log if a mod requests a ticket beyond their maximum. A single message is fine.
This commit is contained in:
Christian 2012-12-06 16:14:15 -05:00
parent f1e3481c0a
commit 6bc367f005
2 changed files with 16 additions and 2 deletions

View file

@ -97,6 +97,8 @@ public class ForgeChunkManager
private static Configuration config;
private static int playerTicketLength;
private static int dormantChunkCacheSize;
private static Set<String> warnedMods = Sets.newHashSet();
/**
* All mods requiring chunkloading need to implement this to handle the
* re-registration of chunk tickets at world loading time
@ -657,9 +659,10 @@ public class ForgeChunkManager
int allowedCount = ticketConstraints.containsKey(modId) ? ticketConstraints.get(modId) : defaultMaxCount;
if (tickets.get(world).get(modId).size() >= allowedCount)
if (tickets.get(world).get(modId).size() >= allowedCount && !warnedMods.contains(modId))
{
FMLLog.info("The mod %s has attempted to allocate a chunkloading ticket beyond it's currently allocated maximum : %d", modId, allowedCount);
warnedMods.add(modId);
return null;
}
Ticket ticket = new Ticket(modId, type, world);

View file

@ -67,13 +67,24 @@ public abstract class LiquidDictionary
* Get an immutable list of the liquids defined
*
* @return the defined liquids
* @see LiquidDictionary#getLiquids()
*/
@Deprecated
public Map<String, LiquidStack> getDefinedLiquids()
{
return ImmutableMap.copyOf(liquids);
return getLiquids();
}
/**
* Get an immutable list of the liquids defined
*
* @return the defined liquids
*/
public static Map<String, LiquidStack> getLiquids()
{
return ImmutableMap.copyOf(liquids);
}
/**
* Fired when a new liquid is created
*