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


Java EntityCreeper類代碼示例

本文整理匯總了Java中net.minecraft.entity.monster.EntityCreeper的典型用法代碼示例。如果您正苦於以下問題:Java EntityCreeper類的具體用法?Java EntityCreeper怎麽用?Java EntityCreeper使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EntityCreeper類屬於net.minecraft.entity.monster包,在下文中一共展示了EntityCreeper類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: shouldAttackEntity

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:22,代碼來源:EntityWolf.java

示例2: getColorMultiplier

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
/**
 * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime
 */
protected int getColorMultiplier(EntityCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime)
{
    float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);

    if ((int)(f * 10.0F) % 2 == 0)
    {
        return 0;
    }
    else
    {
        int i = (int)(f * 0.2F * 255.0F);
        i = MathHelper.clamp_int(i, 0, 255);
        return i << 24 | 16777215;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:19,代碼來源:RenderCreeper.java

示例3: loadEntityShader

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
/**
 * What shader to use when spectating this entity
 */
public void loadEntityShader(Entity entityIn)
{
    if (OpenGlHelper.shadersSupported)
    {
        if (this.theShaderGroup != null)
        {
            this.theShaderGroup.deleteShaderGroup();
        }

        this.theShaderGroup = null;

        if (entityIn instanceof EntityCreeper)
        {
            this.loadShader(new ResourceLocation("shaders/post/creeper.json"));
        }
        else if (entityIn instanceof EntitySpider)
        {
            this.loadShader(new ResourceLocation("shaders/post/spider.json"));
        }
        else if (entityIn instanceof EntityEnderman)
        {
            this.loadShader(new ResourceLocation("shaders/post/invert.json"));
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:29,代碼來源:EntityRenderer.java

示例4: loadEntityShader

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
/**
 * What shader to use when spectating this entity
 */
public void loadEntityShader(Entity entityIn) {
	if (OpenGlHelper.shadersSupported) {
		if (this.theShaderGroup != null) {
			this.theShaderGroup.deleteShaderGroup();
		}

		this.theShaderGroup = null;

		if (entityIn instanceof EntityCreeper) {
			this.loadShader(new ResourceLocation("shaders/post/creeper.json"));
		} else if (entityIn instanceof EntitySpider) {
			this.loadShader(new ResourceLocation("shaders/post/spider.json"));
		} else if (entityIn instanceof EntityEnderman) {
			this.loadShader(new ResourceLocation("shaders/post/invert.json"));
		}
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:21,代碼來源:EntityRenderer.java

示例5: addEntitySpawns

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
/**
 * Add spawning rules for the living mobs we want to be able to spawn naturally.
 */
public static void addEntitySpawns()
{
	// get the list of biomes that creepers can spawn in, we'll use the same biomes for all of our mobs
	Biome[] biomes = getBiomeList(EntityCreeper.class, EnumCreatureType.MONSTER);

	// add the spawn rules to the entity registry
	EntityRegistry.addSpawn(EntityJumpkin.class, 100, 4, 4, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityZombieHands.class, 100, 4, 4, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityHallowitch.class, 75, 4, 4, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityCreeperween.class, 75, 4, 4, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityHaunter.class, 5, 1, 1, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityTreater.class, 50, 4, 4, EnumCreatureType.MONSTER, biomes);
}
 
開發者ID:crazysnailboy,項目名稱:Halloween,代碼行數:17,代碼來源:ModEntities.java

示例6: shouldAttackEntity

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) {
	if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) {
		if (p_142018_1_ instanceof EntityFrienderman) {
			EntityFrienderman frienderman = (EntityFrienderman) p_142018_1_;

			if (frienderman.isTamed() && frienderman.getOwner() == p_142018_2_) {
				return false;
			}
		}

		return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer) p_142018_2_).canAttackPlayer((EntityPlayer) p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse) p_142018_1_).isTame();
	}
	else {
		return false;
	}
}
 
開發者ID:p455w0rd,項目名稱:EndermanEvolution,代碼行數:17,代碼來源:EntityFrienderman.java

示例7: onUpdate

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
@Override
   public void onUpdate(ItemStack stack, World world, Entity entity, int itemSlot, boolean isSelected) {
	
	if (stack.getItemDamage() != 20)
		return;
	
	if (!(entity instanceof EntityPlayer) || (entity instanceof FakePlayer))
		return;
	
	if (itemSlot < ((EntityPlayer)entity).inventory.getHotbarSize()) {
		List<EntityLiving> entities = entity.worldObj.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB(entity.getPosition().add(-range, -range, -range), entity.getPosition().add(range, range, range)));
		
		for (EntityLiving ent : entities) {
			List<EntityAITaskEntry> entries = new ArrayList(ent.tasks.taskEntries);
			entries.addAll(new ArrayList(ent.targetTasks.taskEntries));
			
			for (EntityAITaskEntry entry : entries) {
				if (entry.action instanceof EntityAIAttackRangedBow) {
					makeSkellyShootSlower((EntityAIAttackRangedBow)entry.action);
				}
			}
			if (ent instanceof EntityCreeper)
				ReflectionHelper.setPrivateValue(EntityCreeper.class, (EntityCreeper)ent, 60, this.FUSETIME);
		}
	}
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:27,代碼來源:ItemGeneric.java

示例8: shouldAttackEntity

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
    if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
    {
        if (p_142018_1_ instanceof EntityWolf)
        {
            EntityWolf entitywolf = (EntityWolf)p_142018_1_;

            if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
            {
                return false;
            }
        }

        return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof AbstractHorse) || !((AbstractHorse)p_142018_1_).isTame();
    }
    else
    {
        return false;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:22,代碼來源:EntityWolf.java

示例9: getColorMultiplier

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
/**
 * Gets an RGBA int color multiplier to apply.
 */
protected int getColorMultiplier(EntityCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime)
{
    float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);

    if ((int)(f * 10.0F) % 2 == 0)
    {
        return 0;
    }
    else
    {
        int i = (int)(f * 0.2F * 255.0F);
        i = MathHelper.clamp(i, 0, 255);
        return i << 24 | 822083583;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:19,代碼來源:RenderCreeper.java

示例10: getColorMultiplier

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
/**
 * Gets an RGBA int color multiplier to apply.
 */
protected int getColorMultiplier(EntityCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime)
{
    float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);

    if ((int)(f * 10.0F) % 2 == 0)
    {
        return 0;
    }
    else
    {
        int i = (int)(f * 0.2F * 255.0F);
        i = MathHelper.clamp_int(i, 0, 255);
        return i << 24 | 822083583;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:19,代碼來源:RenderCreeper.java

示例11: performEffect

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
@Override
public void performEffect(EntityLivingBase entity, int level) {
    if(entity instanceof EntityCreeper)
    {
        //spawn firefly particles
        return;
    }

        if (entity instanceof EntityPlayer) {
            entity.resetActiveHand();
        }
        entity.attackEntityFrom(DamageSource.LIGHTNING_BOLT, 0.1f);
        entity.heal(0.1f);
        entity.motionX = 0;
        entity.motionY = 0;
        entity.motionZ = 0;
}
 
開發者ID:DaedalusGame,項目名稱:BetterWithAddons,代碼行數:18,代碼來源:EffectElectrified.java

示例12: compare

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
@Override
public int compare(Entity p_compare_1_, Entity p_compare_2_) {
	double compareDistance1 = this.theEntity.getDistanceSqToEntity(p_compare_1_);
	double compareDistance2 = this.theEntity.getDistanceSqToEntity(p_compare_2_);
	boolean b0 = false;
	boolean b1i = true;
	if (!ConfigValues.HUNTCREEPERS && p_compare_1_ instanceof EntityCreeper)
		b0 = true;
	if (!ConfigValues.HUNTCREEPERS && p_compare_2_ instanceof EntityCreeper)
		b1i = false;
	if (!b0 && b1i) {
		return Double.compare(compareDistance1, compareDistance2);
	} else if (b0 && b1i) {
		return 1;
	} else if (!b0) {
		return -1;
	} else {
		return 0;
	}
}
 
開發者ID:The-Fireplace-Minecraft-Mods,項目名稱:Overlord,代碼行數:21,代碼來源:EntityAINearestNonTeamTarget.java

示例13: addMovementTasks

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
/**
 * Register your movement tasks here.
 */
public void addMovementTasks() {
	switch (dataManager.get(MOVEMENT_MODE)) {
		case 1:
			if (!ConfigValues.HUNTCREEPERS)
				this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityCreeper.class, 10.0F, 1.2D, 1.6D));
			this.tasks.addTask(4, new EntityAIOpenDoor(this, getAttackMode() != 2));
			this.tasks.addTask(6, new EntityAIFollowMaster(this, 1.0D, 10.0F, 2.0F));
		case 0:
			this.detachHome();
			break;
		case 2:
		default:
			this.setHomePosAndDistance(new BlockPos(this.posX, this.posY, this.posZ), 20);
			this.tasks.addTask(2, new EntityAIRestrictSun(this));
			this.tasks.addTask(3, new EntityAIFleeSun(this, 1.0D));
			if (!ConfigValues.HUNTCREEPERS)
				this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityCreeper.class, 10.0F, 1.2D, 1.6D));
			this.tasks.addTask(4, new EntityAIOpenDoor(this, getAttackMode() != 2));
			this.tasks.addTask(7, new EntityAIWanderBase(this, 1.0D));
	}
}
 
開發者ID:The-Fireplace-Minecraft-Mods,項目名稱:Overlord,代碼行數:25,代碼來源:EntityArmyMember.java

示例14: shouldAttackEntity

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
public boolean shouldAttackEntity(EntityLivingBase target){
	EntityLivingBase owner = getOwner();
	if (ConfigValues.HUNTCREEPERS || !(target instanceof EntityCreeper)) {
		if (target instanceof EntityWolf) {
			EntityWolf entitywolf = (EntityWolf) target;

			if (entitywolf.isTamed() && entitywolf.getOwner() == owner || Alliances.getInstance().isAlliedTo(entitywolf.getOwnerId(), getOwnerId()))
				return false;
		}

		if (target instanceof EntityArmyMember)
			if ((getAttackMode() < 2 && Enemies.getInstance().isNotEnemiesWith(((EntityArmyMember) target).getOwnerId(), getOwnerId())) || ((EntityArmyMember) target).getOwnerId().equals(getOwnerId()) || Alliances.getInstance().isAlliedTo(((EntityArmyMember) target).getOwnerId(), getOwnerId()))
				return false;

		return !(target instanceof EntityPlayer && owner instanceof EntityPlayer && !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) target)) && (!(target instanceof EntityHorse) || !((EntityHorse) target).isTame());
	} else
		return false;
}
 
開發者ID:The-Fireplace-Minecraft-Mods,項目名稱:Overlord,代碼行數:19,代碼來源:EntityArmyMember.java

示例15: onDeath

import net.minecraft.entity.monster.EntityCreeper; //導入依賴的package包/類
@Override
public void onDeath(@Nonnull DamageSource cause) {
	super.onDeath(cause);

	Entity damageCause = cause.getTrueSource();
	if (damageCause instanceof EntityCreeper && ((EntityCreeper) damageCause).getPowered() && !((EntityCreeper) damageCause).isAIDisabled()) {
		((EntityCreeper) damageCause).incrementDroppedSkulls();
		this.entityDropItem(new ItemStack(Items.SKULL), 0.0F);
	}

	if (!this.world.isRemote) {
		for (int i = 0; i < equipInventory.getSizeInventory(); i++) {
			if (!equipInventory.getStackInSlot(i).isEmpty()) {
				EntityItem entityitem = new EntityItem(world, posX, posY, posZ, equipInventory.getStackInSlot(i));
				entityitem.setDefaultPickupDelay();
				world.spawnEntity(entityitem);
			}
		}
	}
}
 
開發者ID:The-Fireplace-Minecraft-Mods,項目名稱:Overlord,代碼行數:21,代碼來源:EntityBabySkeleton.java


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