use of net.minecraft.entity.item.EntityItem in project BluePower by Qmunity.
the class TileProjectTable method craft.
protected void craft() {
for (int i = 0; i < craftingGrid.length; ++i) {
ItemStack itemstack1 = craftingGrid[i];
if (itemstack1 != null) {
boolean pulledFromInventory = false;
if (craftingGrid[i].stackSize == 1) {
ItemStack stackFromTable = ContainerProjectTable.extractStackFromTable(this, craftingGrid[i], false);
pulledFromInventory = stackFromTable != null;
}
if (!pulledFromInventory) {
craftingGrid[i].stackSize--;
if (craftingGrid[i].stackSize <= 0)
craftingGrid[i] = null;
}
if (itemstack1.getItem().hasContainerItem(itemstack1)) {
ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1);
if (itemstack2 != null && itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage()) {
continue;
}
if (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1)) {
ItemStack remainder = IOHelper.insert(this, itemstack2, 0, false);
if (remainder != null) {
worldObj.spawnEntityInWorld(new EntityItem(worldObj, xCoord, yCoord, zCoord, remainder));
}
}
}
}
}
}
use of net.minecraft.entity.item.EntityItem in project BluePower by Qmunity.
the class TileTransposer method suckItems.
private void suckItems() {
for (EntityItem entity : (List<EntityItem>) worldObj.getEntitiesWithinAABB(EntityItem.class, ITEM_SUCK_AABBS[getFacingDirection().ordinal()].copy().offset(xCoord, yCoord, zCoord))) {
ItemStack stack = entity.getEntityItem();
if (isItemAccepted(stack) && !entity.isDead) {
addItemToOutputBuffer(stack, getAcceptedItemColor(stack));
entity.setDead();
}
}
}
use of net.minecraft.entity.item.EntityItem in project LogisticsPipes by RS485.
the class PipeItemsRequestLogisticsMk2 method dropDisk.
public void dropDisk() {
if (disk != null) {
EntityItem item = new EntityItem(getWorld(), getX(), getY(), getZ(), disk);
getWorld().spawnEntityInWorld(item);
disk = null;
}
}
use of net.minecraft.entity.item.EntityItem in project LogisticsPipes by RS485.
the class PipeItemsSystemDestinationLogistics method dropFreqCard.
private void dropFreqCard() {
if (inv.getStackInSlot(0) == null) {
return;
}
EntityItem item = new EntityItem(getWorld(), getX(), getY(), getZ(), inv.getStackInSlot(0));
getWorld().spawnEntityInWorld(item);
inv.clearInventorySlotContents(0);
}
use of net.minecraft.entity.item.EntityItem in project LogisticsPipes by RS485.
the class PipeItemsSystemEntranceLogistics method dropFreqCard.
private void dropFreqCard() {
if (inv.getStackInSlot(0) == null) {
return;
}
EntityItem item = new EntityItem(getWorld(), getX(), getY(), getZ(), inv.getStackInSlot(0));
getWorld().spawnEntityInWorld(item);
inv.clearInventorySlotContents(0);
}
Aggregations