本文整理匯總了Java中net.minecraft.tileentity.TileEntityHopper.func_145898_a方法的典型用法代碼示例。如果您正苦於以下問題:Java TileEntityHopper.func_145898_a方法的具體用法?Java TileEntityHopper.func_145898_a怎麽用?Java TileEntityHopper.func_145898_a使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.tileentity.TileEntityHopper
的用法示例。
在下文中一共展示了TileEntityHopper.func_145898_a方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: func_96112_aD
import net.minecraft.tileentity.TileEntityHopper; //導入方法依賴的package包/類
public boolean func_96112_aD()
{
if (TileEntityHopper.func_145891_a(this))
{
return true;
}
else
{
List var1 = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything);
if (var1.size() > 0)
{
TileEntityHopper.func_145898_a(this, (EntityItem)var1.get(0));
}
return false;
}
}
示例2: func_96112_aD
import net.minecraft.tileentity.TileEntityHopper; //導入方法依賴的package包/類
public boolean func_96112_aD()
{
if (TileEntityHopper.func_145891_a(this))
{
return true;
}
else
{
List list = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything);
if (list.size() > 0)
{
TileEntityHopper.func_145898_a(this, (EntityItem)list.get(0));
}
return false;
}
}
示例3: captureItemsInside
import net.minecraft.tileentity.TileEntityHopper; //導入方法依賴的package包/類
public boolean captureItemsInside()
{
boolean didCapture = false;
List<EntityItem> itemEntities = getItemEntitiesInside();
for (EntityItem itemEntity : itemEntities)
{
if (canItemEscape(itemEntity.getEntityItem()))
continue;
// func_145898_a = insertStackFromEntity
didCapture = didCapture || TileEntityHopper.func_145898_a(this, itemEntity);
}
return didCapture;
}
示例4: onEntityCollidedWithBlock
import net.minecraft.tileentity.TileEntityHopper; //導入方法依賴的package包/類
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, Entity entity) {
TileEntityFoodBowl foodBowl = (TileEntityFoodBowl) world.getTileEntity(pos);
List list = null;
list = world.getEntitiesWithinAABB(EntityZertumEntity.class, new AxisAlignedBB(pos.getX(), pos.getY() + 0.5D, pos.getZ(), pos.getX() + 1, pos.getY() + 0.5D + 0.05000000074505806D, pos.getZ() + 1));
if (list != null && list.size() > 0) {
for (int l = 0; l < list.size(); l++) {
EntityZertumEntity zertum = (EntityZertumEntity) list.get(l);
if (zertum.mode.isMode(EnumMode.WANDERING)) {
zertum.setHomePosAndDistance(pos, 5);
System.out.println("Saved Position for " + zertum.getPetName() + " at " + zertum.getHomePosition() + " with max distance of " + zertum.getMaximumHomeDistance());
}
}
}
if (entity instanceof EntityItem) {
EntityItem entityItem = (EntityItem) entity;
if (TileEntityHopper.func_145898_a(foodBowl, entityItem)) {
world.playSoundEffect(pos.getX() + 0.5D, pos.getX() + 0.5D, pos.getZ() + 0.5D, "random.pop", 0.25F, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
}
}
List list2 = null;
list2 = world.getEntitiesWithinAABB(EntityZertumEntity.class, new AxisAlignedBB(pos.getX(), pos.getY() + 0.5D, pos.getZ(), pos.getX() + 1, pos.getY() + 0.5D + 0.05000000074505806D, pos.getZ() + 1));
if (list2 != null && list2.size() > 0) {
TileEntity tileentity1 = world.getTileEntity(pos);
if (!(tileentity1 instanceof TileEntityFoodBowl)) {
return;
}
TileEntityFoodBowl tileentitydogfoodbowl1 = (TileEntityFoodBowl) tileentity1;
for (int j1 = 0; j1 < list2.size(); j1++) {
EntityZertumEntity entitydtdoggy1 = (EntityZertumEntity) list2.get(j1);
if (entitydtdoggy1.getZertumHunger() <= 60 && tileentitydogfoodbowl1.getFirstDogFoodStack(entitydtdoggy1) >= 0) {
tileentitydogfoodbowl1.feedDog(entitydtdoggy1, tileentitydogfoodbowl1.getFirstDogFoodStack(entitydtdoggy1), 1);
}
}
}
}