本文整理汇总了Java中net.minecraft.entity.item.EntityItem.cannotPickup方法的典型用法代码示例。如果您正苦于以下问题:Java EntityItem.cannotPickup方法的具体用法?Java EntityItem.cannotPickup怎么用?Java EntityItem.cannotPickup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.item.EntityItem
的用法示例。
在下文中一共展示了EntityItem.cannotPickup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onLivingUpdate
import net.minecraft.entity.item.EntityItem; //导入方法依赖的package包/类
/**
* Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
* use this to react to sunlight and start to burn.
*/
public void onLivingUpdate()
{
super.onLivingUpdate();
this.worldObj.theProfiler.startSection("looting");
if (!this.worldObj.isRemote && this.canPickUpLoot() && !this.dead && this.worldObj.getGameRules().getBoolean("mobGriefing"))
{
for (EntityItem entityitem : this.worldObj.getEntitiesWithinAABB(EntityItem.class, this.getEntityBoundingBox().expand(1.0D, 0.0D, 1.0D)))
{
if (!entityitem.isDead && entityitem.getEntityItem() != null && !entityitem.cannotPickup())
{
this.updateEquipmentIfNeeded(entityitem);
}
}
}
this.worldObj.theProfiler.endSection();
}
示例2: onLivingUpdate
import net.minecraft.entity.item.EntityItem; //导入方法依赖的package包/类
/**
* Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
* use this to react to sunlight and start to burn.
*/
public void onLivingUpdate()
{
super.onLivingUpdate();
this.world.theProfiler.startSection("looting");
if (!this.world.isRemote && this.canPickUpLoot() && !this.dead && this.world.getGameRules().getBoolean("mobGriefing"))
{
for (EntityItem entityitem : this.world.getEntitiesWithinAABB(EntityItem.class, this.getEntityBoundingBox().expand(1.0D, 0.0D, 1.0D)))
{
if (!entityitem.isDead && !entityitem.getEntityItem().func_190926_b() && !entityitem.cannotPickup())
{
this.updateEquipmentIfNeeded(entityitem);
}
}
}
this.world.theProfiler.endSection();
}