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


Java EntityEquipmentSlot.LEGS屬性代碼示例

本文整理匯總了Java中net.minecraft.inventory.EntityEquipmentSlot.LEGS屬性的典型用法代碼示例。如果您正苦於以下問題:Java EntityEquipmentSlot.LEGS屬性的具體用法?Java EntityEquipmentSlot.LEGS怎麽用?Java EntityEquipmentSlot.LEGS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在net.minecraft.inventory.EntityEquipmentSlot的用法示例。


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

示例1: func_190772_a

protected EntityEquipmentSlot func_190772_a(Vec3d p_190772_1_)
{
    EntityEquipmentSlot entityequipmentslot = EntityEquipmentSlot.MAINHAND;
    boolean flag = this.isSmall();
    double d0 = flag ? p_190772_1_.yCoord * 2.0D : p_190772_1_.yCoord;
    EntityEquipmentSlot entityequipmentslot1 = EntityEquipmentSlot.FEET;

    if (d0 >= 0.1D && d0 < 0.1D + (flag ? 0.8D : 0.45D) && this.func_190630_a(entityequipmentslot1))
    {
        entityequipmentslot = EntityEquipmentSlot.FEET;
    }
    else if (d0 >= 0.9D + (flag ? 0.3D : 0.0D) && d0 < 0.9D + (flag ? 1.0D : 0.7D) && this.func_190630_a(EntityEquipmentSlot.CHEST))
    {
        entityequipmentslot = EntityEquipmentSlot.CHEST;
    }
    else if (d0 >= 0.4D && d0 < 0.4D + (flag ? 1.0D : 0.8D) && this.func_190630_a(EntityEquipmentSlot.LEGS))
    {
        entityequipmentslot = EntityEquipmentSlot.LEGS;
    }
    else if (d0 >= 1.6D && this.func_190630_a(EntityEquipmentSlot.HEAD))
    {
        entityequipmentslot = EntityEquipmentSlot.HEAD;
    }

    return entityequipmentslot;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:26,代碼來源:EntityArmorStand.java

示例2: ItemArmorCollection

public ItemArmorCollection(ItemArmor.ArmorMaterial material){
    this.material = material;
    head = new Armor(material, EntityEquipmentSlot.HEAD);
    chestplate = new Armor(material, EntityEquipmentSlot.CHEST);
    legs = new Armor(material, EntityEquipmentSlot.LEGS);
    shoes = new Armor(material, EntityEquipmentSlot.FEET);
}
 
開發者ID:canitzp,項目名稱:Metalworks,代碼行數:7,代碼來源:ItemArmorCollection.java

示例3: getRenderIndex

private static int getRenderIndex(EntityEquipmentSlot slot) {
    if (slot == EntityEquipmentSlot.LEGS) {
        return 2;
    } else {
        return 1;
    }
}
 
開發者ID:Randores,項目名稱:Randores2,代碼行數:7,代碼來源:RandoresItemArmor.java

示例4: getPartByPosition

@Nullable
public static EntityEquipmentSlot getPartByPosition(Entity hittingObject, EntityPlayer toTrack) {
    if (testAABB(hittingObject, toTrack, HEAD_AABB))
        return EntityEquipmentSlot.HEAD;
    if (testAABB(hittingObject, toTrack, MAIN_AABB))
        return EntityEquipmentSlot.CHEST;
    if (testAABB(hittingObject, toTrack, LEG_AABB))
        return EntityEquipmentSlot.LEGS;
    if (testAABB(hittingObject, toTrack, FEET_AABB))
        return EntityEquipmentSlot.FEET;
    return null;
}
 
開發者ID:ichttt,項目名稱:FirstAid,代碼行數:12,代碼來源:ProjectileHelper.java

示例5: getArmorTexture

@Override
public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type)
{
	int suffix = this.armorType == EntityEquipmentSlot.LEGS ? 2 : 1;

	if (type == null) {
		return ModInfo.MODID + ":textures/armor/" + this.armorName + "_" + suffix + ".png";
	}
	
	return ModInfo.MODID + ":textures/armor/" + this.armorName + "_" + suffix + "_overlay.png";
}
 
開發者ID:TwilightWingsStudio,項目名稱:CompositeGear,代碼行數:11,代碼來源:ItemCGArmor.java

示例6: registerEnchantments

/**
 * Registers all of the vanilla enchantments.
 */
public static void registerEnchantments()
{
    EntityEquipmentSlot[] aentityequipmentslot = new EntityEquipmentSlot[] {EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET};
    REGISTRY.register(0, new ResourceLocation("protection"), new EnchantmentProtection(Enchantment.Rarity.COMMON, EnchantmentProtection.Type.ALL, aentityequipmentslot));
    REGISTRY.register(1, new ResourceLocation("fire_protection"), new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.FIRE, aentityequipmentslot));
    REGISTRY.register(2, new ResourceLocation("feather_falling"), new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.FALL, aentityequipmentslot));
    REGISTRY.register(3, new ResourceLocation("blast_protection"), new EnchantmentProtection(Enchantment.Rarity.RARE, EnchantmentProtection.Type.EXPLOSION, aentityequipmentslot));
    REGISTRY.register(4, new ResourceLocation("projectile_protection"), new EnchantmentProtection(Enchantment.Rarity.UNCOMMON, EnchantmentProtection.Type.PROJECTILE, aentityequipmentslot));
    REGISTRY.register(5, new ResourceLocation("respiration"), new EnchantmentOxygen(Enchantment.Rarity.RARE, aentityequipmentslot));
    REGISTRY.register(6, new ResourceLocation("aqua_affinity"), new EnchantmentWaterWorker(Enchantment.Rarity.RARE, aentityequipmentslot));
    REGISTRY.register(7, new ResourceLocation("thorns"), new EnchantmentThorns(Enchantment.Rarity.VERY_RARE, aentityequipmentslot));
    REGISTRY.register(8, new ResourceLocation("depth_strider"), new EnchantmentWaterWalker(Enchantment.Rarity.RARE, aentityequipmentslot));
    REGISTRY.register(9, new ResourceLocation("frost_walker"), new EnchantmentFrostWalker(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.FEET}));
    REGISTRY.register(10, new ResourceLocation("binding_curse"), new EnchantmentBindingCurse(Enchantment.Rarity.VERY_RARE, aentityequipmentslot));
    REGISTRY.register(16, new ResourceLocation("sharpness"), new EnchantmentDamage(Enchantment.Rarity.COMMON, 0, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(17, new ResourceLocation("smite"), new EnchantmentDamage(Enchantment.Rarity.UNCOMMON, 1, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(18, new ResourceLocation("bane_of_arthropods"), new EnchantmentDamage(Enchantment.Rarity.UNCOMMON, 2, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(19, new ResourceLocation("knockback"), new EnchantmentKnockback(Enchantment.Rarity.UNCOMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(20, new ResourceLocation("fire_aspect"), new EnchantmentFireAspect(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(21, new ResourceLocation("looting"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.WEAPON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(22, new ResourceLocation("sweeping"), new EnchantmentSweepingEdge(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(32, new ResourceLocation("efficiency"), new EnchantmentDigging(Enchantment.Rarity.COMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(33, new ResourceLocation("silk_touch"), new EnchantmentUntouching(Enchantment.Rarity.VERY_RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(34, new ResourceLocation("unbreaking"), new EnchantmentDurability(Enchantment.Rarity.UNCOMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(35, new ResourceLocation("fortune"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.DIGGER, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(48, new ResourceLocation("power"), new EnchantmentArrowDamage(Enchantment.Rarity.COMMON, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(49, new ResourceLocation("punch"), new EnchantmentArrowKnockback(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(50, new ResourceLocation("flame"), new EnchantmentArrowFire(Enchantment.Rarity.RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(51, new ResourceLocation("infinity"), new EnchantmentArrowInfinite(Enchantment.Rarity.VERY_RARE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(61, new ResourceLocation("luck_of_the_sea"), new EnchantmentLootBonus(Enchantment.Rarity.RARE, EnumEnchantmentType.FISHING_ROD, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(62, new ResourceLocation("lure"), new EnchantmentFishingSpeed(Enchantment.Rarity.RARE, EnumEnchantmentType.FISHING_ROD, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND}));
    REGISTRY.register(70, new ResourceLocation("mending"), new EnchantmentMending(Enchantment.Rarity.RARE, EntityEquipmentSlot.values()));
    REGISTRY.register(71, new ResourceLocation("vanishing_curse"), new EnchantmentVanishingCurse(Enchantment.Rarity.VERY_RARE, EntityEquipmentSlot.values()));
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:37,代碼來源:Enchantment.java

示例7: onPlayerTick

@SubscribeEvent
public void onPlayerTick(PlayerTickEvent event)
{
	if (event.phase == Phase.START && !event.player.getEntityWorld().isRemote)
	{
		if (ticks % 10 == 0)
		{
			PlayerInformation playerInfo = (PlayerInformation) event.player.getCapability(CapabilityPlayerInformation.PLAYER_INFORMATION, null);
			
			if (playerInfo != null)
			{	
				if (event.player.inventory.getCurrentItem() != mainhand && playerInfo.getPlayerLevel() >= NBTHelper.loadStackNBT(event.player.inventory.getCurrentItem()).getInteger("Level"))
				{
					updateStats(event.player, playerInfo);
					mainhand = event.player.inventory.getCurrentItem();
				}
				
				for (ItemStack stack : event.player.inventory.armorInventory)
				{
					if (stack.getItem() instanceof ItemArmor && playerInfo.getPlayerLevel() >= NBTHelper.loadStackNBT(stack).getInteger("Level"))
					{
						if (((ItemArmor) stack.getItem()).getEquipmentSlot() == EntityEquipmentSlot.HEAD && stack != helmet)
						{
							updateStats(event.player, playerInfo);
							helmet = stack;
						}
						else if (((ItemArmor) stack.getItem()).getEquipmentSlot() == EntityEquipmentSlot.CHEST && stack != chestplate)
						{
							updateStats(event.player, playerInfo);
							chestplate = stack;
						}
						else if (((ItemArmor) stack.getItem()).getEquipmentSlot() == EntityEquipmentSlot.LEGS && stack != leggings)
						{
							updateStats(event.player, playerInfo);
							leggings = stack;
						}
						else if (((ItemArmor) stack.getItem()).getEquipmentSlot() == EntityEquipmentSlot.FEET && stack != boots)
						{
							updateStats(event.player, playerInfo);
							boots = stack;
						}
					}
				}
			}
			
			ticks = 0;
		}
		
		if (regenTicks % 100 == 0)
		{
			Stats statsCap = (Stats) event.player.getCapability(CapabilityPlayerStats.STATS, null);
			
			if (statsCap != null)
			{
				if (statsCap.getMana() < statsCap.getMaxMana())
				{
					statsCap.increaseMana(statsCap.getManaPerSecond());
				}
				
				if (event.player.getHealth() < event.player.getMaxHealth())
				{
					event.player.heal(statsCap.getHealthPerSecond());
				}
				
				LootSlashConquer.network.sendTo(new PacketUpdateStats(statsCap), (EntityPlayerMP) event.player);
			}
			
			regenTicks = 0;
		}
		
		ticks++;
		regenTicks++;
	}
}
 
開發者ID:TheXFactor117,項目名稱:Loot-Slash-Conquer,代碼行數:74,代碼來源:EventPlayerTick.java

示例8: replaceItemInInventory

public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn)
{
    if (inventorySlot >= 0 && inventorySlot < this.inventory.mainInventory.length)
    {
        this.inventory.setInventorySlotContents(inventorySlot, itemStackIn);
        return true;
    }
    else
    {
        EntityEquipmentSlot entityequipmentslot;

        if (inventorySlot == 100 + EntityEquipmentSlot.HEAD.getIndex())
        {
            entityequipmentslot = EntityEquipmentSlot.HEAD;
        }
        else if (inventorySlot == 100 + EntityEquipmentSlot.CHEST.getIndex())
        {
            entityequipmentslot = EntityEquipmentSlot.CHEST;
        }
        else if (inventorySlot == 100 + EntityEquipmentSlot.LEGS.getIndex())
        {
            entityequipmentslot = EntityEquipmentSlot.LEGS;
        }
        else if (inventorySlot == 100 + EntityEquipmentSlot.FEET.getIndex())
        {
            entityequipmentslot = EntityEquipmentSlot.FEET;
        }
        else
        {
            entityequipmentslot = null;
        }

        if (inventorySlot == 98)
        {
            this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, itemStackIn);
            return true;
        }
        else if (inventorySlot == 99)
        {
            this.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, itemStackIn);
            return true;
        }
        else if (entityequipmentslot == null)
        {
            int i = inventorySlot - 200;

            if (i >= 0 && i < this.theInventoryEnderChest.getSizeInventory())
            {
                this.theInventoryEnderChest.setInventorySlotContents(i, itemStackIn);
                return true;
            }
            else
            {
                return false;
            }
        }
        else
        {
            if (itemStackIn != null && itemStackIn.getItem() != null)
            {
                if (!(itemStackIn.getItem() instanceof ItemArmor) && !(itemStackIn.getItem() instanceof ItemElytra))
                {
                    if (entityequipmentslot != EntityEquipmentSlot.HEAD)
                    {
                        return false;
                    }
                }
                else if (EntityLiving.getSlotForItemStack(itemStackIn) != entityequipmentslot)
                {
                    return false;
                }
            }

            this.inventory.setInventorySlotContents(entityequipmentslot.getIndex() + this.inventory.mainInventory.length, itemStackIn);
            return true;
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:78,代碼來源:EntityPlayer.java

示例9: getArmorTexture

@Nullable
@Override
public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) {
    return Metalworks.MODID + ":" + "textures/armor/" + this.getArmorMaterial().name() + "_armor_" + (slot == EntityEquipmentSlot.LEGS ? "2" : "1") + ".png";
}
 
開發者ID:canitzp,項目名稱:Metalworks,代碼行數:5,代碼來源:ItemArmorCollection.java

示例10: replaceItemInInventory

public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn)
{
    if (inventorySlot >= 0 && inventorySlot < this.inventory.mainInventory.size())
    {
        this.inventory.setInventorySlotContents(inventorySlot, itemStackIn);
        return true;
    }
    else
    {
        EntityEquipmentSlot entityequipmentslot;

        if (inventorySlot == 100 + EntityEquipmentSlot.HEAD.getIndex())
        {
            entityequipmentslot = EntityEquipmentSlot.HEAD;
        }
        else if (inventorySlot == 100 + EntityEquipmentSlot.CHEST.getIndex())
        {
            entityequipmentslot = EntityEquipmentSlot.CHEST;
        }
        else if (inventorySlot == 100 + EntityEquipmentSlot.LEGS.getIndex())
        {
            entityequipmentslot = EntityEquipmentSlot.LEGS;
        }
        else if (inventorySlot == 100 + EntityEquipmentSlot.FEET.getIndex())
        {
            entityequipmentslot = EntityEquipmentSlot.FEET;
        }
        else
        {
            entityequipmentslot = null;
        }

        if (inventorySlot == 98)
        {
            this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, itemStackIn);
            return true;
        }
        else if (inventorySlot == 99)
        {
            this.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, itemStackIn);
            return true;
        }
        else if (entityequipmentslot == null)
        {
            int i = inventorySlot - 200;

            if (i >= 0 && i < this.theInventoryEnderChest.getSizeInventory())
            {
                this.theInventoryEnderChest.setInventorySlotContents(i, itemStackIn);
                return true;
            }
            else
            {
                return false;
            }
        }
        else
        {
            if (!itemStackIn.func_190926_b())
            {
                if (!(itemStackIn.getItem() instanceof ItemArmor) && !(itemStackIn.getItem() instanceof ItemElytra))
                {
                    if (entityequipmentslot != EntityEquipmentSlot.HEAD)
                    {
                        return false;
                    }
                }
                else if (EntityLiving.getSlotForItemStack(itemStackIn) != entityequipmentslot)
                {
                    return false;
                }
            }

            this.inventory.setInventorySlotContents(entityequipmentslot.getIndex() + this.inventory.mainInventory.size(), itemStackIn);
            return true;
        }
    }
}
 
開發者ID:NSExceptional,項目名稱:Zombe-Modpack,代碼行數:78,代碼來源:EntityPlayer.java

示例11: replaceItemInInventory

public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn)
{
    EntityEquipmentSlot entityequipmentslot;

    if (inventorySlot == 98)
    {
        entityequipmentslot = EntityEquipmentSlot.MAINHAND;
    }
    else if (inventorySlot == 99)
    {
        entityequipmentslot = EntityEquipmentSlot.OFFHAND;
    }
    else if (inventorySlot == 100 + EntityEquipmentSlot.HEAD.getIndex())
    {
        entityequipmentslot = EntityEquipmentSlot.HEAD;
    }
    else if (inventorySlot == 100 + EntityEquipmentSlot.CHEST.getIndex())
    {
        entityequipmentslot = EntityEquipmentSlot.CHEST;
    }
    else if (inventorySlot == 100 + EntityEquipmentSlot.LEGS.getIndex())
    {
        entityequipmentslot = EntityEquipmentSlot.LEGS;
    }
    else
    {
        if (inventorySlot != 100 + EntityEquipmentSlot.FEET.getIndex())
        {
            return false;
        }

        entityequipmentslot = EntityEquipmentSlot.FEET;
    }

    if (!itemStackIn.func_190926_b() && !EntityLiving.isItemStackInSlot(entityequipmentslot, itemStackIn) && entityequipmentslot != EntityEquipmentSlot.HEAD)
    {
        return false;
    }
    else
    {
        this.setItemStackToSlot(entityequipmentslot, itemStackIn);
        return true;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:44,代碼來源:EntityArmorStand.java

示例12: replaceItemInInventory

public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn)
{
    EntityEquipmentSlot entityequipmentslot;

    if (inventorySlot == 98)
    {
        entityequipmentslot = EntityEquipmentSlot.MAINHAND;
    }
    else if (inventorySlot == 99)
    {
        entityequipmentslot = EntityEquipmentSlot.OFFHAND;
    }
    else if (inventorySlot == 100 + EntityEquipmentSlot.HEAD.getIndex())
    {
        entityequipmentslot = EntityEquipmentSlot.HEAD;
    }
    else if (inventorySlot == 100 + EntityEquipmentSlot.CHEST.getIndex())
    {
        entityequipmentslot = EntityEquipmentSlot.CHEST;
    }
    else if (inventorySlot == 100 + EntityEquipmentSlot.LEGS.getIndex())
    {
        entityequipmentslot = EntityEquipmentSlot.LEGS;
    }
    else
    {
        if (inventorySlot != 100 + EntityEquipmentSlot.FEET.getIndex())
        {
            return false;
        }

        entityequipmentslot = EntityEquipmentSlot.FEET;
    }

    if (!itemStackIn.func_190926_b() && !isItemStackInSlot(entityequipmentslot, itemStackIn) && entityequipmentslot != EntityEquipmentSlot.HEAD)
    {
        return false;
    }
    else
    {
        this.setItemStackToSlot(entityequipmentslot, itemStackIn);
        return true;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:44,代碼來源:EntityLiving.java

示例13: isLegSlot

private boolean isLegSlot(EntityEquipmentSlot slotIn)
{
    return slotIn == EntityEquipmentSlot.LEGS;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:4,代碼來源:LayerArmorBase.java

示例14: replaceItemInInventory

public boolean replaceItemInInventory(int inventorySlot, @Nullable ItemStack itemStackIn)
{
    EntityEquipmentSlot entityequipmentslot;

    if (inventorySlot == 98)
    {
        entityequipmentslot = EntityEquipmentSlot.MAINHAND;
    }
    else if (inventorySlot == 99)
    {
        entityequipmentslot = EntityEquipmentSlot.OFFHAND;
    }
    else if (inventorySlot == 100 + EntityEquipmentSlot.HEAD.getIndex())
    {
        entityequipmentslot = EntityEquipmentSlot.HEAD;
    }
    else if (inventorySlot == 100 + EntityEquipmentSlot.CHEST.getIndex())
    {
        entityequipmentslot = EntityEquipmentSlot.CHEST;
    }
    else if (inventorySlot == 100 + EntityEquipmentSlot.LEGS.getIndex())
    {
        entityequipmentslot = EntityEquipmentSlot.LEGS;
    }
    else
    {
        if (inventorySlot != 100 + EntityEquipmentSlot.FEET.getIndex())
        {
            return false;
        }

        entityequipmentslot = EntityEquipmentSlot.FEET;
    }

    if (itemStackIn != null && !isItemStackInSlot(entityequipmentslot, itemStackIn) && entityequipmentslot != EntityEquipmentSlot.HEAD)
    {
        return false;
    }
    else
    {
        this.setItemStackToSlot(entityequipmentslot, itemStackIn);
        return true;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:44,代碼來源:EntityLiving.java

示例15: getModelTextures

private String[] getModelTextures()
{
    if (this.type == 1 && this.items.length == 1)
    {
        Item item = Item.getItemById(this.items[0]);
        boolean flag = item == Items.POTIONITEM || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION;

        if (flag && this.damage != null && this.damage.getCountRanges() > 0)
        {
            RangeInt rangeint = this.damage.getRange(0);
            int i = rangeint.getMin();
            boolean flag1 = (i & 16384) != 0;
            String s5 = this.getMapTexture(this.mapTextures, "texture.potion_overlay", "items/potion_overlay");
            String s6 = null;

            if (flag1)
            {
                s6 = this.getMapTexture(this.mapTextures, "texture.potion_bottle_splash", "items/potion_bottle_splash");
            }
            else
            {
                s6 = this.getMapTexture(this.mapTextures, "texture.potion_bottle_drinkable", "items/potion_bottle_drinkable");
            }

            return new String[] {s5, s6};
        }

        if (item instanceof ItemArmor)
        {
            ItemArmor itemarmor = (ItemArmor)item;

            if (itemarmor.getArmorMaterial() == ItemArmor.ArmorMaterial.LEATHER)
            {
                String s = "leather";
                String s1 = "helmet";

                if (itemarmor.armorType == EntityEquipmentSlot.HEAD)
                {
                    s1 = "helmet";
                }

                if (itemarmor.armorType == EntityEquipmentSlot.CHEST)
                {
                    s1 = "chestplate";
                }

                if (itemarmor.armorType == EntityEquipmentSlot.LEGS)
                {
                    s1 = "leggings";
                }

                if (itemarmor.armorType == EntityEquipmentSlot.FEET)
                {
                    s1 = "boots";
                }

                String s2 = s + "_" + s1;
                String s3 = this.getMapTexture(this.mapTextures, "texture." + s2, "items/" + s2);
                String s4 = this.getMapTexture(this.mapTextures, "texture." + s2 + "_overlay", "items/" + s2 + "_overlay");
                return new String[] {s3, s4};
            }
        }
    }

    return new String[] {this.texture};
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:66,代碼來源:CustomItemProperties.java


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