Add an entity blacklist for the Teleposer (#701)

Added event for when an entity is teleposed. Includes a Post version as well to allow modification of the entity after the fact.
This commit is contained in:
Nicholas Ignoffo 2016-05-11 20:29:16 -07:00
parent cfce1a4a6c
commit 9253d6a410
4 changed files with 76 additions and 9 deletions

View file

@ -482,6 +482,17 @@ public class EventHandler
event.setCanceled(true);
}
@SubscribeEvent
public void onTeleposeEntity(TeleposeEvent.Ent event) {
if (ConfigHandler.teleposerBlacklistEntity.contains(event.entity.getClass().getSimpleName()))
event.setCanceled(true);
}
@SubscribeEvent
public void onTeleposeEntityPost(TeleposeEvent.Ent.Post event) {
event.entity.timeUntilPortal = 5;
}
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent event)
{