All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bukkit.craftbukkit.entity.CraftEnderDragon Maven / Gradle / Ivy

The newest version!
package org.bukkit.craftbukkit.entity;

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSet.Builder;
import net.minecraft.server.EntityComplexPart;
import net.minecraft.server.EntityEnderDragon;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.ComplexEntityPart;
import org.bukkit.entity.EnderDragon;
import org.bukkit.entity.EntityType;

import java.util.Set;

public class CraftEnderDragon extends CraftComplexLivingEntity implements EnderDragon {
  public CraftEnderDragon(CraftServer server, EntityEnderDragon entity) {
    super(server, entity);
  }

  public Set getParts() {
    Builder builder = ImmutableSet.builder();

    for (EntityComplexPart part : getHandle().children) {
      builder.add((ComplexEntityPart) part.getBukkitEntity());
    }

    return builder.build();
  }

  @Override
  public EntityEnderDragon getHandle() {
    return (EntityEnderDragon) entity;
  }

  @Override
  public String toString() {
    return "CraftEnderDragon";
  }

  public EntityType getType() {
    return EntityType.ENDER_DRAGON;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy