Add EntityToggleSwimEvent and isSwimming / setSwimming API

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2018-07-15 16:17:35 +10:00
parent 444ecb9903
commit 11cdaa50a3
3 changed files with 36 additions and 6 deletions

View File

@@ -1015,6 +1015,12 @@ public class CraftEventFactory {
return event;
}
public static EntityToggleSwimEvent callToggleSwimEvent(EntityLiving entity, boolean swimming) {
EntityToggleSwimEvent event = new EntityToggleSwimEvent((LivingEntity) entity.getBukkitEntity(), swimming);
entity.world.getServer().getPluginManager().callEvent(event);
return event;
}
public static AreaEffectCloudApplyEvent callAreaEffectCloudApplyEvent(EntityAreaEffectCloud cloud, List<LivingEntity> entities) {
AreaEffectCloudApplyEvent event = new AreaEffectCloudApplyEvent((AreaEffectCloud) cloud.getBukkitEntity(), entities);
cloud.world.getServer().getPluginManager().callEvent(event);