mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
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:
1 parent
f1e3481c0a
commit
6bc367f005
2 files changed
+16
-2
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user