本文整理匯總了Java中net.minecraft.init.Items.leather方法的典型用法代碼示例。如果您正苦於以下問題:Java Items.leather方法的具體用法?Java Items.leather怎麽用?Java Items.leather使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.init.Items
的用法示例。
在下文中一共展示了Items.leather方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCollideWithPlayer
import net.minecraft.init.Items; //導入方法依賴的package包/類
/**
* Called by a player entity when they collide with an entity
*/
public void onCollideWithPlayer(EntityPlayer entityIn)
{
if (!this.worldObj.isRemote)
{
ItemStack itemstack = this.getEntityItem();
int i = itemstack.stackSize;
if (this.delayBeforeCanPickup == 0 && (this.owner == null || 6000 - this.age <= 200 || this.owner.equals(entityIn.getName())) && entityIn.inventory.addItemStackToInventory(itemstack))
{
if (itemstack.getItem() == Item.getItemFromBlock(Blocks.log))
{
entityIn.triggerAchievement(AchievementList.mineWood);
}
if (itemstack.getItem() == Item.getItemFromBlock(Blocks.log2))
{
entityIn.triggerAchievement(AchievementList.mineWood);
}
if (itemstack.getItem() == Items.leather)
{
entityIn.triggerAchievement(AchievementList.killCow);
}
if (itemstack.getItem() == Items.diamond)
{
entityIn.triggerAchievement(AchievementList.diamonds);
}
if (itemstack.getItem() == Items.blaze_rod)
{
entityIn.triggerAchievement(AchievementList.blazeRod);
}
if (itemstack.getItem() == Items.diamond && this.getThrower() != null)
{
EntityPlayer entityplayer = this.worldObj.getPlayerEntityByName(this.getThrower());
if (entityplayer != null && entityplayer != entityIn)
{
entityplayer.triggerAchievement(AchievementList.diamondsToYou);
}
}
if (!this.isSilent())
{
this.worldObj.playSoundAtEntity(entityIn, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
}
entityIn.onItemPickup(this, i);
if (itemstack.stackSize <= 0)
{
this.setDead();
}
}
}
}
示例2: getDropItem
import net.minecraft.init.Items; //導入方法依賴的package包/類
protected Item getDropItem()
{
boolean flag = this.rand.nextInt(4) == 0;
int i = this.getHorseType();
return i == 4 ? Items.bone : (i == 3 ? (flag ? null : Items.rotten_flesh) : Items.leather);
}
示例3: getDropItem
import net.minecraft.init.Items; //導入方法依賴的package包/類
protected Item getDropItem()
{
return Items.leather;
}
示例4: getRepairItem
import net.minecraft.init.Items; //導入方法依賴的package包/類
public Item getRepairItem()
{
return this == LEATHER ? Items.leather : (this == CHAIN ? Items.iron_ingot : (this == GOLD ? Items.gold_ingot : (this == IRON ? Items.iron_ingot : (this == DIAMOND ? Items.diamond : null))));
}