当前位置: 首页>>代码示例>>Java>>正文


Java EntitySheep类代码示例

本文整理汇总了Java中net.minecraft.entity.passive.EntitySheep的典型用法代码示例。如果您正苦于以下问题:Java EntitySheep类的具体用法?Java EntitySheep怎么用?Java EntitySheep使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EntitySheep类属于net.minecraft.entity.passive包,在下文中一共展示了EntitySheep类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: itemInteractionForEntity

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
/**
 * Returns true if the item can be used on the given entity, e.g. shears on sheep.
 */
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target)
{
    if (target instanceof EntitySheep)
    {
        EntitySheep entitysheep = (EntitySheep)target;
        EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(stack.getMetadata());

        if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != enumdyecolor)
        {
            entitysheep.setFleeceColor(enumdyecolor);
            --stack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:24,代码来源:ItemDye.java

示例2: dropEvent

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void dropEvent(LivingDropsEvent event) {
	if (event.entityLiving.worldObj.isRemote)
		return;

	if (EtFuturum.enableSkullDrop)
		dropHead(event.entityLiving, event.source, event.lootingLevel, event.drops);

	Random rand = event.entityLiving.worldObj.rand;
	if (EtFuturum.enableMutton && event.entityLiving instanceof EntitySheep) {
		int amount = rand.nextInt(3) + 1 + rand.nextInt(1 + event.lootingLevel);
		for (int i = 0; i < amount; i++)
			if (event.entityLiving.isBurning())
				addDrop(new ItemStack(ModItems.cooked_mutton), event.entityLiving, event.drops);
			else
				addDrop(new ItemStack(ModItems.raw_mutton), event.entityLiving, event.drops);
	}
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:19,代码来源:ServerEventHandler.java

示例3: BiomeTundra

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
public BiomeTundra() {
    super(new BiomeProperties("Tundra")
            .setBaseHeight(0.325f)
            .setHeightVariation(0.05f)
            .setTemperature(0.2f) // 0.25f
            .setRainfall(0.45f)
    );

    this.setRegistryName(Ref.MODID+":steppe");
    this.decorator.treesPerChunk = 1;
    this.decorator.grassPerChunk = 10;
    this.decorator.flowersPerChunk = 2;
    this.decorator.reedsPerChunk = -999;
    this.decorator.cactiPerChunk = -999;

    this.spawnableCreatureList.clear();
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityRabbit.class, 10, 2, 3));
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntitySheep.class, 12, 1, 5));
    Ref.BIOMES.add(this);
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:21,代码来源:BiomeTundra.java

示例4: onSheared

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
@SubscribeEvent
public void onSheared(EntityInteractSpecific event) {
	
	ItemStack rainbow = BaublesApi.getBaublesHandler((EntityPlayer)event.getEntityPlayer()).getStackInSlot(6);
	if (rainbow == null || (rainbow != null && rainbow.getItem() != this)) return;
	
	if (!(event.getTarget() instanceof IShearable)) return;
	if (!(event.getTarget() instanceof EntitySheep) || (event.getTarget() instanceof EntitySheep && ((EntitySheep)event.getTarget()).getSheared())) return;
	if (event.getItemStack() == null || (event.getItemStack() != null && !(event.getItemStack().getItem() instanceof ItemShears))) return;
	
	int fortune = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, event.getItemStack());
	if (!event.getWorld().isRemote) {
		List<ItemStack> wools = ((IShearable)event.getTarget()).onSheared(event.getItemStack(), event.getWorld(), event.getPos(), fortune);
		for (ItemStack is : wools) {
			Random rand = new Random();
			is.setItemDamage(rand.nextInt(15));
			EntityItem wool = new EntityItem(event.getWorld(), event.getTarget().posX, event.getTarget().posY, event.getTarget().posZ, is);
			event.getWorld().spawnEntityInWorld(wool);
		}
	}
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:22,代码来源:EmblemRainbow.java

示例5: itemInteractionForEntity

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
/**
 * Returns true if the item can be used on the given entity, e.g. shears on sheep.
 */
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target, EnumHand hand)
{
    if (target instanceof EntitySheep)
    {
        EntitySheep entitysheep = (EntitySheep)target;
        EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(stack.getMetadata());

        if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != enumdyecolor)
        {
            entitysheep.setFleeceColor(enumdyecolor);
            stack.func_190918_g(1);
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:24,代码来源:ItemDye.java

示例6: doRenderLayer

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
public void doRenderLayer(EntityWolf entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (entitylivingbaseIn.isTamed() && !entitylivingbaseIn.isInvisible())
    {
        this.wolfRenderer.bindTexture(WOLF_COLLAR);
        float[] afloat = EntitySheep.getDyeRgb(entitylivingbaseIn.getCollarColor());

        if (Config.isCustomColors())
        {
            afloat = CustomColors.getWolfCollarColors(entitylivingbaseIn.getCollarColor(), afloat);
        }

        GlStateManager.color(afloat[0], afloat[1], afloat[2]);
        this.wolfRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:17,代码来源:LayerWolfCollar.java

示例7: renderTileEntityAt

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
public void renderTileEntityAt(TileEntityEndPortal te, double x, double y, double z, float partialTicks, int destroyStage)
{
    GlStateManager.disableFog();
    TileEntityEndGateway tileentityendgateway = (TileEntityEndGateway)te;

    if (tileentityendgateway.isSpawning() || tileentityendgateway.isCoolingDown())
    {
        GlStateManager.alphaFunc(516, 0.1F);
        this.bindTexture(END_GATEWAY_BEAM_TEXTURE);
        float f = tileentityendgateway.isSpawning() ? tileentityendgateway.getSpawnPercent(partialTicks) : tileentityendgateway.getCooldownPercent(partialTicks);
        double d0 = tileentityendgateway.isSpawning() ? 256.0D - y : 50.0D;
        f = MathHelper.sin(f * (float)Math.PI);
        int i = MathHelper.floor((double)f * d0);
        float[] afloat = EntitySheep.getDyeRgb(tileentityendgateway.isSpawning() ? EnumDyeColor.MAGENTA : EnumDyeColor.PURPLE);
        TileEntityBeaconRenderer.renderBeamSegment(x, y, z, (double)partialTicks, (double)f, (double)tileentityendgateway.getWorld().getTotalWorldTime(), 0, i, afloat, 0.15D, 0.175D);
        TileEntityBeaconRenderer.renderBeamSegment(x, y, z, (double)partialTicks, (double)f, (double)tileentityendgateway.getWorld().getTotalWorldTime(), 0, -i, afloat, 0.15D, 0.175D);
    }

    super.renderTileEntityAt(te, x, y, z, partialTicks, destroyStage);
    GlStateManager.enableFog();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:22,代码来源:TileEntityEndGatewayRenderer.java

示例8: itemInteractionForEntity

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
/**
 * Returns true if the item can be used on the given entity, e.g. shears on sheep.
 */
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target, EnumHand hand)
{
    if (target instanceof EntitySheep)
    {
        EntitySheep entitysheep = (EntitySheep)target;
        EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(stack.getMetadata());

        if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != enumdyecolor)
        {
            entitysheep.setFleeceColor(enumdyecolor);
            --stack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:ItemDye.java

示例9: initSockLists

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
private static void initSockLists() {
	if (socksOrdered == null) {
		socksOrdered = new ArrayList<>(256);

		for (int i = 0; i < 256; i++) {
			ItemStack sock = new ItemStack(PonySocks.sock, 1, 0);
			sock.setTagCompound(new NBTTagCompound());
			sock.getTagCompound().setInteger("color1", RecipeDyeableBase.fromFloats(EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(i & 15))));
			sock.getTagCompound().setInteger("color2", RecipeDyeableBase.fromFloats(EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(i >> 4))));
			socksOrdered.add(sock);
		}

		socksShuffled = Lists.newArrayList(socksOrdered);
		Collections.shuffle(socksShuffled);
	}
}
 
开发者ID:asiekierka,项目名称:PonySocks2,代码行数:17,代码来源:PonySocks.java

示例10: renderEquippedGlove

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
@SubscribeEvent
public void renderEquippedGlove(final RenderPlayerEvent.Specials.Post event) {
    if (event.entityPlayer == null) {
        return;
    }
    final ItemStack heldItem = event.entityPlayer.getHeldItem();
    if (heldItem == null || heldItem.getItem() != ExtraUtils.glove) {
        return;
    }
    final int dmg = heldItem.getItemDamage();
    final RenderPlayer renderplayer = event.renderer;
    float[] col = EntitySheep.fleeceColorTable[ItemGlove.getColIndex(1, dmg)];
    GL11.glColor3f(col[0], col[1], col[2]);
    Minecraft.getMinecraft().getTextureManager().bindTexture(RenderItemGlove.glove1);
    renderplayer.modelBipedMain.bipedRightArm.render(0.0625f);
    col = EntitySheep.fleeceColorTable[ItemGlove.getColIndex(0, dmg)];
    GL11.glColor3f(col[0], col[1], col[2]);
    Minecraft.getMinecraft().getTextureManager().bindTexture(RenderItemGlove.glove2);
    renderplayer.modelBipedMain.bipedRightArm.render(0.0625f);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:21,代码来源:RenderItemGlove.java

示例11: onBehaviourStarted

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
@Override
public void onBehaviourStarted(BlockPos currentPos) {
    if (type != ChanceCubeType.GIANT) return;

    EntitySheep entity = getEntity();
    World worldObj = entity.worldObj;
    final int distance = ChanceCubesConfiguration.distance.getInt();
    ShearMadnessMod.CHANNEL.sendToAllAround(
            new PlayCustomSoundMessage(
                    entity.posX, entity.posY, entity.posZ,
                    ChanceCubeSounds.chancecube_giantcubespawned, SoundCategory.NEUTRAL,
                    0.3F, 1.0f,
                    true
            ),
            new NetworkRegistry.TargetPoint(
                    worldObj.provider.getDimension(),
                    entity.posX, entity.posY, entity.posZ,
                    distance
            )
    );
}
 
开发者ID:AtomicBlom,项目名称:ShearMadness,代码行数:22,代码来源:ChanceCubeBehaviour.java

示例12: onInteraction

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
@SubscribeEvent
public static void onInteraction(ShearMadnessSpecialInteractionEvent event) {
    final ItemStack itemStack = event.getItemStack();
    final EntitySheep sheep = event.getSheep();
    final EntityPlayer player = event.getPlayer();
    if (ItemStackHelper.isStackForBlock(itemStack, Blocks.ANVIL)) {
        player.displayGui(new AnvilInteraction(event.getWorld(), sheep));
    }
    if (ItemStackHelper.isStackForBlock(itemStack, Blocks.CRAFTING_TABLE)) {
        player.displayGui(new WorkbenchInteraction(event.getWorld(), sheep));
    }
    if (ItemStackHelper.isStackForBlock(itemStack, Blocks.ENCHANTING_TABLE)) {
        player.displayGui(new EnchantmentInteraction(event.getWorld(), sheep));
    }
    if (ItemStackHelper.isStackForBlock(itemStack, Blocks.NOTEBLOCK)) {
        NoteBlockBehaviour.tuneNoteBlockSheep(event.getSheep());
    }
}
 
开发者ID:AtomicBlom,项目名称:ShearMadness,代码行数:19,代码来源:VanillaInteractions.java

示例13: shearSheep

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
public static void shearSheep(ItemStack itemStack, EntitySheep sheep, IChiseledSheepCapability capability)
{
    if (Settings.Shearing.getBehaviour() == ShearBehaviour.CannotShear) {
        //TODO: Play shear cancelled Sound.
        return;
    }

    sheep.setSheared(true);

    //TODO: Add support for facade drop.
    //Select the item to drop.
    final ItemStack itemToDrop = capability.getChiselItemStack().copy();
    itemToDrop.stackSize = 1;

    ItemStackUtils.dropItem(sheep, itemToDrop);

    sheep.playSound(SoundEvents.ENTITY_SHEEP_SHEAR, 1.0F, 1.0F);
    itemStack.damageItem(1, sheep);

    if (Settings.Shearing.getBehaviour() == ShearBehaviour.RevertSheep) {
        capability.unChisel();
        CHANNEL.sendToAll(new SheepChiseledMessage(sheep));
    }
}
 
开发者ID:AtomicBlom,项目名称:ShearMadness,代码行数:25,代码来源:Shearing.java

示例14: EntityZombieDog

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
public EntityZombieDog(World world, boolean isHusk) {
    super(world);

    this.setMobType(isHusk ? EnumUndeadMobType.HUSK : EnumUndeadMobType.ZOMBIE);

    ((PathNavigateGround) this.getNavigator()).setCanSwim(true);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1, false));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1));
    this.tasks.addTask(6, new EntityAIWander(this, 1));
    this.tasks.addTask(5, new EntityAIMoveThroughVillage(this, 1, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, false));
    if (ExtendedConfig.zombiePetsAttackPets) {
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWolf.class, false));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityOcelot.class, false));
    }
    this.targetTasks.addTask(4, new EntityAINearestAttackableHorse(this, false));
    if (ExtendedConfig.zombiePetsAttackAnimals) {
        this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntitySheep.class, false));
    }
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:22,代码来源:EntityZombieDog.java

示例15: onLivingDrops

import net.minecraft.entity.passive.EntitySheep; //导入依赖的package包/类
@SubscribeEvent
public void onLivingDrops(LivingDropsEvent event)
{
	Entity e = event.entity;
	List<EntityItem> drops = event.drops;
	// Remove all drops from cows, sheep and pigs, add carcass drop
	if (e instanceof EntityCow || e instanceof EntityPig || e instanceof EntitySheep)
	{
		EntityAnimal a = (EntityAnimal) e;
		Iterator<EntityItem> it = drops.iterator();
		while (it.hasNext())
		{
			EntityItem i = it.next();
			it.remove();
		}

		if (a.getGrowingAge() == 0)
		{
			if (a instanceof EntityCow) a.dropItem(TanneryItems.bloodyCowCarcass, 1);
			else if (a instanceof EntityPig) a.dropItem(TanneryItems.bloodyPigCarcass, 1);
			else if (a instanceof EntitySheep) a.dropItem(TanneryItems.bloodySheepCarcass, 1);
		}
	}
}
 
开发者ID:hero887,项目名称:Tannery,代码行数:25,代码来源:EntityDropsHandler.java


注:本文中的net.minecraft.entity.passive.EntitySheep类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。