use of betterwithmods.common.blocks.tile.SimpleStackHandler in project BetterWithAddons by DaedalusGame.
the class HopperCratingRecipe method craft.
@Override
public void craft(EntityItem inputStack, World world, BlockPos pos) {
TileEntityFilteredHopper tile = (TileEntityFilteredHopper) world.getTileEntity(pos);
SimpleStackHandler inventory = tile.inventory;
if (!InvUtils.consumeItemsInInventory(inventory, input, 7, false)) {
return;
}
InvUtils.ejectStackWithOffset(world, pos.down(1), this.output.copy());
this.onCraft(world, pos, inputStack);
}
use of betterwithmods.common.blocks.tile.SimpleStackHandler in project BetterWithAddons by DaedalusGame.
the class HopperCratingRecipe method canCraft.
@Override
public boolean canCraft(World world, BlockPos pos) {
IBlockState crateState = world.getBlockState(pos.down());
TileEntityFilteredHopper tile = (TileEntityFilteredHopper) world.getTileEntity(pos);
SimpleStackHandler inventory = tile.inventory;
if (!isCrate(crateState)) {
return false;
}
return true;
}
Aggregations