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


Java EntityBat類代碼示例

本文整理匯總了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;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:20,代碼來源:Aura.java

示例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;
}
 
開發者ID:Moudoux,項目名稱:EMC,代碼行數:22,代碼來源:IEntity.java

示例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);
}
 
開發者ID:lerion13,項目名稱:witchery,代碼行數:23,代碼來源:EntityWitchProjectile.java

示例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));
}
 
開發者ID:rodolphito,項目名稱:Rival-Rebels-Mod,代碼行數:21,代碼來源:TileEntityReciever.java

示例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
			}
		}
	}
}
 
開發者ID:theishiopian,項目名稱:ForageCraft,代碼行數:20,代碼來源:SpawnHandler.java

示例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;
                }
            }
        }
    }
}
 
開發者ID:MagiciansArtificeTeam,項目名稱:Magicians-Artifice,代碼行數:19,代碼來源:RitualFlight.java

示例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)); 
}
 
開發者ID:NovaViper,項目名稱:ZeroQuest,代碼行數:17,代碼來源:BiomeGenBioZone.java

示例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));
}
 
開發者ID:NovaViper,項目名稱:ZeroQuest,代碼行數:20,代碼來源:BiomeGenDarkLand.java

示例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)); 
}
 
開發者ID:NovaViper,項目名稱:ZeroQuest,代碼行數:17,代碼來源:BiomeGenBlueNile.java

示例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)); 
}
 
開發者ID:NovaViper,項目名稱:ZeroQuest,代碼行數:17,代碼來源:BiomeGenDarkLand.java

示例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)); 
}
 
開發者ID:NovaViper,項目名稱:ZeroQuest,代碼行數:17,代碼來源:BiomeGenBioZone.java

示例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));
}
 
開發者ID:NovaViper,項目名稱:ZeroQuest,代碼行數:18,代碼來源:BiomeGenDarkLand.java

示例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);
            }
        }
    }
}
 
開發者ID:Lomeli12,項目名稱:MagicalRings,代碼行數:18,代碼來源:EntityHandler.java

示例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;
	}
}
 
開發者ID:hanetzer,項目名稱:CreepyPastaCraft,代碼行數:17,代碼來源:CPCBatHandler.java

示例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);
        }
    }
}
 
開發者ID:Draco18s,項目名稱:Decaying-World,代碼行數:17,代碼來源:Methane.java


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