本文整理汇总了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
}
}
示例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;
}
示例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;
}
示例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));
}
示例5: isMobType
import net.minecraft.entity.Entity; //导入方法依赖的package包/类
@Override
public boolean isMobType(Entity entity) {
return entity.isCreatureType(EnumCreatureType.MONSTER, false);
}
示例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);
}