mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 02:55:17 +00:00
Null protection for ticks() -- probably should uses EnumSet.noneOf() but
you can also use null now to stop ticking. closes #77
This commit is contained in:
1 parent
c349d51923
commit
28a10ac340
1 file changed
+3
-2
@@ -29,6 +29,7 @@ import net.minecraft.src.ServerListenThread;
|
|||||||
import net.minecraft.src.ThreadServerApplication;
|
import net.minecraft.src.ThreadServerApplication;
|
||||||
import net.minecraft.src.World;
|
import net.minecraft.src.World;
|
||||||
|
|
||||||
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import com.google.common.base.Throwables;
|
import com.google.common.base.Throwables;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
@@ -96,7 +97,7 @@ public class FMLCommonHandler
|
|||||||
}
|
}
|
||||||
for (IScheduledTickHandler ticker : scheduledTicks)
|
for (IScheduledTickHandler ticker : scheduledTicks)
|
||||||
{
|
{
|
||||||
EnumSet<TickType> ticksToRun = EnumSet.copyOf(ticker.ticks());
|
EnumSet<TickType> ticksToRun = EnumSet.copyOf(Objects.firstNonNull(ticker.ticks(), EnumSet.noneOf(TickType.class)));
|
||||||
ticksToRun.removeAll(EnumSet.complementOf(ticks));
|
ticksToRun.removeAll(EnumSet.complementOf(ticks));
|
||||||
if (!ticksToRun.isEmpty())
|
if (!ticksToRun.isEmpty())
|
||||||
{
|
{
|
||||||
@@ -115,7 +116,7 @@ public class FMLCommonHandler
|
|||||||
}
|
}
|
||||||
for (IScheduledTickHandler ticker : scheduledTicks)
|
for (IScheduledTickHandler ticker : scheduledTicks)
|
||||||
{
|
{
|
||||||
EnumSet<TickType> ticksToRun = EnumSet.copyOf(ticker.ticks());
|
EnumSet<TickType> ticksToRun = EnumSet.copyOf(Objects.firstNonNull(ticker.ticks(), EnumSet.noneOf(TickType.class)));
|
||||||
ticksToRun.removeAll(EnumSet.complementOf(ticks));
|
ticksToRun.removeAll(EnumSet.complementOf(ticks));
|
||||||
if (!ticksToRun.isEmpty())
|
if (!ticksToRun.isEmpty())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user