当前位置: 首页>>代码示例>>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;未经允许,请勿转载。