本文整理汇总了Java中net.minecraft.entity.passive.EntityBat类的典型用法代码示例。如果您正苦于以下问题:Java EntityBat类的具体用法?Java EntityBat怎么用?Java EntityBat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityBat类属于net.minecraft.entity.passive包,在下文中一共展示了EntityBat类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkValidity
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
private boolean checkValidity(final EntityLivingBase entity) {
if (entity == this.mc.thePlayer) {
return false;
}
if (!entity.isEntityAlive()) {
return false;
}
if (this.mc.thePlayer.getDistanceToEntity(entity) > this.range) {
return false;
}
if (!(entity instanceof EntityPlayer)) {
return (this.monsters && entity instanceof EntityMob) || (this.animals && (entity instanceof EntityAnimal || entity instanceof EntitySquid)) || (this.bats && entity instanceof EntityBat);
}
if (this.players) {
final EntityPlayer player = (EntityPlayer)entity;
return (this.friend && FriendManager.isFriend(player.getName())) || (!FriendManager.isFriend(player.getName()) && (!this.noArmor || this.hasArmor(player)));
}
return false;
}
示例2: getEntityColor
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
public Color getEntityColor() {
if ((entity instanceof EntityAnimal)) {
return Color.white;
}
if ((entity instanceof EntityMob)) {
return Color.red;
}
if ((entity instanceof EntitySlime)) {
return Color.green;
}
if ((entity instanceof EntityVillager)) {
return new Color(245, 245, 220);
}
if ((entity instanceof EntityBat)) {
return Color.BLACK;
}
if ((entity instanceof EntitySquid)) {
return Color.PINK;
}
return Color.white;
}
示例3: explodeBats
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
private void explodeBats(World world, int posX, int posY, int posZ, int side, boolean enhanced) {
int x = posX + (side == 4?-1:(side == 5?1:0));
int z = posZ + (side == 2?-1:(side == 3?1:0));
int y = posY + (side == 0?-1:(side == 1?1:0));
if(side == 1 && !world.getBlock(x, posY, z).getMaterial().isSolid()) {
--y;
}
int NUM_BATS = enhanced?14:10;
for(int i = 0; i < NUM_BATS; ++i) {
EntityBat bat = new EntityBat(world);
NBTTagCompound nbtBat = bat.getEntityData();
nbtBat.setBoolean("WITCNoDrops", true);
bat.setLocationAndAngles((double)x, (double)y, (double)z, 0.0F, 0.0F);
//LeRioN fix
if (!EventUtils.isInPrivate(world, x, y, z))
super.worldObj.spawnEntityInWorld(bat);
}
ParticleEffect.LARGE_EXPLODE.send(SoundEffect.MOB_ENDERMEN_PORTAL, world, 0.5D + (double)x, 0.5D + (double)y, 0.5D + (double)z, 3.0D, 3.0D, 16);
}
示例4: isValidTarget
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
private boolean isValidTarget(Entity e)
{
if (e == null) return false;
else if (e instanceof EntityPlayer)
{
EntityPlayer p = ((EntityPlayer) e);
if (p.capabilities.isCreativeMode) return false;
else
{
if (kPlayers) return true;
else if (!kTeam) return false;
RivalRebelsPlayer rrp = RivalRebels.round.rrplayerlist.getForName(((EntityPlayer) e).getCommandSenderName());
if (rrp == null) return kTeam;
if (rrp.rrteam == RivalRebelsTeam.NONE) return !p.getCommandSenderName().equals(username);
if (rrp.rrteam != team) return kTeam;
else return false;
}
}
else return (kMobs && (e instanceof EntityRhodes || (e instanceof EntityMob && !(e instanceof EntityAnimal) && !(e instanceof EntityBat) && !(e instanceof EntityVillager) && !(e instanceof EntitySquid)) || e instanceof EntityGhast));
}
示例5: spawnHandler
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
@SubscribeEvent
public void spawnHandler(LivingSpawnEvent.CheckSpawn event)
{
if((!(event.getEntity() instanceof EntityPlayer))&&(!(event.getWorld().isRemote)))
{
if(ScarecrowTracking.get(event.getWorld()).inRange(event.getEntity()))
{
if(event.getWorld().getBlockState(event.getEntity().getPosition()).getBlock()==Blocks.FARMLAND)
{
event.setResult(Result.DENY);
}
if(event.getEntity() instanceof EntityBat)
{
event.setResult(Result.DENY);
// I hate bats
}
}
}
}
示例6: uncontainedEffect
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void uncontainedEffect(int x, int y, int z, World world, EntityPlayer player) {
super.uncontainedEffect(x, y, z, world, player);
Vec3 cornerstone = Vec3.createVectorHelper(x,y,z);
List<Entity> playerMPs = world.loadedEntityList;
for (int i = 0; i < playerMPs.size();i++) {
Entity entity = playerMPs.get(i);
if (entity instanceof EntityLivingBase) {
if (!(entity instanceof EntityPlayer) && !(entity instanceof EntityBat) && !(entity instanceof EntityChicken)) {
Vec3 location = Vec3.createVectorHelper(entity.posX,entity.posY,entity.posZ);
if (location.distanceTo(cornerstone) < 100) {
entity.motionY += 3.0F;
}
}
}
}
}
示例7: BiomeGenBioZone
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
public BiomeGenBioZone(int id) {
super(id);
this.theBiomeDecorator.generateLakes = true;
this.theBiomeDecorator.treesPerChunk = 4;
this.spawnableMonsterList.clear();
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityZertum.class, 100, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 5, 1, 5));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 5, 1, 5));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 5, 1, 5));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 5, 1, 5));
}
示例8: BiomeGenDarkLand
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
public BiomeGenDarkLand(int id) {
super(id);
this.waterColorMultiplier = 0x666600;
this.theBiomeDecorator.treesPerChunk = 1;
this.theBiomeDecorator.grassPerChunk = 1;
this.theBiomeDecorator.flowersPerChunk = -999;
this.theBiomeDecorator.generateLakes = true;
this.spawnableMonsterList.clear();
this.spawnableCreatureList.clear();
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityDarkZertum.class, 100, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 60, 1, 5));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 1, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 20, 2, 3));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityGhast.class, 20, 1, 2));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityKurr.class, 10, 2, 2));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
}
示例9: BiomeGenBlueNile
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
public BiomeGenBlueNile(int id) {
super(id);
//topBlock = (byte)ModBlocks.nileGrass.blockID;
//fillerBlock = (byte)ModBlocks.nileDirt.blockID;
this.waterColorMultiplier = 0x003333;
this.theBiomeDecorator.treesPerChunk = 9;
this.theBiomeDecorator.grassPerChunk = 3;
this.theBiomeDecorator.flowersPerChunk = 2;
this.theBiomeDecorator.generateLakes = true;
this.spawnableMonsterList.clear();
this.spawnableCreatureList.add(new SpawnListEntry(EntityZertum.class, 100, 4, 4));
this.spawnableCreatureList.add(new SpawnListEntry(EntityBat.class, 5, 1, 5));
this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class, 5, 1, 5));
this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 5, 1, 5));
this.spawnableCreatureList.add(new SpawnListEntry(EntityPig.class, 5, 1, 5));
}
示例10: BiomeGenDarkLand
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
public BiomeGenDarkLand(int id) {
super(id);
//topBlock = (byte)ModBlocks.nileGrass.blockID;
//fillerBlock = (byte)ModBlocks.nileDirt.blockID;
this.waterColorMultiplier = 0x666600;
this.theBiomeDecorator.treesPerChunk = 1;
this.theBiomeDecorator.grassPerChunk = 1;
this.theBiomeDecorator.flowersPerChunk = -999;
this.theBiomeDecorator.generateLakes = true;
this.spawnableMonsterList.clear();
this.spawnableCreatureList.add(new SpawnListEntry(EntityDarkZertum.class, 100, 4, 4));
this.spawnableCreatureList.add(new SpawnListEntry(EntityBat.class, 5, 1, 5));
this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class, 5, 1, 5));
this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 5, 1, 5));
this.spawnableCreatureList.add(new SpawnListEntry(EntityPig.class, 5, 1, 5));
}
示例11: BiomeGenBioZone
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
public BiomeGenBioZone(int id) {
super(id);
this.theBiomeDecorator.generateLakes = true;
this.theBiomeDecorator.treesPerChunk = 4;
this.spawnableMonsterList.clear();
this.addFlower(ModBlocks.nileBlueFlower.getDefaultState(), 90);
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 5, 1, 5));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 5, 1, 5));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 5, 1, 5));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 5, 1, 5));
}
示例12: BiomeGenDarkLand
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
public BiomeGenDarkLand(int id) {
super(id);
this.waterColorMultiplier = 0x666600;
this.theBiomeDecorator.treesPerChunk = 1;
this.theBiomeDecorator.grassPerChunk = 1;
this.theBiomeDecorator.flowersPerChunk = -999;
this.addFlower(ModBlocks.nileBlackFlower.getDefaultState(), 100);
this.theBiomeDecorator.generateLakes = true;
this.spawnableMonsterList.clear();
this.spawnableCreatureList.clear();
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 60, 1, 5));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 1, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 20, 2, 3));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityGhast.class, 20, 1, 2));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
}
示例13: onDeath
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
@SubscribeEvent
public void onDeath(LivingDeathEvent event) {
if (!event.entityLiving.worldObj.isRemote) {
EntityLivingBase entity = event.entityLiving;
if (entity instanceof EntityBat) {
if (((EntityBat) entity).worldObj.rand.nextInt(100) < 80) {
EntityItem batWing = new EntityItem(((EntityBat) entity).worldObj, ((EntityBat) entity).posX, ((EntityBat) entity).posY, ((EntityBat) entity).posZ, new ItemStack(ModItems.materials));
((EntityBat) entity).worldObj.spawnEntityInWorld(batWing);
}
} else if (entity instanceof EntitySquid) {
if (((EntitySquid) entity).worldObj.rand.nextInt(100) < 60) {
EntityItem tentacle = new EntityItem(((EntitySquid) entity).worldObj, ((EntitySquid) entity).posX, ((EntitySquid) entity).posY, ((EntitySquid) entity).posZ, new ItemStack(ModItems.materials, 1, 4));
((EntitySquid) entity).worldObj.spawnEntityInWorld(tentacle);
}
}
}
}
示例14: batSpawnEvent
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
@SubscribeEvent
public void batSpawnEvent(LivingSpawnEvent event)
{
EntityLivingBase entity = event.entityLiving;
int rand = new Random().nextInt(5);
switch (rand){
case 0:
if (entity instanceof EntityBat)
{
event.setCanceled(true);
}
break;
default:
break;
}
}
示例15: onEntityCollidedWithBlock
import net.minecraft.entity.passive.EntityBat; //导入依赖的package包/类
@Override
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
if (!par1World.isRemote)
{
if (par5Entity instanceof EntityPlayer)
{
((EntityPlayer)par5Entity).addExhaustion(0.02F);
}
if ((par5Entity instanceof EntityChicken || par5Entity instanceof EntityBat) && (new Random().nextDouble() < 0.025))
{
par5Entity.attackEntityFrom(DamageSource.drown, 1);
}
}
}