本文整理匯總了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);
}