org.bukkit.entity.ComplexEntityPart Java Examples

The following examples show how to use org.bukkit.entity.ComplexEntityPart. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ControllableEnderDragonBase.java    From EntityAPI with GNU Lesser General Public License v3.0 6 votes vote down vote up
public ControllableEnderDragonBase(int id, EntityManager manager) {
    super(id, ControllableEntityType.ENDERDRAGON, manager);
    Bukkit.getPluginManager().registerEvents(new Listener() {

        @EventHandler
        public void onEntityExplode(EntityExplodeEvent event) {
            if (!shouldDestroyBlocks()) {
                Entity entity = event.getEntity();
                if (entity instanceof EnderDragon && entity.equals(getBukkitEntity())) {
                    event.setCancelled(true);
                } else if (entity instanceof ComplexEntityPart && ((ComplexEntityPart) entity).getParent().equals(getBukkitEntity())) {
                    event.setCancelled(true);
                }
            }
        }

    }, EntityAPI.getCore());
}
 
Example #2
Source File: CraftEnderDragon.java    From Kettle with GNU General Public License v3.0 5 votes vote down vote up
public Set<ComplexEntityPart> getParts() {
    Builder<ComplexEntityPart> builder = ImmutableSet.builder();

    for (MultiPartEntityPart part : getHandle().dragonPartArray) {
        builder.add((ComplexEntityPart) part.getBukkitEntity());
    }

    return builder.build();
}
 
Example #3
Source File: CraftEnderDragon.java    From Thermos with GNU General Public License v3.0 5 votes vote down vote up
public Set<ComplexEntityPart> getParts() {
    Builder<ComplexEntityPart> builder = ImmutableSet.builder();

    for (EntityDragonPart part : getHandle().dragonPartArray) {
        builder.add((ComplexEntityPart) part.getBukkitEntity());
    }

    return builder.build();
}