mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-24 22:14:32 +00:00
Change from Cancelable to using a Result. This means you can force despawn mobs you
don't want around anymore. Also, deferred check to once every 20 ticks. May tune it down further or make it a config if this event is a lag issue.
This commit is contained in:
1 parent
ff655de27e
commit
d9ca67e162
3 files changed
+31
-15
No files matched your search
@@ -60,9 +60,11 @@ public class ForgeEventFactory
|
||||
return MinecraftForge.EVENT_BUS.post(new LivingSpawnEvent.SpecialSpawn(entity, world, x, y, z));
|
||||
}
|
||||
|
||||
public static boolean canEntityDespawn(EntityLiving entity)
|
||||
public static Result canEntityDespawn(EntityLiving entity)
|
||||
{
|
||||
return !MinecraftForge.EVENT_BUS.post(new AllowDespawn(entity));
|
||||
AllowDespawn event = new AllowDespawn(entity);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
return event.getResult();
|
||||
}
|
||||
|
||||
public static List getPotentialSpawns(WorldServer world, EnumCreatureType type, int x, int y, int z, List oldList)
|
||||
|
||||
Reference in new issue
Block a user