本文整理汇总了Java中net.minecraft.init.Items.BEETROOT_SEEDS属性的典型用法代码示例。如果您正苦于以下问题:Java Items.BEETROOT_SEEDS属性的具体用法?Java Items.BEETROOT_SEEDS怎么用?Java Items.BEETROOT_SEEDS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.init.Items
的用法示例。
在下文中一共展示了Items.BEETROOT_SEEDS属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isFarmItemInInventory
/**
* Returns true if villager has seeds, potatoes or carrots in inventory
*/
public boolean isFarmItemInInventory()
{
for (int i = 0; i < this.villagerInventory.getSizeInventory(); ++i)
{
ItemStack itemstack = this.villagerInventory.getStackInSlot(i);
if (!itemstack.func_190926_b() && (itemstack.getItem() == Items.WHEAT_SEEDS || itemstack.getItem() == Items.POTATO || itemstack.getItem() == Items.CARROT || itemstack.getItem() == Items.BEETROOT_SEEDS))
{
return true;
}
}
return false;
}
示例2: isFarmItemInInventory
/**
* Returns true if villager has seeds, potatoes or carrots in inventory
*/
public boolean isFarmItemInInventory()
{
for (int i = 0; i < this.villagerInventory.getSizeInventory(); ++i)
{
ItemStack itemstack = this.villagerInventory.getStackInSlot(i);
if (itemstack != null && (itemstack.getItem() == Items.WHEAT_SEEDS || itemstack.getItem() == Items.POTATO || itemstack.getItem() == Items.CARROT || itemstack.getItem() == Items.BEETROOT_SEEDS))
{
return true;
}
}
return false;
}
示例3: getSeed
protected Item getSeed() {
return Items.BEETROOT_SEEDS;
}
示例4: updateTask
/**
* Updates the task
*/
public void updateTask()
{
super.updateTask();
this.theVillager.getLookHelper().setLookPosition((double)this.destinationBlock.getX() + 0.5D, (double)(this.destinationBlock.getY() + 1), (double)this.destinationBlock.getZ() + 0.5D, 10.0F, (float)this.theVillager.getVerticalFaceSpeed());
if (this.getIsAboveDestination())
{
World world = this.theVillager.world;
BlockPos blockpos = this.destinationBlock.up();
IBlockState iblockstate = world.getBlockState(blockpos);
Block block = iblockstate.getBlock();
if (this.currentTask == 0 && block instanceof BlockCrops && ((BlockCrops)block).isMaxAge(iblockstate))
{
world.destroyBlock(blockpos, true);
}
else if (this.currentTask == 1 && iblockstate.getMaterial() == Material.AIR)
{
InventoryBasic inventorybasic = this.theVillager.getVillagerInventory();
for (int i = 0; i < inventorybasic.getSizeInventory(); ++i)
{
ItemStack itemstack = inventorybasic.getStackInSlot(i);
boolean flag = false;
if (!itemstack.func_190926_b())
{
if (itemstack.getItem() == Items.WHEAT_SEEDS)
{
world.setBlockState(blockpos, Blocks.WHEAT.getDefaultState(), 3);
flag = true;
}
else if (itemstack.getItem() == Items.POTATO)
{
world.setBlockState(blockpos, Blocks.POTATOES.getDefaultState(), 3);
flag = true;
}
else if (itemstack.getItem() == Items.CARROT)
{
world.setBlockState(blockpos, Blocks.CARROTS.getDefaultState(), 3);
flag = true;
}
else if (itemstack.getItem() == Items.BEETROOT_SEEDS)
{
world.setBlockState(blockpos, Blocks.BEETROOTS.getDefaultState(), 3);
flag = true;
}
}
if (flag)
{
itemstack.func_190918_g(1);
if (itemstack.func_190926_b())
{
inventorybasic.setInventorySlotContents(i, ItemStack.field_190927_a);
}
break;
}
}
}
this.currentTask = -1;
this.runDelay = 10;
}
}
示例5: canVillagerPickupItem
private boolean canVillagerPickupItem(Item itemIn)
{
return itemIn == Items.BREAD || itemIn == Items.POTATO || itemIn == Items.CARROT || itemIn == Items.WHEAT || itemIn == Items.WHEAT_SEEDS || itemIn == Items.BEETROOT || itemIn == Items.BEETROOT_SEEDS;
}
示例6: getSeed
protected Item getSeed()
{
return Items.BEETROOT_SEEDS;
}
示例7: updateTask
/**
* Updates the task
*/
public void updateTask()
{
super.updateTask();
this.theVillager.getLookHelper().setLookPosition((double)this.destinationBlock.getX() + 0.5D, (double)(this.destinationBlock.getY() + 1), (double)this.destinationBlock.getZ() + 0.5D, 10.0F, (float)this.theVillager.getVerticalFaceSpeed());
if (this.getIsAboveDestination())
{
World world = this.theVillager.worldObj;
BlockPos blockpos = this.destinationBlock.up();
IBlockState iblockstate = world.getBlockState(blockpos);
Block block = iblockstate.getBlock();
if (this.currentTask == 0 && block instanceof BlockCrops && ((BlockCrops)block).isMaxAge(iblockstate))
{
world.destroyBlock(blockpos, true);
}
else if (this.currentTask == 1 && iblockstate.getMaterial() == Material.AIR)
{
InventoryBasic inventorybasic = this.theVillager.getVillagerInventory();
for (int i = 0; i < inventorybasic.getSizeInventory(); ++i)
{
ItemStack itemstack = inventorybasic.getStackInSlot(i);
boolean flag = false;
if (itemstack != null)
{
if (itemstack.getItem() == Items.WHEAT_SEEDS)
{
world.setBlockState(blockpos, Blocks.WHEAT.getDefaultState(), 3);
flag = true;
}
else if (itemstack.getItem() == Items.POTATO)
{
world.setBlockState(blockpos, Blocks.POTATOES.getDefaultState(), 3);
flag = true;
}
else if (itemstack.getItem() == Items.CARROT)
{
world.setBlockState(blockpos, Blocks.CARROTS.getDefaultState(), 3);
flag = true;
}
else if (itemstack.getItem() == Items.BEETROOT_SEEDS)
{
world.setBlockState(blockpos, Blocks.BEETROOTS.getDefaultState(), 3);
flag = true;
}
}
if (flag)
{
--itemstack.stackSize;
if (itemstack.stackSize <= 0)
{
inventorybasic.setInventorySlotContents(i, (ItemStack)null);
}
break;
}
}
}
this.currentTask = -1;
this.runDelay = 10;
}
}