當前位置: 首頁>>代碼示例>>Java>>正文


Java Entity.isCreatureType方法代碼示例

本文整理匯總了Java中net.minecraft.entity.Entity.isCreatureType方法的典型用法代碼示例。如果您正苦於以下問題:Java Entity.isCreatureType方法的具體用法?Java Entity.isCreatureType怎麽用?Java Entity.isCreatureType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.entity.Entity的用法示例。


在下文中一共展示了Entity.isCreatureType方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initializeEntityActivationType

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * Initializes an entities type on construction to specify what group this
 * entity is in for activation ranges.
 *
 * @param entity
 * @return group id
 */
public static byte initializeEntityActivationType(Entity entity)
{
    Chunk chunk = null;
    // Cauldron start - account for entities that dont extend EntityMob, EntityAmbientCreature, EntityCreature
    if ( entity instanceof EntityMob || entity instanceof EntitySlime || entity.isCreatureType(EnumCreatureType.monster, false)) // Cauldron - account for entities that dont extend EntityMob
    {
        return 1; // Monster
    } else if ( entity instanceof EntityCreature || entity instanceof EntityAmbientCreature || entity.isCreatureType(EnumCreatureType.creature, false) 
             || entity.isCreatureType(EnumCreatureType.waterCreature, false) || entity.isCreatureType(EnumCreatureType.ambient, false))
    {
        return 2; // Animal
    // Cauldron end
    } else
    {
        return 3; // Misc
    }
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:25,代碼來源:ActivationRange.java

示例2: initializeEntityActivationState

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * 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 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;
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:45,代碼來源:ActivationRange.java

示例3: isMobType

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
@Override
public boolean isMobType(Entity entity) {
    return entity.isCreatureType(EnumCreatureType.CREATURE, false)
            || entity.isCreatureType(EnumCreatureType.AMBIENT, false)
            || entity.isCreatureType(EnumCreatureType.WATER_CREATURE, false)
            || entity instanceof EntityVillager
            || entity instanceof EntityGolem;
}
 
開發者ID:fr1kin,項目名稱:ForgeHax,代碼行數:9,代碼來源:FriendlyMob.java

示例4: isFriendlyMob

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * If the mob is friendly (not aggressive)
 */
public static boolean isFriendlyMob(Entity entity) {
    return (entity.isCreatureType(EnumCreatureType.CREATURE, false) && !EntityUtils.isNeutralMob(entity)) ||
            (entity.isCreatureType(EnumCreatureType.AMBIENT, false) && !isBatsDisabled) ||
            entity instanceof EntityVillager ||
            entity instanceof EntityIronGolem ||
            (isNeutralMob(entity) && !EntityUtils.isMobAggressive(entity));
}
 
開發者ID:fr1kin,項目名稱:ForgeHax,代碼行數:11,代碼來源:EntityUtils.java

示例5: isMobType

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
@Override
public boolean isMobType(Entity entity) {
    return entity.isCreatureType(EnumCreatureType.MONSTER, false);
}
 
開發者ID:fr1kin,項目名稱:ForgeHax,代碼行數:5,代碼來源:HostileMob.java

示例6: isHostileMob

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * If the mob is hostile
 */
public static boolean isHostileMob(Entity entity) {
    return (entity.isCreatureType(EnumCreatureType.MONSTER, false) && !EntityUtils.isNeutralMob(entity)) ||
            EntityUtils.isMobAggressive(entity);
}
 
開發者ID:fr1kin,項目名稱:ForgeHax,代碼行數:8,代碼來源:EntityUtils.java


注:本文中的net.minecraft.entity.Entity.isCreatureType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。