net.minecraft.entity.boss.EntityWither Java Examples

The following examples show how to use net.minecraft.entity.boss.EntityWither. 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: Nyan.java    From CommunityMod with GNU Lesser General Public License v2.1 6 votes vote down vote up
private static Entity newNyanEntity(World world) {
	final int nextInt = random.nextInt(100);

	if(nextInt < 25) {
		return new EntityCow(world);
	}

	if(nextInt < 50) {
		return new EntityOvergrownSheep(world);
	}

	if(nextInt < 75) {
		return new EntityExplodingChicken(world);
	}

	if(nextInt < 95) {
		return new EntityOcelot(world);
	}

	if(nextInt < 99) {
		return new EntityGiantZombie(world);
	}

	return new EntityWither(world);
}
 
Example #2
Source File: CraftLivingEntity.java    From Kettle with GNU General Public License v3.0 6 votes vote down vote up
public boolean setLeashHolder(Entity holder) {
    if ((getHandle() instanceof EntityWither) || !(getHandle() instanceof EntityLiving)) {
        return false;
    }

    if (holder == null) {
        return unleash();
    }

    if (holder.isDead()) {
        return false;
    }

    unleash();
    ((EntityLiving) getHandle()).setLeashHolder(((CraftEntity) holder).getHandle(), true);
    return true;
}
 
Example #3
Source File: ActivationRange.java    From Kettle with GNU General Public License v3.0 6 votes vote down vote up
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config) {
    if (config == null && DimensionManager.getWorld(0) != null) {
        config = DimensionManager.getWorld(0).spigotConfig;
    } else {
        return true;
    }

    return ((entity.activationType == 3 && config.miscActivationRange == 0)
            || (entity.activationType == 2 && config.animalActivationRange == 0)
            || (entity.activationType == 1 && config.monsterActivationRange == 0)
            || entity instanceof EntityPlayer
            || entity instanceof EntityThrowable
            || entity instanceof MultiPartEntityPart
            || entity instanceof EntityWither
            || entity instanceof EntityFireball
            || entity instanceof EntityFallingBlock
            || entity instanceof EntityWeatherEffect
            || entity instanceof EntityTNTPrimed
            || entity instanceof EntityEnderCrystal
            || entity instanceof EntityFireworkRocket
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.CREATURE, false))
            && !entity.isCreatureType(EnumCreatureType.AMBIENT, false) && !entity.isCreatureType(EnumCreatureType.MONSTER, false)
            && !entity.isCreatureType(EnumCreatureType.WATER_CREATURE, false)
    );
}
 
Example #4
Source File: ActivationRange.java    From Thermos with GNU General Public License v3.0 5 votes vote down vote up
/**
 * These entities are excluded from Activation range checks.
 *
 * @param entity
 * @param world
 * @return boolean If it should always tick.
 */
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
{
    // Cauldron start - another fix for Proxy Worlds
    if (config == null && DimensionManager.getWorld(0) != null)
    {
        config = DimensionManager.getWorld(0).spigotConfig;
    }
    else
    {
        return true;
    }
    // Cauldron end

    if ( ( entity.activationType == 3 && config.miscActivationRange == 0 )
            || ( entity.activationType == 2 && config.animalActivationRange == 0 )
            || ( entity.activationType == 1 && config.monsterActivationRange == 0 )
            || (entity instanceof EntityPlayer && !(entity instanceof FakePlayer)) // Cauldron
            || entity instanceof EntityThrowable
            || entity instanceof EntityDragon
            || entity instanceof EntityDragonPart
            || entity instanceof EntityWither
            || entity instanceof EntityFireball
            || entity instanceof EntityWeatherEffect
            || entity instanceof EntityTNTPrimed
            || entity instanceof EntityFallingBlock // PaperSpigot - Always tick falling blocks
            || entity instanceof EntityEnderCrystal
            || entity instanceof EntityFireworkRocket
            || entity instanceof EntityVillager
            // Cauldron start - force ticks for entities with superclass of Entity and not a creature/monster
            || (entity.getClass().getSuperclass() == Entity.class && !entity.isCreatureType(EnumCreatureType.creature, false)
            && !entity.isCreatureType(EnumCreatureType.ambient, false) && !entity.isCreatureType(EnumCreatureType.monster, false)
            && !entity.isCreatureType(EnumCreatureType.waterCreature, false)))
    {
        return true;
    }

    return false;
}
 
Example #5
Source File: CraftWither.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public CraftWither(CraftServer server, EntityWither entity) {
    super(server, entity);
}
 
Example #6
Source File: CraftWither.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
@Override
public EntityWither getHandle() {
    return (EntityWither) entity;
}